3 Replies Latest reply on Jul 13, 2011 6:48 AM by 873933

    how do I use openjpa2.0 instead of openjpa1.0

      I use openjpa1.0 provider in weblogic10.3.4 before.
      now I want use openjpa2.0 instead of openjpa1.0.

      I according to this article (http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#Problem_2:_JPA_2.0_persistence.xml_XSD_Enablement) to enable jpa2.0 .
      but failed. it throws exception:

      what do i do: seems an odd quirk of the EJB spec. The exception is:java.lang.AbstractMethodError: org.apache.openjpa.persistence.EntityManagerImpl.getMetamodel()Ljavax/persistence/metamodel/Metamodel;
           at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:111)

      I try to delete openjpa1.0 jar file from modules directory.
      the servier throws java.lang.NoClassDefFoundError org/apache/openjpa/conf/OpenJPAVersion

      it seems the weblogic can't load the openjpa2.0 jar.

      can somebody help me?
        • 1. Re: how do I use openjpa2.0 instead of openjpa1.0
          My page quoted above is mostly for older versions of WebLogic and below that could not handle container managed JPA 2.0 injection. For WebLogic and JPA 2.0 is fully functional but will need to be enabled (the best way is to install OEPE, create a server profile to your WebLogic 10.3.4/10.3.4 instance - and select the "Java Persistence 2.0 - Install" link on the dialog in the Eclipse IDE). However, Kodo (based on OpenJPA) is not actively developed. I would switch to EclipseLink which is the Java EE 6 reference implementation. You can do this by changing the default persistence provider in the console from Kodo to TopLink (wraps EclipseLink) or specifying the provider in your persistence.xml.

          The link you quote is the section for WebLogic
          What you need is the new section I wrote in Jan 2011 for the

          See my tutorials for details - where you can also see the source.


          thank you
          Michael O'Brien
          • 2. Re: how do I use openjpa2.0 instead of openjpa1.0
            There are other way to enabled jap2.0(kodo/openjpa) ,but OEPE excepted ?
            the page you quote I had readi it , but it does not work.

            I wish I could change it to Eclipselink, but my cto don't agree that.

            I'm sorry my bokenEnglish, thanks for your answer.
            • 3. Re: how do I use openjpa2.0 instead of openjpa1.0
              by the way,
              it seems the behavior that the method "merge()" of entityManage in openjpa is different from in eclipselink.
              merge of openjpa would ignored null value, but not eclipselink.