openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Helen Xu (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2233) Failed to invoke pcGetIDOwningClass method on embeddable entity with ID annotation
Date Tue, 17 Jul 2012 15:40:35 GMT
Helen Xu created OPENJPA-2233:

             Summary: Failed to invoke pcGetIDOwningClass method on embeddable entity with
ID annotation
                 Key: OPENJPA-2233
             Project: OpenJPA
          Issue Type: Bug
          Components: Enhance
    Affects Versions: 2.2.0, 2.1.0, 2.0.1, 2.3.0
            Reporter: Helen Xu
            Assignee: Helen Xu

It failed to invoke pcGetIDOwningClass method on an embeddable entity which has the ID annotation.
here is the exception:

java.lang.NoSuchMethodError: com/xxx/xxx/entity/MyClass.pcGetIDOwningClass()Ljava/lang/Class;
at org.apache.openjpa.enhance.PCRegistry.newObjectId(
at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClass(
at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClasses(
at org.apache.openjpa.meta.ClassMetaData.getPCSubclasses(
at org.apache.openjpa.jdbc.meta.MappingRepository.findBaseClassMapping(
at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(
at org.apache.openjpa.meta.MetaDataRepository.preMapping(
at org.apache.openjpa.meta.MetaDataRepository.resolve(
at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(
at org.apache.openjpa.meta.MetaDataRepository.getMetaData(
at org.apache.openjpa.meta.MetaDataRepository.resolveAll(
at org.apache.openjpa.meta.MetaDataRepository.getQueryMetaDataInternal(
at org.apache.openjpa.meta.MetaDataRepository.getQueryMetaData(
at org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery(

This is because it uses different condition to add and invoke pcNewObjectIdInstance method
in PCEnhancer.

here is the section it adds pcNewObjectIdInstance in PCEnhancer.addPCMethods

            if (_meta.hasAbstractPKField() == true) { 

here is the section it invokes pcNewObjectIdInstance in PCEnhancer.addNewObjectIdInstanceMethod

          if(_meta.isEmbeddedOnly() || _meta.hasAbstractPKField() == true) {
                code.invokevirtual().setMethod(PRE + "GetIDOwningClass",
                    Class.class, null);
            } else {

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message