4 Replies Latest reply on Sep 7, 2011 8:56 AM by Michal Glowacki

    Entity beans from 5.1 don't deploy in as 7

    Michal Glowacki Novice

      hi,

       

        I have read through (very nice I must say) documentation / getting started guide for jboss 7 and stared migration of my system. However I cannot deploy my ejb.jar file with entity beans and persistence unit definition. Please tell me, what can I read from this:

       

      45:08,497 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Starting deployment of "EntityBeans.jar"

      45:11,517 INFO  [org.jboss.jpa] (MSC service thread 1-2) read persistence.xml for MyPU

      45:11,517 INFO  [org.jboss.jpa] (MSC service thread 1-2) read persistence.xml for MyPUTest

      45:11,517 INFO  [org.jboss.as.jpa] (MSC service thread 1-6) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to EntityBe

      .jar

      45:11,517 INFO  [org.jboss.as.jpa] (MSC service thread 1-6) added (default provider) org.hibernate dependency to application deployment (since 2 PU(s) didn't

      ecify jboss.as.jpa.providerModule)

      45:11,527 INFO  [org.jboss.as.jpa] (MSC service thread 1-6) added org.hibernate dependency to application deployment

      45:11,937 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."EntityBeans.jar".INSTALL: org.

      ss.msc.service.StartException in service jboss.deployment.unit."EntityBeans.jar".INSTALL: Failed to process phase INSTALL of deployment "EntityBeans.jar"

           at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)

           at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

           at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_18]

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_18]

           at java.lang.Thread.run(Thread.java:619) [:1.6.0_18]

      sed by: java.lang.IllegalArgumentException: name is null

           at org.jboss.msc.service.ServiceTargetImpl.createServiceBuilder(ServiceTargetImpl.java:59)

           at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.createServiceBuilder(ServiceControllerImpl.java:2198)

           at org.jboss.msc.service.ServiceTargetImpl.addService(ServiceTargetImpl.java:69)

           at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:302)

           at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleJarDeployment(PersistenceUnitDeploymentProcessor.java:121)

           at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:102)

           at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

           ... 5 more

       

       

       

       

      45:11,957 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployment of "EntityBeans.jar" was rolled back with failure message {"Faile

      ervices" => {"jboss.deployment.unit.\"EntityBeans.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"EntityBeans.jar\

      NSTALL: Failed to process phase INSTALL of deployment \"EntityBeans.jar\""}}

      45:11,957 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Stopped deployment EntityBeans.jar in 3ms

      45:11,977 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) {"Composite operation failed and was rolled back. Steps that failed:" => {"Operatio

      tep-2" => {"Failed services" => {"jboss.deployment.unit.\"EntityBeans.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.uni

      "EntityBeans.jar\".INSTALL: Failed to process phase INSTALL of deployment \"EntityBeans.jar\""}}}}

       

      It has nothing to do with class loading, I haven't seen any migration steps of persistence.xml file and I cannot find anything on the internet.

       

      Please help me with some advices what to check

      Michal

        • 1. Re: Entity beans from 5.1 don't deploy in as 7
          Michal Glowacki Novice

          I got something, here is how my persistence.xml looked like:

           

          <?xml version="1.0" encoding="UTF-8"?>

          <persistence>

                    <persistence-unit name="ScandicPU">

                              <provider>org.hibernate.ejb.HibernatePersistence</provider>

                              <jta-data-source>PostgresDataSource</jta-data-source>

                              <properties>

                                        <property name="jboss.entity.manager.jndi.name" value="MyPUManager" />

                                        <property name="jboss.entity.manager.factory.jndi.name"

                                                  value="MyPUManagerFactory" />

           

           

                                        <property name="hibernate.cache.region.factory_class"

                                                  value="org.hibernate.cache.infinispan.JndiInfinispanRegionFactory"/>

                                        <property name="hibernate.cache.infinispan.cachemanager"

                                                  value="java:jboss/infinispan/hibernate"/>

                                        <property name="hibernate.transaction.manager_lookup_class"

                                                  value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

                                        <property name="hibernate.cache.use_second_level_cache" value="true"/>

                                        <property name="hibernate.cache.use_minimal_puts" value="true"/>

           

           

                                        <property name="hibernate.transaction.manager_lookup_class"

                                                  value="org.hibernate.transaction.JBossTransactionManagerLookup" />

                              </properties>

                    </persistence-unit>

          </persistence>

           

           

          when I removed

           

            <property name="jboss.entity.manager.jndi.name" value="MyPUManager" />

            <property name="jboss.entity.manager.factory.jndi.name"

            value="MyPUManagerFactory" />

           

          It has deployed :/ Now I hope there is something to change in my seam project's components.xml, as I remember I have been using those names to define entity manager...

          • 2. Re: Entity beans from 5.1 don't deploy in as 7
            Gonne Martens Novice

            Hi,

             

            according to the documentation

            [Configure the datasource for Hibernate or JPA|https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7]

            you should also remove the "hibernate.transaction.manager_lookup_class" property from your persistence.xml as this is not needed.

             

            Regards,

            Gonne

            • 3. Re: Entity beans from 5.1 don't deploy in as 7
              Scott Marlow Master

              Can you try a more fully qualified jndi name for both properties?  Maybe something referring to the global JBoss name space for a test. 

              "java:jboss/entitymanager/MyPUManager"

              "java:jboss/entitymanager/MyPUManagerFactory"

               

              If my theory, is correct, I think the short name was not handled internally.  Jira AS7-1171 will hopefully help improve that.  Please let us know if this helps. 

              • 4. Re: Entity beans from 5.1 don't deploy in as 7
                Michal Glowacki Novice

                what I did is:

                 

                to persistence.xml

                 

                <property name="jboss.entity.manager.jndi.name" value="java:jboss/MyPU"/>

                                              <property name="jboss.entity.manager.factory.jndi.name"

                                         value="java:jboss/MyPUManagerFactory" />

                 

                 

                Now it works!