13 Replies Latest reply: Mar 8, 2011 10:50 AM by Michael O'Brien RSS

    Unable to use JPA in a web application under JBoss

    5pike Newbie

      Hi all,

       

      I'm desperately trying to get a JPA example from the book 'Core JavaServer Faces - 3rdEdition' to work under JBoss.  Like all three of the JSF 2.0 books Ihave bought recently – all the examples were designed to be deployed under Glassfish or Tomcat.  Because I used JBoss once on a work placement (and I'm stuborn) I really want to use it again now. I've amended the example application to use Maven.  Maven is new to me too so the problem could lie here rather than with JBoss.  Eitherway, I hope someone can help!

       

      The example application uses EclispeLink, which I also tried to use under JBoss.  However, I understand JBoss by default uses Hibernate.  I don't have a preference but if anyone can explain how to get it working with Hibernate – then this is probably the better solution.

       

      I will try to attach the slightly amended version of the example application here but whatI think are the main changes are listed below:

       

      pom.xml:

      <dependencies>
        <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>javax.persistence</artifactId>
        <version>2.0.0</version>
        <scope>provided</scope>
        </dependency>
        <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <version>2.1.1</version>
        </dependency>
      </dependencies>
      
      <repositories>
        <repository>
        <id>EclipseLink Repo</id>
        <url>http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo</url>
        <snapshots>
        <enabled>true</enabled>
        </snapshots>  
        </repository>
      </repositories>
      

       

      persistence.xml:

      <persistence-unitname="default" transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>java:/musson</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>  
        <properties>
        <propertyname="eclipselink.ddl-generation" value="update-tables"/>
        </properties>
      </persistence-unit>
      

       

      web.xml:

      <resource-ref>
        <res-ref-name>musson</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>
      

       

      jboss-web.xml:

      <jboss-web>
       <context-root>/jbossjpa</context-root>
        <resource-ref>
        <res-ref-name>musson</res-ref-name>
        <jndi-name>java:musson</jndi-name>
        </resource-ref>
      </jboss-web>
      

       

       

      Other than the above changes, I've make no changes to the original example.  The datasource is correctly setup and works under Glassfish.  The error seems to change each time a edit the configuration files but right now it is:

       

      ERROR:

      16:22:03,401 ERROR[org.jboss.kernel.plugins.dependency.AbstractKernelController] Errorinstalling to Start:name=jboss-switchboard:appName=jbossjpa,module=jbossjpa state=Create:javax.naming.CommunicationException [Root exception isjava.io.NotSerializableException:org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl]
      atorg.jnp.interfaces.NamingContext.rebind(NamingContext.java:604)[:5.0.5.Final]
      atorg.jnp.interfaces.NamingContext.rebind(NamingContext.java:542)[:5.0.5.Final]
      atorg.jboss.util.naming.Util.rebind(Util.java:131)[jboss-common-core.jar:2.2.17.GA]
      atorg.jboss.util.naming.Util.rebind(Util.java:117)[jboss-common-core.jar:2.2.17.GA]
      .
      .
      .     Lots more....
      .
      .
      16:22:03,418 WARN [org.jboss.profileservice.deployment.hotdeploy.HDScanner] Scanfailed: org.jboss.deployers.client.spi.IncompleteDeploymentException:Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      DEPLOYMENTS MISSINGDEPENDENCIES:
        Deployment"jboss-injector:appName=jbossjpa,module=jbossjpa" ismissing the following dependencies:
        Dependency"<UNKNOWN jboss-injector:appName=jbossjpa,module=jbossjpa>"(should be in state "Installed", but is actually in state"** UNRESOLVED Demands'jboss-switchboard:appName=jbossjpa,module=jbossjpa' **")
        Deployment"jboss.web.deployment:war=/jbossjpa" is missing thefollowing dependencies:
        Dependency"jboss-injector:appName=jbossjpa,module=jbossjpa" (shouldbe in state "Create", but is actually in state"Configured")
      
      DEPLOYMENTS IN ERROR:
        Deployment"jboss-switchboard:appName=jbossjpa,module=jbossjpa" is inerror due to the following reason(s):java.io.NotSerializableException:org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl
        Deployment "<UNKNOWNjboss-injector:appName=jbossjpa,module=jbossjpa>" is in errordue to the following reason(s): ** UNRESOLVED Demands'jboss-switchboard:appName=jbossjpa,module=jbossjpa' **
      
      atorg.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370)[:2.2.0.GA]
      atorg.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316)[:2.2.0.GA]
      .
      .
      .     Some more errors....
      .
      .
      

       

      Any help greatly appreciated.

       

      Cheers,

      Andy

        • 1. Unable to use JPA in a web application under JBoss
          5pike Newbie

          No one able to help me on this one then?

          • 2. Unable to use JPA in a web application under JBoss
            Wolfgang Knauf Master

            Hi,

             

            I would guess that there is a JAR conflict: maybe your deployed contains class files / JARs which are already bundled with JBoss. Could you post the list of JAR files that are part of your application (check the deployed WAR file)?

             

            I found those tutorials about EclipseLink and JBoss:

            http://wiki.eclipse.org/EclipseLink/Examples/JPA/JBoss_Web_Tutorial

            and

            http://wiki.eclipse.org/EclipseLink/Examples/JPA/Migration/JBoss

             

            You might already know them, but if not they are hopefully helpful.

             

            Best regards

             

            Wolfgang

            • 3. Re: Unable to use JPA in a web application under JBoss
              5pike Newbie

              Hi Wolfgang,

               

              Thanks very much for your help here.  I am now receiving a slightly different error due to a couple of small changes.  Firstly I changed the data source names in web.xml and jboss-web.xml from java:musson to java:/musson (as shown below) - this is correct right?  The second change was just adding some additional propertiey elements to the persistence.xml file.  Speaking of the persistence.xml file, could you confirm when using Maven, this file should be placed under /projectname/src/main/resources/META-INF?

               

              To answer your question, I only have the 'eclipselink-2.1.1.jar' under jbossjpa.war/WEB-INF/lib.  The current configuration looks like this:

               

              web.xml:

              <?xml version="1.0" encoding="UTF-8"?>
              <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                 xmlns="http://java.sun.com/xml/ns/javaee"
                 xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                 version="2.5">
                 <servlet>
                    <servlet-name>Faces Servlet</servlet-name>
                    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                 </servlet>
                 <servlet-mapping>
                    <servlet-name>Faces Servlet</servlet-name>
                    <url-pattern>/faces/*</url-pattern>
                 </servlet-mapping>
                 <welcome-file-list>
                    <welcome-file>faces/index.xhtml</welcome-file>
                 </welcome-file-list>
                 <context-param>
                    <param-name>javax.faces.PROJECT_STAGE</param-name>
                    <param-value>Development</param-value>
                 </context-param>
                 <resource-ref>
                     <res-ref-name>musson</res-ref-name>
                     <res-type>javax.sql.DataSource</res-type>
                     <res-auth>Container</res-auth>
                     <res-sharing-scope>Shareable</res-sharing-scope>
                 </resource-ref>
              </web-app>
              

               

               

              jboss-web.xml

              <?xml version="1.0" encoding="UTF-8"?>
              <jboss-web>
                <context-root>/jbossjpa</context-root>
                <resource-ref>
                  <res-ref-name>musson</res-ref-name>
                  <jndi-name>java:/musson</jndi-name>
                </resource-ref>
              </jboss-web>
              

               

               

              persistence.xml

              <?xml version="1.0" encoding="UTF-8"?>
              <persistence version="1.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_1_0.xsd">
              
                  <persistence-unit name="default" transaction-type="JTA">
                      <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                      <jta-data-source>java:/musson</jta-data-source>
                      <exclude-unlisted-classes>false</exclude-unlisted-classes>    
                      <properties>
                          <property name="eclipselink.target-database" value="MySQL"/>
                          <property name="eclipselink.target-server" value="JBoss"/>
                          <property name="eclipselink.ddl-generation" value="update-tables"/>
                          <property name="eclipselink.weaving" value="false"/>
                          <property name="eclipselink.logging.level" value="FINEST"/>
                      </properties>
                  </persistence-unit>
              </persistence>
              

               

               

              The error stack messages I'm receiving now upon deployment is as follows:

              16:01:16,100 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
              16:01:16,243 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
              16:01:16,262 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=musson' to JNDI name 'java:musson'
              16:01:16,371 INFO  [xnio] XNIO Version 2.1.0.CR2
              16:01:16,377 INFO  [nio] XNIO NIO Implementation Version 2.1.0.CR2
              16:01:16,476 INFO  [remoting] JBoss Remoting version 3.1.0.Beta2
              16:01:16,536 INFO  [TomcatDeployment] deploy, ctxPath=/
              16:01:16,559 INFO  [service] Removing bootstrap log handlers
              16:01:16,614 INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
              16:01:16,615 INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8009
              16:01:16,616 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 11s:77ms
              16:01:32,249 INFO  [org.jboss.weld.Version] WELD-000900 1.1.0 (CR3)
              16:01:32,277 INFO  [org.jboss.jpa.deployment.PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=jbossjpa.war#default
              16:01:32,296 INFO  [STDOUT] [EL Warning]: 2011-02-25 16:01:32.29--Thread(Thread[HDScanner,5,jboss])--The temporary classLoader for PersistenceLoadProcessor [default] is not available.  Switching classLoader to [BaseClassLoader@47238cce{vfs:///java/apps/jbossas/jboss-6.0.0.Final/server/default/deploy/jbossjpa.war}].  Weaving has been disabled for this session. EclipseLink may be unable to get a spec mandated temporary class loader from the server, you may be able to use static weaving as an optional workaround. 
              16:01:32,300 INFO  [STDOUT] [EL Finest]: 2011-02-25 16:01:32.296--ServerSession(93670476)--Thread(Thread[HDScanner,5,jboss])--Begin predeploying Persistence Unit default; session vfs:/java/apps/jbossas/jboss-6.0.0.Final/server/default/deploy/jbossjpa.war/WEB-INF/classes/_default; state Initial; factoryCount 0
              16:01:32,300 INFO  [STDOUT] [EL Finest]: 2011-02-25 16:01:32.3--ServerSession(93670476)--Thread(Thread[HDScanner,5,jboss])--property=eclipselink.orm.throw.exceptions; default value=true
              16:01:32,300 INFO  [STDOUT] [EL Finest]: 2011-02-25 16:01:32.3--ServerSession(93670476)--Thread(Thread[HDScanner,5,jboss])--property=eclipselink.jpa.uppercase-column-names; default value=false
              16:01:32,302 INFO  [STDOUT] [EL Finer]: 2011-02-25 16:01:32.301--ServerSession(93670476)--Thread(Thread[HDScanner,5,jboss])--Searching for default mapping file in vfs:/java/apps/jbossas/jboss-6.0.0.Final/server/default/deploy/jbossjpa.war/WEB-INF/classes/
              16:01:32,304 INFO  [STDOUT] [EL Finer]: 2011-02-25 16:01:32.304--ServerSession(93670476)--Thread(Thread[HDScanner,5,jboss])--Searching for default mapping file in vfs:/java/apps/jbossas/jboss-6.0.0.Final/server/default/deploy/jbossjpa.war/WEB-INF/classes/
              16:01:32,305 INFO  [STDOUT] [EL Finest]: 2011-02-25 16:01:32.305--ServerSession(93670476)--Thread(Thread[HDScanner,5,jboss])--End predeploying Persistence Unit default; session vfs:/java/apps/jbossas/jboss-6.0.0.Final/server/default/deploy/jbossjpa.war/WEB-INF/classes/_default; state Predeployed; factoryCount 1
              16:01:32,671 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=jboss-switchboard:appName=jbossjpa,module=jbossjpa state=Create: javax.naming.CommunicationException [Root exception is java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl]
                  at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:604) [:5.0.5.Final]
                  at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:542) [:5.0.5.Final]
                  at org.jboss.util.naming.Util.rebind(Util.java:131) [jboss-common-core.jar:2.2.17.GA]
                  at org.jboss.util.naming.Util.rebind(Util.java:117) [jboss-common-core.jar:2.2.17.GA]
                  at org.jboss.switchboard.mc.SwitchBoardImpl.bindInRelevantContext(SwitchBoardImpl.java:265) [:1.0.0-alpha-15]
                  at org.jboss.switchboard.mc.SwitchBoardImpl.start(SwitchBoardImpl.java:90) [:1.0.0-alpha-15]
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
                  at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
                  at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]
                  at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]
              .
              .
              .
              .
              Caused by: java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl
                  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) [:1.6.0_23]
                  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [:1.6.0_23]
                  at java.rmi.MarshalledObject.<init>(MarshalledObject.java:101) [:1.6.0_23]
                  at org.jnp.interfaces.MarshalledValuePair.<init>(MarshalledValuePair.java:65) [:5.0.5.Final]
                  at org.jnp.interfaces.NamingContext.createMarshalledValuePair(NamingContext.java:1429) [:5.0.5.Final]
                  at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:569) [:5.0.5.Final]
                  ... 56 more
              
              16:01:32,690 WARN  [org.jboss.profileservice.deployment.hotdeploy.HDScanner] Scan failed: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
              
              DEPLOYMENTS MISSING DEPENDENCIES:
                Deployment "jboss-injector:appName=jbossjpa,module=jbossjpa" is missing the following dependencies:
                  Dependency "<UNKNOWN jboss-injector:appName=jbossjpa,module=jbossjpa>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=jbossjpa,module=jbossjpa' **")
                Deployment "jboss.web.deployment:war=/jbossjpa" is missing the following dependencies:
                  Dependency "jboss-injector:appName=jbossjpa,module=jbossjpa" (should be in state "Create", but is actually in state "Configured")
              
              DEPLOYMENTS IN ERROR:
                Deployment "jboss-switchboard:appName=jbossjpa,module=jbossjpa" is in error due to the following reason(s): java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl
                Deployment "<UNKNOWN jboss-injector:appName=jbossjpa,module=jbossjpa>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-switchboard:appName=jbossjpa,module=jbossjpa' **
              
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.0.GA]
                  at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.0.GA]
                  at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.0.0.Final]
              .
              .
              .
              .
              
              

               

               

              Thanks for those links - I had come across the first one but the second link was new to me - this is where I got the additional property elements from!  Thanks once again - hopefully speak again soon.

               

              Andy

              • 4. Unable to use JPA in a web application under JBoss
                Wolfgang Knauf Master

                Hi,

                 

                which JAR files from Eclipselink do you bundle with your app? In the first link, I saw "eclipselink.jar" and "javax.persistence_*.jar", but the page was not very clear whether both JARs have to be copied to JBoss.

                 

                I would guess that "javax.persistence.jar" is already part of JBoss and might result in conflicts. The JBoss bundled JPA classes can be found in "%JBOSS_HOME%\common\lib\hibernate-jpa-2.0-api.jar".

                 

                Best regards

                 

                Wolfgang

                • 5. Re: Unable to use JPA in a web application under JBoss
                  5pike Newbie

                  Hi Wolfgang,

                   

                  Sorry for the confusion.  I only bundle one jar with my application and that is the eclipselink.jar.  Below is a section from my pom.xml:

                   

                  <dependency>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>javax.persistence</artifactId>
                    <version>2.0.0</version>
                    <scope>provided</scope>
                  </dependency>
                  
                  <dependency>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>eclipselink</artifactId>
                    <version>2.1.1</version>
                  </dependency>
                  

                   

                  Thanks for your help.

                   

                  Best regards,

                  Andy

                  • 6. Unable to use JPA in a web application under JBoss
                    jaikiran pai Master
                    Caused by: java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl

                    The problem is because the org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl isn't serializable which results in the JNDI binding to fail. Can you please create a JIRA here https://jira.jboss.org/browse/JBAS. Let me see if we can fix this to relax the restriction.

                    • 7. Re: Unable to use JPA in a web application under JBoss
                      Benjamin Seyinbour Expert

                      jaikiran pai,

                       

                      Don't bother fixing it, I used to encounter this problem a few years ago. The NotSerializableException is deceptive, and beside EntityManagerFactoryImp comes from EclipseLink.jar.

                       

                      Pike,

                       

                      Clear the table, and follow Wolfgang's first link and the instructions therein. But against some of the instructions given there:

                      1. Don't copy javax.persistence_2.0.3.v2??? to $JBOSS_HOME/common/lib or $JBOSS_HOME/server/default/lib (if you are using the 'default' server);

                      2. Don't bundle Eclipselink.jar nor javax.persistence_2.0.3.v??? with any ear/war/jar.

                       

                      And to complete the boxes to tick: don't forget to copy the jdbc driver for your database into $JBOSS_HOME/common/lib or $JBOSS_HOME/server/default/lib (if you are using the 'default' server).

                      • 8. Re: Unable to use JPA in a web application under JBoss
                        5pike Newbie

                        Hi,

                         

                        Thanks to both of you for your help.  Sadly however, the last post did not fix my problem and I now receive a new error message found below.  If I bundle the eclipselink.jar with my app or copy it over to $JBOSS_HOME/server/default/lib - I still get the "Caused by: java.io.NotSerializableException: org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl" error.

                         

                         

                        19:00:50,896 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=musson' to JNDI name 'java:musson'
                        19:00:50,993 INFO  [xnio] XNIO Version 2.1.0.CR2
                        19:00:50,999 INFO  [nio] XNIO NIO Implementation Version 2.1.0.CR2
                        19:00:51,088 INFO  [remoting] JBoss Remoting version 3.1.0.Beta2
                        19:00:51,146 INFO  [TomcatDeployment] deploy, ctxPath=/
                        19:00:51,167 INFO  [service] Removing bootstrap log handlers
                        19:00:51,210 INFO  [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
                        19:00:51,212 INFO  [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8009
                        19:00:51,212 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 12s:140ms
                        19:12:23,254 INFO  [org.jboss.weld.Version] WELD-000900 1.1.0 (CR3)
                        19:12:23,261 INFO  [org.jboss.jpa.deployment.PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=jbossjpa.war#default
                        19:12:23,267 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=jbossjpa.war#default state=Create: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.PersistenceProvider from BaseClassLoader@7b725d6d{vfs:///java/apps/jbossas/jboss-6.0.0.Final/server/default/deploy/jbossjpa.war}
                            at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:52) [:1.0.2-alpha-3]
                            at org.jboss.as.jpa.scanner.HackCEMFBuilder.build(HackCEMFBuilder.java:49) [:6.0.0.Final]
                            at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275) [:1.0.2-alpha-3]
                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]
                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
                            at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
                            at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]
                            at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]
                            at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.GA]
                            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]
                            at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]
                            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]
                            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]
                            at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.GA]
                            at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
                            at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]
                            at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]
                            at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]
                            at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
                            at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
                            at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
                            at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
                            at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240) [:0.2.2]
                            at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
                            at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
                            at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
                            at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
                            at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
                            at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
                            at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
                            at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
                            at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
                            at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
                            at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_23]
                            at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_23]
                            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_23]
                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_23]
                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [:1.6.0_23]
                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [:1.6.0_23]
                            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_23]
                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_23]
                            at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
                        Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.PersistenceProvider from BaseClassLoader@7b725d6d{vfs:///java/apps/jbossas/jboss-6.0.0.Final/server/default/deploy/jbossjpa.war}
                            at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.GA]
                            at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_23]
                            at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:44) [:1.0.2-alpha-3]
                            ... 70 more
                        
                        19:12:23,668 WARN  [org.jboss.profileservice.deployment.hotdeploy.HDScanner] Scan failed: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                        
                        DEPLOYMENTS MISSING DEPENDENCIES:
                          Deployment "jboss-injector:appName=jbossjpa,module=jbossjpa" is missing the following dependencies:
                            Dependency "<UNKNOWN jboss-injector:appName=jbossjpa,module=jbossjpa>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=jbossjpa,module=jbossjpa' **")
                          Deployment "jboss-switchboard:appName=jbossjpa,module=jbossjpa" is missing the following dependencies:
                            Dependency "persistence.unit:unitName=jbossjpa.war#default" (should be in state "Installed", but is actually in state "**ERROR**")
                          Deployment "jboss.web.deployment:war=/jbossjpa" is missing the following dependencies:
                            Dependency "jboss-injector:appName=jbossjpa,module=jbossjpa" (should be in state "Create", but is actually in state "Configured")
                        
                        DEPLOYMENTS IN ERROR:
                          Deployment "persistence.unit:unitName=jbossjpa.war#default" is in error due to the following reason(s): java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.PersistenceProvider from BaseClassLoader@7b725d6d{vfs:///java/apps/jbossas/jboss-6.0.0.Final/server/default/deploy/jbossjpa.war}, **ERROR**
                          Deployment "<UNKNOWN jboss-injector:appName=jbossjpa,module=jbossjpa>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-switchboard:appName=jbossjpa,module=jbossjpa' **
                        
                            at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.0.GA]
                            at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.0.GA]
                            at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.0.0.Final]
                            at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:138) [:0.2.2]
                            at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:246) [:0.2.2]
                            at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
                            at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
                            at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
                            at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
                            at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
                            at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
                            at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
                            at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
                            at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
                            at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
                            at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_23]
                            at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_23]
                            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_23]
                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_23]
                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [:1.6.0_23]
                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [:1.6.0_23]
                            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_23]
                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_23]
                            at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
                        
                        

                         

                         

                        What should I do now - raise a bug or something else?

                         

                        Cheers,

                        Andy

                        • 9. Unable to use JPA in a web application under JBoss
                          Benjamin Seyinbour Expert

                          Hi Andrew,

                           

                          I don't see any NotSerializableException in your stacktrace. However, you have the following error:

                           

                          Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.PersistenceProvider

                           

                          That class is in eclipseLink.jar which should be under your $JBOSS_HOME/common/lib or $JBOSS_HOME/server/default/lib. There is no need to bundle it in your *.war file.

                           

                          Cheers.

                          • 10. Re: Unable to use JPA in a web application under JBoss
                            5pike Newbie

                            Hi Benjamin,

                             

                            Ok I have copied the eclipselink.jar file to $JBOSS_HOME/server/default/lib and now I get the following error:

                             

                            22:08:38,502 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 11s:5ms
                            22:08:59,064 INFO  [org.jboss.jpa.deployment.PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=jbossjpa.war#default
                            22:08:59,072 WARN  [org.jboss.detailed.classloader.ClassLoaderManager] Unexpected error during load of:javax.persistence.SharedCacheMode: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) previously initiated loading for a different type with name "javax/persistence/SharedCacheMode"
                                at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_23]
                                at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_23]
                                at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_23]
                                at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:52) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:650) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:609) [jboss-classloader.jar:2.2.0.GA]
                                at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_23]
                                at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:608) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:585) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:156) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.filter.FilteredDelegateLoader.doLoadClass(FilteredDelegateLoader.java:141) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:132) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:461) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:262) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:161) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:260) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss-classloader.jar:2.2.0.GA]
                                at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_23]
                                at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.getSharedCacheMode(PersistenceUnitInfoImpl.java:166) [:2.0.0]
                                at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:107) [:2.0.0]
                                at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:252) [:1.0.2-alpha-3]
                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]
                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
                                at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
                                at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]
                                at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]
                                at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]
                                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]
                                at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]
                                at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
                                at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
                                at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
                                at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
                                at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
                                at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
                                at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
                                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_23]
                                at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_23]
                                at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [:1.6.0_23]
                                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_23]
                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_23]
                                at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
                            
                            22:08:59,084 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=jbossjpa.war#default state=Create: java.lang.NoClassDefFoundError: javax/persistence/SharedCacheMode
                                at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.getSharedCacheMode(PersistenceUnitInfoImpl.java:166) [:2.0.0]
                                at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:107) [:2.0.0]
                                at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:252) [:1.0.2-alpha-3]
                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]
                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
                                at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
                                at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.0.GA]
                                at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.GA]
                                at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]
                                at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]
                                at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]
                                at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
                                at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
                                at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
                                at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
                                at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
                                at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
                                at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
                                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_23]
                                at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_23]
                                at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [:1.6.0_23]
                                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_23]
                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_23]
                                at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
                            Caused by: java.lang.ClassNotFoundException: Unexpected error during load of: javax.persistence.SharedCacheMode, msg=loader constraint violation: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) previously initiated loading for a different type with name "javax/persistence/SharedCacheMode"
                                at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:176) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:260) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss-classloader.jar:2.2.0.GA]
                                at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_23]
                                ... 71 more
                            Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) previously initiated loading for a different type with name "javax/persistence/SharedCacheMode"
                                at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_23]
                                at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_23]
                                at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_23]
                                at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:52) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:650) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:609) [jboss-classloader.jar:2.2.0.GA]
                                at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_23]
                                at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:608) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:585) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:156) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.filter.FilteredDelegateLoader.doLoadClass(FilteredDelegateLoader.java:141) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:132) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:461) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:262) [jboss-classloader.jar:2.2.0.GA]
                                at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:161) [jboss-classloader.jar:2.2.0.GA]
                                ... 77 more
                            
                            22:08:59,160 INFO  [org.jboss.weld.Version] WELD-000900 1.1.0 (CR3)
                            22:08:59,513 WARN  [org.jboss.profileservice.deployment.hotdeploy.HDScanner] Scan failed: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                            
                            DEPLOYMENTS MISSING DEPENDENCIES:
                              Deployment "jboss-injector:appName=jbossjpa,module=jbossjpa" is missing the following dependencies:
                                Dependency "<UNKNOWN jboss-injector:appName=jbossjpa,module=jbossjpa>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=jbossjpa,module=jbossjpa' **")
                              Deployment "jboss-switchboard:appName=jbossjpa,module=jbossjpa" is missing the following dependencies:
                                Dependency "persistence.unit:unitName=jbossjpa.war#default" (should be in state "Installed", but is actually in state "**ERROR**")
                              Deployment "jboss.web.deployment:war=/jbossjpa" is missing the following dependencies:
                                Dependency "jboss-injector:appName=jbossjpa,module=jbossjpa" (should be in state "Create", but is actually in state "Configured")
                            
                            DEPLOYMENTS IN ERROR:
                              Deployment "persistence.unit:unitName=jbossjpa.war#default" is in error due to the following reason(s): java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) previously initiated loading for a different type with name "javax/persistence/SharedCacheMode", **ERROR**
                              Deployment "<UNKNOWN jboss-injector:appName=jbossjpa,module=jbossjpa>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-switchboard:appName=jbossjpa,module=jbossjpa' **
                            
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.0.GA]
                                at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.0.GA]
                                at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.0.0.Final]
                                at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:138) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:246) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
                                at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
                                at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
                                at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
                                at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
                                at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
                                at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
                                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_23]
                                at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_23]
                                at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [:1.6.0_23]
                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [:1.6.0_23]
                                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_23]
                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_23]
                                at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
                            
                            

                             

                             

                            Cheers,

                            Andy

                            • 11. Re: Unable to use JPA in a web application under JBoss
                              Benjamin Seyinbour Expert

                              //===================================================================================

                              java.lang.NoClassDefFoundError: javax/persistence/SharedCacheMode

                              //===================================================================================

                               

                              22:08:59,084 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=jbossjpa.war#default state=Create: java.lang.NoClassDefFoundError: javax/persistence/SharedCacheMode

                                  at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.getSharedCacheMode(PersistenceUnitInfoImpl.java:166) [:2.0.0]

                               

                               

                              EXPLANATION:

                              1. This is an incorrect class path problem -- javax/persistence/SharedCacheMode could not be found in your class path

                              2. You may have different versions of the jar that contains javax/persistence/SharedCacheMode

                              3. SharedCacheMode can be found in your %JBOSS_HOME/common/lib/hibernate-jpa-2.0-api.jar

                              4. SharedCacheMode can also be found in javax.persistence_x.x.x.vx.jar

                               

                               

                              SOLUTION:

                              (I don't know Maven. but I can see 'javax.persistence' in your artifactId)

                              Make sure that Maven is not bundling javax.persistence_x.x.x.vx.jar with your jbossjpa.war

                               

                               

                              Cheers

                              • 12. Re: Unable to use JPA in a web application under JBoss
                                jaikiran pai Master

                                Andrew Pike wrote:

                                 


                                The example application uses EclispeLink, which I also tried to use under JBoss.  However, I understand JBoss by default uses Hibernate.  I don't have a preference but if anyone can explain how to get it working with Hibernate – then this is probably the better solution.

                                 

                                I just noticed that you are willing to try it with Hibernate too. In that case, you don't have to do much.

                                 

                                 

                                Andrew Pike wrote:

                                 


                                 

                                I will try to attach the slightly amended version of the example application here but whatI think are the main changes are listed below:

                                 

                                pom.xml:

                                <dependencies>
                                  <dependency>
                                  <groupId>org.eclipse.persistence</groupId>
                                  <artifactId>javax.persistence</artifactId>
                                  <version>2.0.0</version>
                                  <scope>provided</scope>
                                  </dependency>
                                  <dependency>
                                  <groupId>org.eclipse.persistence</groupId>
                                  <artifactId>eclipselink</artifactId>
                                  <version>2.1.1</version>
                                  </dependency>
                                </dependencies>
                                
                                <repositories>
                                  <repository>
                                  <id>EclipseLink Repo</id>
                                  <url>http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo</url>
                                  <snapshots>
                                  <enabled>true</enabled>
                                  </snapshots>  
                                  </repository>
                                </repositories>

                                 

                                Just additionally mark the EclipseLink dependencies as "provided" scope. That way, those jars won't be packaged in your application and the Hibernate implementation shipped by default in JBoss AS will be picked up:

                                 

                                <dependencies>
                                  <dependency>
                                  <groupId>org.eclipse.persistence</groupId>
                                  <artifactId>javax.persistence</artifactId>
                                  <version>2.0.0</version>
                                  <scope>provided</scope>
                                  </dependency>
                                  <dependency>
                                  <groupId>org.eclipse.persistence</groupId>
                                  <artifactId>eclipselink</artifactId>
                                  <version>2.1.1</version>
                                  <!-- Jaikiran: Marked as provided to prevent these jars from being packaged with the app -->
                                  <scope>provided</scope>
                                  </dependency>
                                </dependencies>
                                
                                <repositories>
                                  <repository>
                                  <id>EclipseLink Repo</id>
                                  <url>http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo</url>
                                  <snapshots>
                                  <enabled>true</enabled>
                                  </snapshots>  
                                  </repository>
                                </repositories>
                                
                                • 13. Re: Unable to use JPA in a web application under JBoss
                                  Michael O'Brien Newbie

                                  Andrew,

                                       Hi, sorry to hear about your issues with your JPA application.   I normally don't frequent this forum but was alerted to it by a coworker.

                                       I recommend you follow the steps in the tutorial below. 

                                   

                                  http://wiki.eclipse.org/EclipseLink/Examples/JPA/JBoss_Web_Tutorial

                                   

                                       It is for a standard quickstart Java EE container managed JTA JPA application that uses a stateless session bean to manage calls to an injected EntityManager - where the SSB is used as a facade from the servlet client.  When using JSF 2.0 (via .XHTML client pages and @ManagedBean injected pojos)  You can replace the servlet with the managedBean in the case of JSF - see the tutorial below for WebLogic and GlassFish for an example.  The essential detail is that JBoss can handle everything for you if you use Java EE 5 session beans or new Java EE 6 Web Profile local or no-interface session beans.

                                   

                                  http://wiki.eclipse.org/EclipseLink/Examples/Distributed

                                   

                                       For your four issues - I have the following observations.

                                       1) like what was mentioned above - don't include JPA specification (javax.persistence.*.jar) or JPA implementation (eclipselink.jar or org.eclipse.persistence.*.jar) libraries with your EAR/WAR - everything should be on the container.  You will avoid ClassCastExceptions - which result because of the different classloaders in use on the EJB and Web container.

                                       2) Shared Cache Mode runtime exceptions:

                                       You need to have the JPA 2.0 specification jar (javax.persistence.*.jar) higher in the classpath than both older JPA 1.0 spec jars and any JPA implementation jars (EclipseLink, Hibernate, OpenJPA, Kodo etc..).  JBoss 6 as a Java EE 6 server should already be setup this way with JPA 2.0 as the default.

                                       If you see issues with Shared Cache Mode (or any other new JPA 2.0 API like Criteria or Metamodel) - this usually means that the persistence unit was loaded by a classloader that is only using a JPA 1.0 version of the spec jar.

                                       Another issue is - do you need JPA 2.0 both for runtime and design time?  If you dont need <shared-cache-mode>NONE</shared-cache-mode> then you can change the version in your persistence.xml back to 1.0 from 2.0 and still use runtime API like Criteria and Metamodel ok.

                                       See a discussion and test results/configuration on running JPA 2.0 on JBoss in https://bugs.eclipse.org/bugs/show_bug.cgi?id=250477#c3

                                  http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg04116.html

                                   

                                       3) EntityManagerFactory serialization error

                                       This usually means that your JBoss application is attempting to serialize the @PersistenceUnit EMF on your JSF ManagedBean.

                                       You have several options.

                                            a) use a new Java EE 6 Web Profile (EJB 3.1 lite) @LocalBean and inject a @PersistenceContext EntityManager there instead

                                            b) use a Java EE 5 EJB 3.0 @Local @Stateless session bean and also inject a @PersistenceContext EntityManager there (both will be JTA)

                                        4) Noticed you are using bean managed transactions (@Resource UserTransaction) but you have a container managed persistence context (transaction-type="JTA") defined in your persistence.xml.  I would remove JTA and default to RESOURCE_LOCAL if you want to control all your transactions and rollbacks - which it looks like you do in your doLogin().

                                        5) Your persistence.xml could be modified.  See the following class for valid EclipseLink properties.

                                  http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/config/PersistenceUnitProperties.java

                                        I recommend the following invalid value

                                   

                                   

                                   

                                   

                                  name="eclipselink.ddl-generation" value="update-tables"

                                   

                                   

                                   

                                   

                                           be replaced with the following - at least until your model is stable - you want to view the DDL and you no longer want to regenerate the schema

                                   

                                   

                                   

                                  <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>

                                  <property name="eclipselink.ddl-generation.output.mode" value="both"/>

                                  {/code:xml}

                                   

                                   

                                   

                                  Drop by anytime to the following forums and you will usually get responses within 2-12 hours.

                                  http://wiki.eclipse.org/User:Michael.obrien.oracle.com#EclipseLink_related_Forums

                                          

                                       thank you

                                       Michael O'Brien

                                  http://www.eclipselink.org