3 Replies Latest reply on Jan 9, 2014 4:44 AM by kpagan

    OpenJPA in JBoss EAP 6.1

    geoffreydv

      I am trying to use JPA in a project using OpenJPA and JBoss EAP 6.1

       

      Following the tutorial at http://middlewaremagic.com/jboss/?p=1991 I have:

       

      • added the module to my modules folder.
      • Added these items to my persistence.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <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">
      
      
          <persistence-unit name="MyPU" transaction-type="JTA">
      
      
              <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
      
      
              <jta-data-source>java:/MyDS</jta-data-source>
      
              <class>... my classes .. </class>
      
      
              <properties>
                  <property name="jboss.as.jpa.providerModule" value="org.apache.openjpa"/>
                  <property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.openjpa"/>
                  <property name="jboss.as.jpa.adapterClass" value="org.jboss.as.jpa.openjpa.OpenJPAPersistenceProviderAdaptor" />
      
                  <property name="openjpa.DynamicEnhancementAgent" value="false"/>
                  <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
              </properties>
          </persistence-unit>
      </persistence>
      

       

      • Created a jboss-deployment-structure.xml in my WEB-INF/ folder and put in:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure>
          <deployment>
              <dependencies>
                  <module name="org.apache.openjpa" />
              </dependencies>
          </deployment>
      </jboss-deployment-structure>
      

       

      When I deploy my application the following error is displayed:

       

      14:22:13,179 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.module.service."deployment.myapp-web-services-0.0.1-SNAPSHOT.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.myapp-web-services-0.0.1-SNAPSHOT.war".main: JBAS018759: Failed to load module: deployment.myapp-web-services-0.0.1-SNAPSHOT.war:main
                at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:92) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
      Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.as.jpa.openjpa:main
                at org.jboss.modules.Module.addPaths(Module.java:949) [jboss-modules.jar:1.2.0.Final-redhat-1]
                at org.jboss.modules.Module.link(Module.java:1304) [jboss-modules.jar:1.2.0.Final-redhat-1]
                at org.jboss.modules.Module.relinkIfNecessary(Module.java:1332) [jboss-modules.jar:1.2.0.Final-redhat-1]
                at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:226) [jboss-modules.jar:1.2.0.Final-redhat-1]
                at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:71) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
                ... 5 more
      
      
      14:22:13,386 ERROR [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "myapp-web-services-0.0.1-SNAPSHOT.war" was rolled back with the following failure message: 
      {"JBAS014671: Failed services" => {"jboss.module.service.\"deployment.myapp-web-services-0.0.1-SNAPSHOT.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.myapp-web-services-0.0.1-SNAPSHOT.war\".main: JBAS018759: Failed to load module: deployment.myapp-web-services-0.0.1-SNAPSHOT.war:main
          Caused by: org.jboss.modules.ModuleNotFoundException: org.jboss.as.jpa.openjpa:main"}}
      

       

       

      Any ideas on what I can do to resolve this error?

        • 1. Re: OpenJPA in JBoss EAP 6.1
          kpagan

          I see in your persistence.xml you have

           

          <property name="jboss.as.jpa.providerModule" value="org.apache.openjpa"/> 

          <property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.openjpa"/>

           

          So, actually there is a reference to the org.jboss.as.jpa.openjpa module in your application. Do you really need to define the jboss.as.jpa.adapterModule?

          In the article you mention this is not defined. Only the x.x.x.providerModule is defined.

           

          But if you really need it try to set it to "org.apache.openjpa".

          P.S. I wouldn't recommend to use the openjpa-all-2.x.x.jar for you module. This include the jta.jar inside and it was causing me great trouble to setup the JTA transaction manager.

          Use a plain openjpa-2.x.x.jar and set dependecies

           

              <module name="org.apache.commons.lang"/>
             <module name="org.apache.commons.collections"/>
             <module name="javax.persistence.api"/>
             <module name="javax.transaction.api" export="true" />
             <module name="javax.validation.api"/>
             <module name="org.apache.log4j"/>
          • 2. Re: OpenJPA in JBoss EAP 6.1
            kpagan

            Actually, I tried to upgrade from JBoss EAP 6.0.1 to JBoss EAP 6.1.0 and I run to the same problem. My proposed solution didn't work.

            I found a similar question and a post that was suggesting to install the adapter module manually. The link is https://community.jboss.org/message/834599#834599

            I tried that and the application was deployed successfully but then when trying to test the application many exceptions where thrown like

             

            Caused by: <openjpa-2.2.1-r422266:1396819 fatal user error> org.apache.openjpa.persistence.ArgumentException: The type "class com.intrasoft.sw.jpa.admin.AdmBrokerRightsTPK" has not been enhanced.
            

             

            The full stacktrace is very long but this is the root cause of the problem.

             

            I read the OpenJPA manual in order to enhance my entities and tried again.

            This time I got another error. The full stacktrace is:

             

            24/10/2013 13:45:36,290 [http-/0.0.0.0:8080-1]  ERROR com.sw.admin.AbstractSearchBean:121 - executeQuery failed
            java.lang.Exception: administration.error.retrieveFailed
                at com.intrasoft.sw.admin.dao.impl.UserAccountDaoImpl.find(UserAccountDaoImpl.java:171)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:601)
                at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
                at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
                at $Proxy69.find(Unknown Source)
                at com.intrasoft.sw.admin.service.impl.UserAccountDataServiceBean.find(UserAccountDataServiceBean.java:79)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:601)
                at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
                at $Proxy71.find(Unknown Source)
                at com.sw.admin.AbstractSearchBean.executeQuery(AbstractSearchBean.java:210)
                at com.sw.admin.AbstractSearchBean.search(AbstractSearchBean.java:165)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:601)
                at org.apache.el.parser.AstValue.invoke(AstValue.java:258)
                at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
                at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
                at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
                at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
                at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:775)
                at javax.faces.component.UICommand.broadcast(UICommand.java:300)
                at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786)
                at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1251)
                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
                at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
                at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
                at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
                at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
                at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
                at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
                at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
                at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
                at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
                at java.lang.Thread.run(Thread.java:722)
            Caused by: <openjpa-2.2.1-r422266:1396819 fatal store error> org.apache.openjpa.persistence.OptimisticLockException: Unable to obtain an object lock on "null".
            FailedObject: SELECT DISTINCT e FROM AdmUserAccountT e LEFT OUTER JOIN FETCH e.admAgencyBranchTs WHERE (e.admLookupCodeT.codeValue=:role0) [java.lang.String]
                at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4940)
                at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4918)
                at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
                at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:118)
                at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:70)
                at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
                at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:40)
                at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
                at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
                at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
                at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
                at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
                at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:286)
                at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
                at com.intrasoft.sw.admin.dao.impl.UserAccountDaoImpl.find(UserAccountDaoImpl.java:166)
                ... 81 more
            Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-00942: table or view does not exist
            {prepstmnt 705077298 SELECT DISTINCT t0.id, t2.id, t3.id, t4.id, t5.id, t5.ADMLOOKUPCODET_ID, t5.apartmentNumber, t5.city, t5.email, t5.mobile, t5.phone, t5.postcode, t5.streetNumber, t6.id, t7.id, t7.ADMCODETYPET_ID, t7.codeValue, t7.validFrom, t7.validTo, t6.bankAccountNumber, t6.bankId, t8.id, t8.bankAccountNumber, t8.bankId, t9.id, t9.description, t9.name, t10.id, t11.id, t11.ADMLOOKUPCODET_ID, t11.apartmentNumber, t11.city, t11.email, t11.mobile, t11.phone, t11.postcode, t11.streetNumber, t3.codeValue, t3.validFrom, t3.validTo, t2.apartmentNumber, t2.city, t2.email, t2.mobile, t2.phone, t2.postcode, t2.streetNumber, t1.id, t1.ADMCODETYPET_ID, t1.codeValue, t1.validFrom, t1.validTo, t0.companyName, t0.customsNumber, t0.ein, t0.firstName, t0.isValid, t0.lastName, t0.logonName, t0.passportDate, t0.passportIssuedBy, t0.passportNumber, t0.passportResidencePlace, t0.passportSeries, t0.password, t0.tin, t0.uaisLogin, t0.validFrom, t0.validTo, t12.ADMUSERACCOUNTTS_ID, t13.id, t13.ADMADDRESST_ID, t13.ADMAGENCYT_ID, t14.id, t14.ADMCODETYPET_ID, t14.codeValue, t14.validFrom, t14.validTo FROM AdmUserAccountT t0, AdmLookupCodeT t1, AdmAddressT t2, AdmLookupCodeT t3, AdmAgencyBranchT t4, AdmAddressT t5, AdmAgencyT t6, AdmLookupCodeT t7, AdmAgencyT t8, AdmCodeTypeT t9, AdmCustomsOfficeT t10, AdmAddressT t11, ADMUSERACCOUNTT_ADMAGENCYBRANC t12, AdmAgencyBranchT t13, AdmLookupCodeT t14 WHERE (t1.codeValue = ?) AND t0.ADMLOOKUPCODET_ID = t1.id AND t0.ADMADDRESST_ID = t2.id(+) AND t0.id = t12.ADMUSERACCOUNTTS_ID(+) AND t2.ADMLOOKUPCODET_ID = t3.id(+) AND t12.ADMAGENCYBRANCHTS_ID = t13.id(+) AND t3.id = t4.ADMLOOKUPCODET_ID(+) AND t3.id = t8.ADMLOOKUPCODET_ID(+) AND t3.ADMCODETYPET_ID = t9.id(+) AND t3.id = t10.ADMLOOKUPCODET_ID(+) AND t13.ADMLOOKUPCODET_ID = t14.id(+) AND t4.ADMADDRESST_ID = t5.id(+) AND t4.ADMAGENCYT_ID = t6.id(+) AND t10.ADMADDRESST_ID = t11.id(+) AND t6.ADMLOOKUPCODET_ID = t7.id(+) ORDER BY t12.ADMUSERACCOUNTTS_ID ASC} [code=942, state=42000]
                at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
                at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:203)
                at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:59)
                at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1118)
                at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:265)
                at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1774)
                at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:255)
                at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:499)
                at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:424)
                at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
                at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
                at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
                at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
                at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
                at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:34)
                ... 89 more
            

             

             

            This build was run successfully on JBoss EAP 6.0.1. Something changed in JBoss EAP 6.1.0. Is there any reference or migration guide that I can get some information?

             

            So far I haven't find anything in official docs.

            • 3. Re: Re: OpenJPA in JBoss EAP 6.1
              kpagan

              I finally managed it to work!!!

               

              After following this guide Re: Openjpa on JBoss EAP 6.1.0 with AS 7.2.0 I set in the persistence.xml the property:

              <property name="openjpa.MetaDataFactory" value="jpa"/>

               

              See the documentation at http://openjpa.apache.org/builds/2.2.2/apache-openjpa/docs/manual.html#ref_guide_meta_factory

              Setting the value jpa as it is without parameters it worked for me.

              Otherwise you may need to specify the jar where to scan for entity classes like

              <property name="openjpa.MetaDataFactory" value="jpa(ClasspathScan=my-project-jpa-entities.jar)"/>

               

              My final persistence.xml is:

               

              <?xml version="1.0" encoding="UTF-8"?>
              <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">
                  <persistence-unit name="sw_jpa_admin"
                      transaction-type="JTA">
              
                      <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
                      <jta-data-source>java:/sw/ds/adminDs-JTA</jta-data-source>
                      <non-jta-data-source>java:/sw/ds/adminDs</non-jta-data-source>
              
                      <class>jpa.admin.AdmAddressT</class>
                      <class>jpa.admin.AdmUserAccountT</class>
                      <class>jpa.admin.AdmUserPreferencesT</class>
                      <!-- other entity classes here. -->
              
                      <properties>
                          <!-- The jboss module that we have created for OpenJPA goes here -->
                          <property name="jboss.as.jpa.providerModule" value="sw.org.openjpa" />
                          <property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO" />
              
                          <!-- IMPORTANT PROPERTIES -->
                          <property name="openjpa.DynamicEnhancementAgent" value="false" />
                          <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
                          <!-- Important property in order OpenJPA to work on JBoss EAP 6.1.x an later -->
                          <!-- see http://openjpa.apache.org/builds/2.2.2/apache-openjpa/docs/manual.html#ref_guide_meta_factory -->
                          <property name="openjpa.MetaDataFactory" value="jpa"/>
                         
                      </properties>
                  </persistence-unit>
              </persistence>