title: Getting "java.lang.UnsupportedOperationException:"
body: <p>I created the small JPA project to persist a Student record. I use Oracle database. I use the OpenJPA as the JPa provider.</p>
  
  <p>I have created the Table student and relevant sequences correctly.</p>
  
  <p><strong>Student Entity class</strong></p>
  
  <pre><code>@Entity
  @Table(name = "Student")
  public class Student implements Serializable {
  
      private int id;
      private String name;
      private static final long serialVersionUID = 1L;
  
      public Student() {
          super();
      }
  
      @Id
      @Column(name = "ID")
      @SequenceGenerator(name = "TRAIN_SEQ", sequenceName = "STUDENT_SEQ")
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TRAIN_SEQ")
      public int getId() {
          return this.id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      @Column(name = "NAME")
      public String getName() {
          return this.name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  </code></pre>
  
  <p><strong>persistence.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0"
      xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
  
      &lt;persistence-unit name="JPAOracleDemo"&gt;
  
          &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
  
          &lt;class&gt;com.jpa.demo.model.Student&lt;/class&gt;
  
          &lt;properties&gt;
               &lt;property name="openjpa.ConnectionURL" value="jdbc:oracle:thin:@TEST:50111:TESTPEGAD1" /&gt;
              &lt;property name="openjpa.ConnectionDriverName" value="oracle.jdbc.driver.OracleDriver" /&gt;
              &lt;property name="openjpa.ConnectionUserName" value="admin" /&gt;
              &lt;property name="openjpa.ConnectionPassword" value="admin" /&gt;
              &lt;property name="openjpa.RuntimeUnenhancedClasses" value="supported" /&gt;
              &lt;property name="openjpa.jdbc.Schema" value="MYSCHEMA" /&gt;
          &lt;/properties&gt;
  
      &lt;/persistence-unit&gt;
  
  &lt;/persistence&gt;
  </code></pre>
  
  <p><strong>Client Class</strong></p>
  
  <pre><code>OpenJPAEntityManager em = JPAUtil.getEntityManager();
          OpenJPAEntityTransaction tx = em.getTransaction();
          tx.begin();
  
          // Create the instance of Employee Entity class
          Student student = new Student();
          student.setName("A.Ramesh");
  
          // JPA API to store the Student instance on the database.
          em.persist(student);
          tx.commit();
          em.close();
  
          System.out.println("Done...");
  </code></pre>
  
  <p><strong>Util class</strong></p>
  
  <pre><code>private static OpenJPAEntityManagerFactory emf = OpenJPAPersistence
              .createEntityManagerFactory("JPAOracleDemo", "META-INF/persistence.xml");
  
      private static OpenJPAEntityManager entManager;
  
      /**
       * No need to create any instance for this Util.
       */
      private JPAUtil() {
      }
  
      /**
       * Get {@link EntityManager}.
       * 
       * @return the {@link EntityManager}
       */
      public static OpenJPAEntityManager getEntityManager() {
  
          if (entManager == null || !entManager.isOpen()) {
              entManager = emf.createEntityManager();
          }
  
          return entManager;
      }
  </code></pre>
  
  <p><strong>The data persist in the student table successfully, but I have the bellow error</strong></p>
  
  <pre><code>Exception in thread "Attachment 60230" 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 "main" 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.jpa.demo.util.JPAUtil.getEntityManager(JPAUtil.java:32)
      at com.jpa.demo.client.JPAClient.main(JPAClient.java:13)
  1045  JPAOracleDemo  INFO   [main] openjpa.Enhance - Creating subclass for "[class com.jpa.demo.model.Student]". This means that your application will be less efficient and will consume more memory than it would if you ran the OpenJPA enhancer. Additionally, lazy loading will not be available for one-to-one and many-to-one persistent attributes in types using field access; they will be loaded eagerly instead.
  Done...
  </code></pre>
  
  <p><strong>Java version</strong></p>
  
  <p>JDK 1.6</p>
  
  <p>Anybody please let me know what is the issue here?</p>
  
  <p><strong>Updated:</strong></p>
  
  <p>I used the IBM Rational Software Architect for Websphere Software for this development. this problem is with this IDE. When I create the JPA project by default it adds the IBM jre. I just removed the IBM jre and tried with the SUN jre then it was success. Please let me know why this function does not support with IBM jre?</p>