Hello Team,
               We have been using openjpa – 2.4.0 for our application data 
access layer which will be deployed in Jboss Fuse 6.2.1.
We have persistence xml where all the entities are declared.

Very Frequently that we are facing the below issue and had to restart the 
container multiple to get the issue resolved.

java.lang.reflect.UndeclaredThrowableException
        at com.sun.proxy.$Proxy29.createQuery(Unknown Source)
        at 
com.mysema.query.jpa.impl.AbstractJPAQuery.createQuery(AbstractJPAQuery.java:127)[744:com.mysema.querydsl.jpa:3.6.3]
               …………….
Caused by: java.lang.reflect.UndeclaredThrowableException
        at com.sun.proxy.$Proxy103.createQuery(Unknown Source)
        ... 67 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_79]
        at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_79]
        at 
org.apache.aries.jpa.container.impl.EntityManagerProxyFactory$EMHandler.invoke(EntityManagerProxyFactory.java:31)
        ... 68 more
Caused by: <openjpa-2.4.0-r422266:1674604 nonfatal user error> 
org.apache.openjpa.persistence.ArgumentException: An error occurred while 
parsing the query filter "select cETAssignmentException_
from CETAssignmentException cETAssignmentException_
where lower(cETAssignmentException_.id.officeCode) = ?1 and 
lower(cETAssignmentException_.id.businessSegmentCode) = ?2". Error message: The 
name "CETAssignmentException" is not a recognized entity or identifier. Perhaps 
you meant CDDCaseLocation, which is a close match. Known entity names: 
[IndividualReferencesAsu, RmaExcllist, WbSanctionsQuestionnaire, IndividualAsu, 
SpeDocumentsChecklist, Property, MvSciClientGrpInfo, CddAdditionalDetails, 
CopiFatcaSubownersInfo, DocumentTemplate, ClientBranchOffices, 
RoccoDecisionReportPK, CddCaseActorsPK, DdCase, ClientIndividualReln, 
EcddSciCasePublish, ForeignExchange, CaseDetail, CopiFatcaTaxInfo, NorkomTxn, 
CopiFatcaDocument, ClientGroup, ClientIndividual, OpaScreen, Country, 
MvSciClientInfo, IndividualNorkom, CddRisks, IndividualNorkomAsu, 
ClientOfficeProducts, CddCaseAuditPK, AtfFieldsMaster, CddDdrBasedRouting, 
PreScreening, CddCasePK, MvSciClientOrgInfo, WorkflowState, RoccoRequest, 
RoccoRequestAuditPK, Risks, MvSciClientAddrInfo, GaProductTransaction, 
ClientDocuments, Bba, ClientBranch, ClientNorkomPK, ClientISIC, 
MvSciArmCodeInfo, DDCCountries, Client, GroupNorkom, IndividualClientReln, Ga, 
OPARuleBases, CDDWorkflowState, SubReasonCodes, MoneyMarket, OpaError, 
DefenceGoodsStatus, CDDStateMachine, LegalConstitution, ReasonCodes, 
RoccoRequestAudit, Address, BranchNorkom, FiDocumentsChecklist, 
CopiFatcaStatusInfo, CddCase, Cdd, CddPepSummary, Bonds, BbaDocumentsChecklist, 
ClientOffice, CDDCaseLocation, MvSciEmpInfo, GaDocumentChecklist, 
TaskBasedReasonCodes, BranchAddress, DgStatusDecisionMatrix, CashEquities, 
IndividualReferences, EcddSciPublish, CddCaseAudit, BusinessSubSegment, 
OPACases, ClientIndividualRelnPK, IndividualReferencesAsuPK, Product, 
ClientNorkom, BusinessSegment, DocumentCategory, CoDocumentsChecklist, 
CddCaseAuditSubReasons, IndividualClientRelnAsu, TaskBasedReasonCodesPK, 
CustomerCountryRisk, PreScreeningComment, BbaRiskQuestion, IndividualDocuments, 
FormButton, Documents, BbaAdditionalDetails, ClientType, GuarantorNorkomPK, 
AnticipatedTransaction, CddPepDetail, GoodsType, CddCaseActors, 
GuarantorNorkom, CddCountryRisk, CountryOffices, CopiFatca, 
CddWorkflowReassignment, Norkom, Deferral, DocumentsUpload, 
ClientTriggerEvents, CopiFatcaStatus, Gic, BusinessSubSegmentPK, 
ParentGroupDetails, MvSciClientCoreInfo, RequestMap, CddRiskQuestions, 
DefenceGoods, OPADecisionReport, AtfRequestTxn, Individual, ReviewCases, 
MvSciArmLocation, DefenceGoodsDecision, ClientIndividualPK, 
RoccoDecisionReport, IndividualPK, CddTaskAction, PreScreeningRef, 
ClientGuarantor, Derivative]
        at 
