0

I have created the JPA project (I use OpenJPA 2.0 as the JPA provider).

IDE: IBM Rational Softwara architect for Websphere Software(RAD)
JPA Provider: OpenJPA
Version: 2.0
Database: Oracle

I created the datasource in Websphere(Version 7.0) and tried to accss the datasource through the JNDI. Please find the persistence.xml bellow.

<persistence version="2.0">

     <persistence-unit name="DataSourceDemo">

          <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>       
          <jta-data-source>oracleDS</jta-data-source>

          <class>com.nyl.ltc.auditlog.model.NylBatchPrint</class>

          <properties>
               <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
               <property name="openjpa.ConnectionUserName"   
                          value="admin" />
               <property name="openjpa.ConnectionPassword" value="admin" />
               <property name="openjpa.jdbc.Schema" value="SMSVC" />
          </properties>

     </persistence-unit>

</persistence>

All the Database transaction was success but I am getting the bellow exception.

Exception in thread "Attachment 49459" java.lang.UnsupportedOperationException: cannot get the capability, performing dispose of the retransforming environment
    at com.ibm.tools.attach.javaSE.Attachment.loadAgentLibraryImpl(Native Method)
    at com.ibm.tools.attach.javaSE.Attachment.loadAgentLibrary(Attachment.java:253)
    at com.ibm.tools.attach.javaSE.Attachment.parseLoadAgent(Attachment.java:235)
    at com.ibm.tools.attach.javaSE.Attachment.doCommand(Attachment.java:154)
    at com.ibm.tools.attach.javaSE.Attachment.run(Attachment.java:116)
Exception in thread "P=221586:O=0:CT" java.lang.UnsupportedOperationException: cannot get the capability, performing dispose of the retransforming environment
    at sun.instrument.InstrumentationImpl.isRetransformClassesSupported0(Native Method)
    at sun.instrument.InstrumentationImpl.isRetransformClassesSupported(InstrumentationImpl.java:124)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at org.apache.openjpa.enhance.ClassRedefiner.canRedefineClasses(ClassRedefiner.java:123)
    at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:122)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:304)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:202)
    at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
    at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:213)
    at com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:45)
    at com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:30)
    at com.nyl.ltc.auditlog.util.JPAUtil.getEntityManager(JPAUtil.java:45)
    at com.nyl.ltc.auditlog.dao.sericeImpl.AuditLogDAOServiceImpl.persist(AuditLogDAOServiceImpl.java:27)
    at com.nyl.ltc.auditlog.serviceImpl.AuditLogServiceImpl.persistAuditLog(AuditLogServiceImpl.java:20)
    at com.nyl.ltc.auditlog.handlerImpl.AuditLogHandlerImpl.persistAuditlog(AuditLogHandlerImpl.java:22)
    at com.main.Main.main(Main.java:19)
2203  DataSourceDemo  INFO   [P=221586:O=0:CT] openjpa.Enhance - Creating subclass for "[class com.nyl.

Please let me know why I got tis exception and how can I resolve it?

Java-Seekar
  • 1,720
  • 5
  • 30
  • 52

1 Answers1

0

The Apache OpenJPA (JPA 1.0) engine is shipped with Websphere 7 (Java EE 5). The classloader by default load the internal OpenJPA implementation. May you need to change the classloader policy.

See more in WebSphere Application Server V7: Understanding Class Loaders.

Paul Vargas
  • 41,222
  • 15
  • 102
  • 148