10 Replies Latest reply on Feb 9, 2010 1:06 PM by peterj

    Can't deploy in 5.0 GA or later though 5.0.CR2 works fine

      Very 5.X version of JBoss AS later than 5.0.CR2 fails on deployment, complaining about not finding the persistence unit. I get the same problem on Debian (lenny 686) and on Mac OSX v10.5. I have tried both the jdk5 and jdk6 versions. Same result.

       

      When my EAR deployemnt kept failing, I tried the EJB3 tutorial apps (from http://www.jboss.org/file-access/default/members/jbossejb3/freezone/docs/tutorial/1.0.7/html_single/index.html) using ant. Deployment fails on the very first app, the Stateless Calculator bean, and I used the downloaded code without modifications.

       

       

      Error messages follow:

      14:24:49,759 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@28604266{vfszip:/home/stefan/jboss-5.0.1.GA/server/default/deploy/jboss-ejb3-tutorial-stateless.jar/}
      14:24:49,759 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@28604266{vfszip:/home/stefan/jboss-5.0.1.GA/server/default/deploy/jboss-ejb3-tutorial-stateless.jar/}
      14:24:50,761 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/home/stefan/jboss-5.0.1.GA/server/default/deploy/jboss-ejb3-tutorial-stateless.jar/ state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: Error deploying jboss-ejb3-tutorial-stateless.jar: Container jboss.j2ee:jar=jboss-ejb3-tutorial-stateless.jar,name=PetDAOBean,service=EJB3 failed to resolve persistence unit null
          at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:201)
          at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:103)
          at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:146)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:170)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
          at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalArgumentException: Container jboss.j2ee:jar=jboss-ejb3-tutorial-stateless.jar,name=PetDAOBean,service=EJB3 failed to resolve persistence unit null
          at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:135)
          at org.jboss.injection.PersistenceContextHandler.loadXml(PersistenceContextHandler.java:76)
          at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:588)
          at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:415)
          at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:523)
          at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:194)
          ... 27 more
      Caused by: java.lang.IllegalArgumentException: Can't find a persistence unit named 'null' in AbstractVFSDeploymentContext@28604266{vfszip:/home/stefan/jboss-5.0.1.GA/server/default/deploy/jboss-ejb3-tutorial-stateless.jar/}
          at org.jboss.jpa.resolvers.BasePersistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(BasePersistenceUnitDependencyResolver.java:107)
          at org.jboss.ejb3.Ejb3Deployment.resolvePersistenceUnitSupplier(Ejb3Deployment.java:720)
          at org.jboss.ejb3.EJBContainer.resolvePersistenceUnitSupplier(EJBContainer.java:1428)
          at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:130)
          ... 32 more
      14:24:50,766 WARN  [HDScanner] Failed to process changes
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):


       


      DEPLOYMENTS IN ERROR:
        Deployment "vfszip:/home/stefan/jboss-5.0.1.GA/server/default/deploy/jboss-ejb3-tutorial-stateless.jar/" is in error due to the following reason(s): java.lang.IllegalArgumentException: Can't find a persistence unit named 'null' in AbstractVFSDeploymentContext@28604266{vfszip:/home/stefan/jboss-5.0.1.GA/server/default/deploy/jboss-ejb3-tutorial-stateless.jar/}


       


          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:863)
          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:806)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:293)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:146)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:170)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
          at java.lang.Thread.run(Thread.java:595)


        • 1. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine
          jaikiran

          Are you sure you haven't changed anything in the JBoss AS installation or in the tutorial? The stateless tutorial does not even have a persistence unit. So i don't see what it's failing with a persistence unit injection problem.

           

          Also i would recommend that you use the latest stable JBoss AS 5.1.0 version.

          • 2. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine
            peterj
            Why is there a PetDAOBean in the Stateless Calculator app?
            1 of 1 people found this helpful
            • 3. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine

              Thank you for responding. It is all a mystery to me. I had already tried the 5.1.0 with the same result. To make sure that the JBoss server was pristine, I installed a new version from the official download (into a totally empty directory). I did the same with the tutorial. Set the JAVA_HOME, ANT_HOME and JBOSS_HOME variables, made sure the correct java bin folder was on my path, started up JBoss, verified I had contact with it on port 8080. Next I ran ANT from the stateless bean folder of the tutorial, at which point JBoss issued the exception.

               

              Makes no sense to me either that it would be complaining about the persistance unit, since this is only a stateless bean with no persistence unit at all. When I earlier was trying to deploy my actual application, which does have a persistence unit, JBoss correctly created the database tables when it deployed the EAR/EJB jar, but then complained in the EAR/WAR deployment that it couldn't locate the persistence unit. It was this behavior that led me to try the tutorial from step 1 in a pristine server and see if/where the problem would show up. It did in the very first deployment step.

              • 4. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine

                Thank You Peter - I did not notice the reference to the PetDAOBean. At least that explains why it was looking for a persistence unit. Looking into the tutorial tree on my machine, it has placed the singleinheritence folder under stateless/src/jboss/ to create the following tree:

                 

                stateless/

                stateless/src/

                stateless/src/org/

                stateless/src/org/jboss/

                stateless/src/org/jboss/tutorial/

                stateless/src/org/jboss/tutorial/stateless/

                stateless/src/org/jboss/tutorial/stateless/bean/

                stateless/src/org/jboss/tutorial/stateless/client/

                stateless/src/org/jboss/singleinheritance/

                stateless/src/org/jboss/singleinheritance/META-INF/

                stateless/src/org/jboss/singleinheritance/src/

                stateless/src/org/jboss/singleinheritance/src/org/

                stateless/src/org/jboss/singleinheritance/src/org/jboss/

                stateless/src/org/jboss/singleinheritance/src/org/jboss/tutorial/

                stateless/src/org/jboss/singleinheritance/src/org/jboss/tutorial/singleinheritance/

                stateless/src/org/jboss/singleinheritance/src/org/jboss/tutorial/singleinheritance/bean/

                stateless/src/org/jboss/singleinheritance/src/org/jboss/tutorial/singleinheritance/client/

                 

                Since the zip file doesn't look like that, it looks to be a problem not with JBoss, but with the unzip program on my Debian machine. Very strange!!  I'll restart testing after expanding the zip on another machine and then transferring the the whole tree.

                 

                Again, thank you for your sharp eye.

                • 5. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine
                  peterj
                  I've seen similar things happen when someone accidently moves a folder while browsing in the file manager. Cleaning that up by unpacking the zip file again should fix it.
                  1 of 1 people found this helpful
                  • 6. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine
                    jaikiran

                    peterj wrote:

                     

                    Why is there a PetDAOBean in the Stateless Calculator app?

                    I should start using that horizontal scroll bar, to view the exception stacktrace, in this new forum software

                    • 7. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine
                      peterj

                      I find that horizontal scroll bar rather annoying, especially when I have to scroll way down the page to find it, move it hopefully the right amount, and then move way back up to the top of the page to see if I moved it the correct amount. Though it does keep the page nicely formatted, unlike at Java Ranch where really long lines in source code can really mess up the formatting, though I have to admit that I much prefer Java Ranch's editor and overall usability.

                       

                      I apologize to hijacking the discussion, Stefan, but ever since the update to the JBoss forums, complaining about its idiosyncrasies has become a hobby of mine.

                      • 8. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine

                        Thank you again - I cleaned the tree up by unzipping the whole tree again. It now deployes cleanly in both 5.0.1.GA and 5.1.0.GA.

                         

                        I would have torn my hair over this for days and may never have found it.

                        • 9. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine

                          Well, it actually turned out that yours was the correct answer as well, since although I hadn't modified anything, the directory tree in the tutorial was corrupt. So, the problem was not with JBoss, nor with the tutorial per se, but rather a problem where the unzip didn't go right.

                           

                          Thank you for your help.

                          • 10. Re: Can't deploy in 5.0 GA or later though 5.0.CR2 works fine
                            peterj
                            Glad to help. Sometimes all it takes is another pair of eyes.