Topic
  • 8 replies
  • Latest Post - ‏2012-10-01T21:02:40Z by Heath_Thomann
JodySchraden
JodySchraden
4 Posts

Pinned topic Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

‏2011-03-01T22:59:57Z |
Hi,
I recently re-installed WAS 7.0.0.13 and applied the latest JPA 2.0 - 1.0.0.3feature pack. I am getting errors regarding classes not being enhanced (which they aren't). I was not getting this error prior to upgrading the feature pack (I had WAS 7.0.0.13 JPA 2.0 1.0.0.1) and deploying on a z/OS WAS with that version does not get any errors. Does the latest JPA feature pack, with the IBM JPA provider, require enhanced classes or is there another root cause for this? If I switch to the apache provider, then everything works as it did before. Interestingly enough, I have a MappedSuperclass which all of my JPA entities extend from. If I change my entities to no longer subclass this class and I add this property to my persistence.xml file - <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>, then it worked with the IBM provider. So is build time enhancement now required if you use the IBM provider now? Is there a RAD/RSA plug-in/builder for JPA enhance?
Updated on 2012-10-01T21:02:40Z at 2012-10-01T21:02:40Z by Heath_Thomann
  • sutter
    sutter
    94 Posts

    Re: Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

    ‏2011-03-02T14:46:18Z  
    Hi JodyShraden,
    Actually, the IBM JPA provider has required enhancement for quite some time, even before the JPA 2.0 Feature Pack. The IBM JPA provider explicity disables the RuntimeUnenhancedClasses capability of OpenJPA due to several issues associated with that feature.

    When using JPA within a managed application server environment, this normally wouldn't affect your processing since the enhancement is done automatically when the Entity classes are first loaded by the Container's classloader. There is a specification-defined hook that allows the JPA enhancement plugin to get called during the classloading process.

    A quick look at the provided call stacks would seem to show that you are running in a managed environment and I would have expected the enhancement to be done for you. And, you said that this exact same scenario worked just fine with the 1.0.0.1 fixpack level of the JPA 2.0 FeP, correct?

    The other thing that is strange is that you are not getting the classic or expected error message about unenhanced Entity classes. Normally, unenhanced classes are detected very early in the processing and an appropriate error message is logged. Your call stacks seem to show that we're getting past this check and we're failing when attempting to call a "persistence capable" method called pcGetManagedFieldCount.

    One thing that caught my eye in the call stack is that you seem to be using the Criteria API. This is a new feature for JPA 2.0, but since you said everything worked just fine with the 1.0.0.1 fixpack, this shouldn't make a difference. Just highlighting it for now...

    I'll reach out to my support team member to see if anything has been reported in this area, but this sounds like a potential PMR. In the mean time, if you could run the scenario with "openjpa=all:JPA=all" trace spec, that should help narrow down the problem.

    Thanks,
    Kevin
  • JodySchraden
    JodySchraden
    4 Posts

    Re: Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

    ‏2011-03-02T15:55:17Z  
    • sutter
    • ‏2011-03-02T14:46:18Z
    Hi JodyShraden,
    Actually, the IBM JPA provider has required enhancement for quite some time, even before the JPA 2.0 Feature Pack. The IBM JPA provider explicity disables the RuntimeUnenhancedClasses capability of OpenJPA due to several issues associated with that feature.

    When using JPA within a managed application server environment, this normally wouldn't affect your processing since the enhancement is done automatically when the Entity classes are first loaded by the Container's classloader. There is a specification-defined hook that allows the JPA enhancement plugin to get called during the classloading process.

    A quick look at the provided call stacks would seem to show that you are running in a managed environment and I would have expected the enhancement to be done for you. And, you said that this exact same scenario worked just fine with the 1.0.0.1 fixpack level of the JPA 2.0 FeP, correct?

    The other thing that is strange is that you are not getting the classic or expected error message about unenhanced Entity classes. Normally, unenhanced classes are detected very early in the processing and an appropriate error message is logged. Your call stacks seem to show that we're getting past this check and we're failing when attempting to call a "persistence capable" method called pcGetManagedFieldCount.

    One thing that caught my eye in the call stack is that you seem to be using the Criteria API. This is a new feature for JPA 2.0, but since you said everything worked just fine with the 1.0.0.1 fixpack, this shouldn't make a difference. Just highlighting it for now...

    I'll reach out to my support team member to see if anything has been reported in this area, but this sounds like a potential PMR. In the mean time, if you could run the scenario with "openjpa=all:JPA=all" trace spec, that should help narrow down the problem.

    Thanks,
    Kevin
    Hi Kevin,
    Thanks for the reply. I have attached the trace file below from a clean server restart and then executed the query. Yes, we are using container managed transactions in WebSphere and this particular function is using the Criteria query api. If it matters, I'm using Rational Software Architect 8.0.0.1 and running/debugging on a local WebSphere 7.0.0.13 JPA 2.0 1.0.0.3 container on Windows XP. When deployed on WAS 7.0.0.13 JPA 2.0 1.0.0.1, all works ok.

    I do see this in the trace file:

    3/2/11 9:33:12:234 CST 00000016 OpenJPA 3 openjpa.Enhance: Trace: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "

    What would cause them not to get Enhanced at class load time? I assume, based on your previous response, and from what I've read, that WebSphere should have enhanced them at class load time.

    This same code not only works on the prior feature pack version, but works on the latest version as well if I switch to the org.apache.openjpa.persistence.PersistenceProviderImpl class. It breaks when using the latest feature pack version and the IBM persistence provider class.

    If you need more info or have more questions, let me know. I also am an IBMer, so you can reply through here or ping me on Sametime.

    Thanks,

    Jody

    Attachments

  • sutter
    sutter
    94 Posts

    Re: Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

    ‏2011-03-02T16:39:47Z  
    Hi Kevin,
    Thanks for the reply. I have attached the trace file below from a clean server restart and then executed the query. Yes, we are using container managed transactions in WebSphere and this particular function is using the Criteria query api. If it matters, I'm using Rational Software Architect 8.0.0.1 and running/debugging on a local WebSphere 7.0.0.13 JPA 2.0 1.0.0.3 container on Windows XP. When deployed on WAS 7.0.0.13 JPA 2.0 1.0.0.1, all works ok.

    I do see this in the trace file:

    3/2/11 9:33:12:234 CST 00000016 OpenJPA 3 openjpa.Enhance: Trace: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "

    What would cause them not to get Enhanced at class load time? I assume, based on your previous response, and from what I've read, that WebSphere should have enhanced them at class load time.

    This same code not only works on the prior feature pack version, but works on the latest version as well if I switch to the org.apache.openjpa.persistence.PersistenceProviderImpl class. It breaks when using the latest feature pack version and the IBM persistence provider class.

    If you need more info or have more questions, let me know. I also am an IBMer, so you can reply through here or ping me on Sametime.

    Thanks,

    Jody
    Hi Jody,
    Thanks for the trace. The trace shows that an earlier path through your scenario does actually hook in the transform into the classpath, but only a single class (MembershipDAO) is put through this processing. And, it's determined that this particular class does not need enhancing...

    3/2/11 9:33:11:984 CST 00000016 JPAPUnitInfo > addTransformer: PUID = PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, transformer = org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl@24812481 Entry
    3/2/11 9:33:11:984 CST 00000016 JPAPUnitInfo < addTransformer : # registered transfromer = 1 Exit
    :
    :
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo > transformClass: PUID = PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, class name = org.opers.dao.MembershipDAO Entry
    :
    :
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo > classNeedsTransform : PUID = PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, class name = org.opers.dao.MembershipDAO Entry
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo < classNeedsTransform : org.opers.dao.MembershipDAO needs transform. Exit
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo 3 transformer:org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl@24812481, org.opers.dao.MembershipDAO is NOT transformed. Byte length(old/new)=6108/6108
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo < transformClass: 0/1 Exit

    Then, shortly after that point, we're finding all of the classes that need to be examined (again), but I don't see where the transformer is hooked in. We just output the message that all of these types are not enhanced...

    3/2/11 9:33:12:234 CST 00000016 OpenJPA 3 openjpa.MetaData: Trace: Found 14 classes with metadata in 16 milliseconds.
    3/2/11 9:33:12:234 CST 00000016 OpenJPA 3 openjpa.Enhance: Trace: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "
    org.opers.model.OtherRetirementSystem
    org.opers.model.EmployerHistory
    org.opers.model.ServiceSummary
    org.opers.model.OpersObject
    org.opers.model.AccountRelationship
    org.opers.model.Person
    org.opers.model.ServiceDetail
    org.opers.model.TransactionHistory
    org.opers.model.Employer
    org.opers.model.Account
    org.opers.model.ContactInfo
    org.opers.model.AddressLink
    org.opers.model.Address
    org.opers.model.PersonAccountKey".
    3/2/11 9:33:12:250 CST 00000016 JPAEMPool < getEntityManager : [0] com.ibm.ws.persistence.EntityManagerImpl@69446944 Exit

    So, the question is why are we hooked in with a transformer on one path, but not the other. Same thread of processing, so we should have the same classloader. More investigation... I'll contact the Container team next.

    It's good to know that you are an IBMer in case we need more information. But, let's keep the basic conversation going here until we either resolve it or open a PMR for tracking. That way, other customers may benefit from the conversation.

    Thanks,
    Kevin
  • sutter
    sutter
    94 Posts

    Re: Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

    ‏2011-03-03T14:22:33Z  
    • sutter
    • ‏2011-03-02T16:39:47Z
    Hi Jody,
    Thanks for the trace. The trace shows that an earlier path through your scenario does actually hook in the transform into the classpath, but only a single class (MembershipDAO) is put through this processing. And, it's determined that this particular class does not need enhancing...

    3/2/11 9:33:11:984 CST 00000016 JPAPUnitInfo > addTransformer: PUID = PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, transformer = org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl@24812481 Entry
    3/2/11 9:33:11:984 CST 00000016 JPAPUnitInfo < addTransformer : # registered transfromer = 1 Exit
    :
    :
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo > transformClass: PUID = PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, class name = org.opers.dao.MembershipDAO Entry
    :
    :
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo > classNeedsTransform : PUID = PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, class name = org.opers.dao.MembershipDAO Entry
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo < classNeedsTransform : org.opers.dao.MembershipDAO needs transform. Exit
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo 3 transformer:org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl@24812481, org.opers.dao.MembershipDAO is NOT transformed. Byte length(old/new)=6108/6108
    3/2/11 9:33:12:015 CST 00000016 JPAPUnitInfo < transformClass: 0/1 Exit

    Then, shortly after that point, we're finding all of the classes that need to be examined (again), but I don't see where the transformer is hooked in. We just output the message that all of these types are not enhanced...

    3/2/11 9:33:12:234 CST 00000016 OpenJPA 3 openjpa.MetaData: Trace: Found 14 classes with metadata in 16 milliseconds.
    3/2/11 9:33:12:234 CST 00000016 OpenJPA 3 openjpa.Enhance: Trace: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "
    org.opers.model.OtherRetirementSystem
    org.opers.model.EmployerHistory
    org.opers.model.ServiceSummary
    org.opers.model.OpersObject
    org.opers.model.AccountRelationship
    org.opers.model.Person
    org.opers.model.ServiceDetail
    org.opers.model.TransactionHistory
    org.opers.model.Employer
    org.opers.model.Account
    org.opers.model.ContactInfo
    org.opers.model.AddressLink
    org.opers.model.Address
    org.opers.model.PersonAccountKey".
    3/2/11 9:33:12:250 CST 00000016 JPAEMPool < getEntityManager : [0] com.ibm.ws.persistence.EntityManagerImpl@69446944 Exit

    So, the question is why are we hooked in with a transformer on one path, but not the other. Same thread of processing, so we should have the same classloader. More investigation... I'll contact the Container team next.

    It's good to know that you are an IBMer in case we need more information. But, let's keep the basic conversation going here until we either resolve it or open a PMR for tracking. That way, other customers may benefit from the conversation.

    Thanks,
    Kevin
    Hi Jody,
    Thanks for the trace.log file. After some further review, we were able to determine that the transformer (enhancer) was not properly linked into the classloader. Here are the relevant entries in the log:

    3/2/11 9:27:22:218 CST 0000000a OpenJPA 3 openjpa.Runtime: Trace: An error occurred while registering a ClassTransformer with JPAPUnitInfo(PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel)@2b622b62. The error is logged along with this warning. Load-time class transformation will not be available.
    Exception : org.apache.commons.lang.exception.NestableRuntimeException
    org.apache.commons.lang.exception.NestableRuntimeException: An error occurred attempting to invoke JDBC 3 method. Your driver or database may not support JDBC 3 features.

    Going further back up the log, I found the following entries:

    3/2/11 9:27:21:890 CST 0000000a OpenJPA 3 openjpa.MetaData: Trace: Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@39203920".
    3/2/11 9:27:21:906 CST 0000000a OpenJPA 3 openjpa.jdbc.JDBC: Trace: OpenJPA will now connect to the database to attempt to determine what type of database dictionary to use. You may prevent this connection in the future by setting your openjpa.jdbc.DBDictionary configuration property to the appropriate value for your database (see the documentation for available values).
    3/2/11 9:27:21:906 CST 0000000a OpenJPA 3 openjpa.jdbc.JDBC: Trace: createConnectionFactory: DataSource:GenericDataSource@fd40fd4PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, java:comp/env/jdbc/myCustomDataSource
    3/2/11 9:27:22:093 CST 0000000a GenericDataSo > getConnection : PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel Entry
    3/2/11 9:27:22:093 CST 0000000a GenericConnec > <init> : PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, dataSourceName = java:comp/env/jdbc/myCustomDataSource Entry
    3/2/11 9:27:22:093 CST 0000000a GenericConnec < <init> Exit
    3/2/11 9:27:22:093 CST 0000000a GenericDataSo < getConnection : GenericConnection@3d123d12PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, java:comp/env/jdbc/myCustomDataSource Exit
    3/2/11 9:27:22:109 CST 0000000a GenericConnec 3 getMetaData : GenericConnection@3d123d12PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, java:comp/env/jdbc/myCustomDataSource, GenericDatabaseMetaData@32033203java:comp/env/jdbc/myCustomDataSource
    3/2/11 9:27:22:140 CST 0000000a OpenJPA 3 openjpa.jdbc.JDBC: Trace: Your database configuration was not recognized as a supported OpenJPA database. The generic dictionary will be used, which may result in limited functionality. This behavior can be overridden by specifying the appropriate dictionary class in the "openjpa.jdbc.DBDictionary" property of the OpenJPA configuration.

    The important message is the last one logged above: "Your database configuration was not recognized as a supported OpenJPA database."

    What can you tell me about your "java:comp/env/jdbc/myCustomDataSource"? We're not able to detect what type of database we're attempting to connect to. Without this ability, we have to default back to a Generic datasource. And, this configuration seems to have problems with some JDBC features.

    We'll check if any changes went into 1.0.0.3 that might have affected this path. Is your datasoruce configuration the same between 1.0.0.1 and 1.0.0.3 environments?

    Thanks for helping to resolve this issue.

    Kevin
  • JodySchraden
    JodySchraden
    4 Posts

    Re: Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

    ‏2011-03-03T15:41:42Z  
    • sutter
    • ‏2011-03-03T14:22:33Z
    Hi Jody,
    Thanks for the trace.log file. After some further review, we were able to determine that the transformer (enhancer) was not properly linked into the classloader. Here are the relevant entries in the log:

    3/2/11 9:27:22:218 CST 0000000a OpenJPA 3 openjpa.Runtime: Trace: An error occurred while registering a ClassTransformer with JPAPUnitInfo(PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel)@2b622b62. The error is logged along with this warning. Load-time class transformation will not be available.
    Exception : org.apache.commons.lang.exception.NestableRuntimeException
    org.apache.commons.lang.exception.NestableRuntimeException: An error occurred attempting to invoke JDBC 3 method. Your driver or database may not support JDBC 3 features.

    Going further back up the log, I found the following entries:

    3/2/11 9:27:21:890 CST 0000000a OpenJPA 3 openjpa.MetaData: Trace: Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory@39203920".
    3/2/11 9:27:21:906 CST 0000000a OpenJPA 3 openjpa.jdbc.JDBC: Trace: OpenJPA will now connect to the database to attempt to determine what type of database dictionary to use. You may prevent this connection in the future by setting your openjpa.jdbc.DBDictionary configuration property to the appropriate value for your database (see the documentation for available values).
    3/2/11 9:27:21:906 CST 0000000a OpenJPA 3 openjpa.jdbc.JDBC: Trace: createConnectionFactory: DataSource:GenericDataSource@fd40fd4PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, java:comp/env/jdbc/myCustomDataSource
    3/2/11 9:27:22:093 CST 0000000a GenericDataSo > getConnection : PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel Entry
    3/2/11 9:27:22:093 CST 0000000a GenericConnec > <init> : PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, dataSourceName = java:comp/env/jdbc/myCustomDataSource Entry
    3/2/11 9:27:22:093 CST 0000000a GenericConnec < <init> Exit
    3/2/11 9:27:22:093 CST 0000000a GenericDataSo < getConnection : GenericConnection@3d123d12PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, java:comp/env/jdbc/myCustomDataSource Exit
    3/2/11 9:27:22:109 CST 0000000a GenericConnec 3 getMetaData : GenericConnection@3d123d12PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel, java:comp/env/jdbc/myCustomDataSource, GenericDatabaseMetaData@32033203java:comp/env/jdbc/myCustomDataSource
    3/2/11 9:27:22:140 CST 0000000a OpenJPA 3 openjpa.jdbc.JDBC: Trace: Your database configuration was not recognized as a supported OpenJPA database. The generic dictionary will be used, which may result in limited functionality. This behavior can be overridden by specifying the appropriate dictionary class in the "openjpa.jdbc.DBDictionary" property of the OpenJPA configuration.

    The important message is the last one logged above: "Your database configuration was not recognized as a supported OpenJPA database."

    What can you tell me about your "java:comp/env/jdbc/myCustomDataSource"? We're not able to detect what type of database we're attempting to connect to. Without this ability, we have to default back to a Generic datasource. And, this configuration seems to have problems with some JDBC features.

    We'll check if any changes went into 1.0.0.3 that might have affected this path. Is your datasoruce configuration the same between 1.0.0.1 and 1.0.0.3 environments?

    Thanks for helping to resolve this issue.

    Kevin
    Hi Kevin,

    Thanks for the update. I am using a local reference to the datasource - "java:comp/env/jdbc/myCustomDataSource". The customer's practice is to declare the container level datasource with no authentication alias'. Then individual applications create local reference to the datasource with local authentication alias, so they can have different user accounts for different apps.

    My local database is DB2 Express, as is my co-worker's. When deployed, it's using DB2 for z/OS. I believe my data source setup is identical to that on his machine as well as Z. I've attached screenshots from the WAS administration console and below are some excerpts from the ejb xml config files. Let me know if you need any more info or have more questions.

    ejb-jar.xml

    <session>
    <description>Member Services Session Facade</description>
    <ejb-name>MembershipBean</ejb-name>
    <business-local>org.opers.bean.MembershipBeanLocal</business-local>
    <ejb-class>org.opers.bean.MembershipBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <description />
    <res-ref-name>jdbc/myCustomDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    </session>
    ibm-ejb-jar-bnd.xml

    <session name="MembershipBean">
    <resource-ref name="jdbc/myCustomDataSource"
    binding-name="jdbc/DB25_XA4_DS">
    <authentication-alias name="DevDataSource" />
    </resource-ref>
    </session>
  • sutter
    sutter
    94 Posts

    Re: Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

    ‏2011-03-04T21:40:07Z  
    Hi Kevin,

    Thanks for the update. I am using a local reference to the datasource - "java:comp/env/jdbc/myCustomDataSource". The customer's practice is to declare the container level datasource with no authentication alias'. Then individual applications create local reference to the datasource with local authentication alias, so they can have different user accounts for different apps.

    My local database is DB2 Express, as is my co-worker's. When deployed, it's using DB2 for z/OS. I believe my data source setup is identical to that on his machine as well as Z. I've attached screenshots from the WAS administration console and below are some excerpts from the ejb xml config files. Let me know if you need any more info or have more questions.

    ejb-jar.xml

    <session>
    <description>Member Services Session Facade</description>
    <ejb-name>MembershipBean</ejb-name>
    <business-local>org.opers.bean.MembershipBeanLocal</business-local>
    <ejb-class>org.opers.bean.MembershipBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <description />
    <res-ref-name>jdbc/myCustomDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    </session>
    ibm-ejb-jar-bnd.xml

    <session name="MembershipBean">
    <resource-ref name="jdbc/myCustomDataSource"
    binding-name="jdbc/DB25_XA4_DS">
    <authentication-alias name="DevDataSource" />
    </resource-ref>
    </session>
    I worked with Jody offline and we figured out the issue... Trace! We discovered that having OpenJPA Tracing turned on caused an "invalid" access on the Connection object which resulted in the JDBC3 error:

    [3/2/11 9:27:22:218 CST] 0000000a OpenJPA 3 openjpa.Runtime: Trace: An error occurred while registering a ClassTransformer with JPAPUnitInfo(PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel)@2b622b62. The error is logged along with this warning. Load-time class transformation will not be available.
    Exception : org.apache.commons.lang.exception.NestableRuntimeException
    org.apache.commons.lang.exception.NestableRuntimeException: An error occurred attempting to invoke JDBC 3 method. Your driver or database may not support JDBC 3 features.

    Jody had "openjpa=all" Trace specification turned on for some previous issue he was driving and when that one was resolved, this new problem popped up. So, when I asked for OpenJPA trace, we didn't realize that this was the culprit...

    We will open an internal APAR to correct this Tracing issue.

    As a workaround in case somebody else is experiencing this problem and needs Trace turned on, you can specify which DBDictionary to use for your persistence unit. This prevents the OpenJPA runtime from attempting to create a Connection to the database and, in turn, avoids this Tracing path. The property to use for this DBDictionary specification is along these lines (substitute your required database type):

    <property name="openjpa.jdbc.DBDictionary" value="db2"/>

    Hope this helps,
    Kevin

    Message was edited by: sutter
    Updated on 2011-03-04T21:40:07Z at 2011-03-04T21:40:07Z by sutter
  • JodySchraden
    JodySchraden
    4 Posts

    Re: Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

    ‏2011-03-04T21:57:28Z  
    • sutter
    • ‏2011-03-04T21:33:06Z
    I worked with Jody offline and we figured out the issue... Trace! We discovered that having OpenJPA Tracing turned on caused an "invalid" access on the Connection object which resulted in the JDBC3 error:

    [3/2/11 9:27:22:218 CST] 0000000a OpenJPA 3 openjpa.Runtime: Trace: An error occurred while registering a ClassTransformer with JPAPUnitInfo(PuId=OPERSServicesEAR#OPERSServicesEJBs.jar#opersModel)@2b622b62. The error is logged along with this warning. Load-time class transformation will not be available.
    Exception : org.apache.commons.lang.exception.NestableRuntimeException
    org.apache.commons.lang.exception.NestableRuntimeException: An error occurred attempting to invoke JDBC 3 method. Your driver or database may not support JDBC 3 features.

    Jody had "openjpa=all" Trace specification turned on for some previous issue he was driving and when that one was resolved, this new problem popped up. So, when I asked for OpenJPA trace, we didn't realize that this was the culprit...

    We will open an internal APAR to correct this Tracing issue.

    As a workaround in case somebody else is experiencing this problem and needs Trace turned on, you can specify which DBDictionary to use for your persistence unit. This prevents the OpenJPA runtime from attempting to create a Connection to the database and, in turn, avoids this Tracing path. The property to use for this DBDictionary specification is along these lines (substitute your required database type):

    <property name="openjpa.jdbc.DBDictionary" value="db2"/>

    Hope this helps,
    Kevin

    Message was edited by: sutter
    Kevin,

    Thanks so much to you and your team for getting to the bottom of this. We appreciate your quick responses in helping us to resolve this. Our customer is happy as well :-)

    Thank you,

    Jody
  • Heath_Thomann
    Heath_Thomann
    1 Post

    Re: Base 7.0.0.13 JPA 2.0 Feature 1.0.0.3 - requires jpa enhanced classes?

    ‏2012-10-01T21:02:40Z  
    Kevin,

    Thanks so much to you and your team for getting to the bottom of this. We appreciate your quick responses in helping us to resolve this. Our customer is happy as well :-)

    Thank you,

    Jody
    For completeness, this issue was addressed via the following JIRA:

    https://issues.apache.org/jira/browse/OPENJPA-2236

    Thanks,

    Heath