org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(AbstractExpressionBuilder.java:118)[848:org.apache.openjpa:2.4.0]
        at 
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:193)[848:org.apache.openjpa:2.4.0]
        at 
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:166)[848:org.apache.openjpa:2.4.0]

Looks like the entity CETAssignmentException is not in the open-jpa list which 
is used in setting the values using Reflection.

Below is the TRACE log enabled in openjpa.

3724779  bowbMSPersistenceUnit  WARN   [qtp1069331902-407] openjpa.MetaData - 
The class "com.scb.cic.wb.cdd.ds.db.model.sci.SciOffices" listed in the 
openjpa.MetaDataFactory configuration property could not be loaded by 
wb-svc-cdd [970]; ignoring.
3724779  bowbMSPersistenceUnit  WARN   [qtp1069331902-407] openjpa.MetaData - 
The class "com.scb.cic.wb.cdd.ds.db.model.sci.SciAssignment" listed in the 
openjpa.MetaDataFactory configuration property could not be loaded by 
wb-svc-cdd [970]; ignoring.
3724779  bowbMSPersistenceUnit  WARN   [qtp1069331902-407] openjpa.MetaData - 
The class "com.scb.cic.wb.cdd.ds.db.model.task.CETAssignmentExceptionPK" listed 
in the openjpa.MetaDataFactory configuration property could not be loaded by 
wb-svc-cdd [970]; ignoring.
3724779  bowbMSPersistenceUnit  WARN   [qtp1069331902-407] openjpa.MetaData - 
The class "com.scb.cic.wb.cdd.ds.db.model.task.CETAssignmentException" listed 
in the openjpa.MetaDataFactory configuration property could not be loaded by 
wb-svc-cdd [970]; ignoring.


and debugged with the source code and found that

private Class<?> classForName(String name, ClassLoader loader) {
        try {
            return Class.forName(name, true, loader);
        } catch (Exception e) {
            if ((_validate & VALIDATE_RUNTIME) != 0) {
                if (_log.isWarnEnabled())
                    _log.warn(_loc.get("bad-discover-class", name, loader));
            } else if (_log.isInfoEnabled())
                _log.info(_loc.get("bad-discover-class", name, loader));
            if (_log.isTraceEnabled())
                _log.trace(e);
        } catch (NoSuchMethodError nsme) {
            if (nsme.getMessage().indexOf(".pc") == -1)
                throw nsme;

            // if the error is about a method that uses the PersistenceCapable
            // 'pc' method prefix, perform some logging and continue. This
            // probably just means that the class is not yet enhanced.
            if ((_validate & VALIDATE_RUNTIME) != 0) {
                if (_log.isWarnEnabled())
                    _log.warn(_loc.get("bad-discover-class", name, loader));
            } else if (_log.isInfoEnabled())
                _log.info(_loc.get("bad-discover-class", name, loader));
            if (_log.isTraceEnabled())
                _log.trace(nsme);
        }
        return null;
    }


Above entities are ignored in enhancement while the class is loaded. So, added 
below in persistence.xml

<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/> --> in 
order to enhance dynamically during run time.

Additionally we have also enabled enhancement during build time by
<plugin>
                    <groupId>org.apache.openjpa</groupId>
                    <artifactId>openjpa-maven-plugin</artifactId>
                    <version>${openjpa-maven-plugin.version}</version>

                    <configuration>
                    </configuration>

                    <executions>
                        <execution>
                            <id>enhancer</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>enhance</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>


But still facing the same issue.

This issue has become a serious issue. It would be great if the team could help 
us in resolving the issue.

Thanks.

Regards
Senthil Kumar Sekar

Reply via email to