7 Replies Latest reply on Mar 26, 2008 8:54 PM by Bill Milligan

    Deploying Hudson on JBoss5 beta4

    Bill Milligan Newbie

      Hello all,

      I'm trying to deploy the latest build of Hudson (1.200) onto my copy of JBoss5 beta4. Jdk=1.6.0_03 on Ubuntu (Gutsy Gibbon) 7.10.

      After dropping the hudson.war into deploy, I'm getting an error, at which root is the idea that the hudson.war "File cannot contain children". Mystified, I checked the source and it seemed that I could not simply drop an unexploded war here. So fine, I exploded the war and restarted. I'm now getting the same error, only on one of the jarfiles in WEB-INF/lib.

      What gives? Why does it seem that I cannot put any unexploded artifacts into deploy?

      I've googled, but come up fairly empty on ways to fix this problem.

      Here's the full, latest trace. I'll put other context-like information below the trace:

      2008-03-22 22:43:21,034 DEBUG [org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer] Error during deploy: vfsfile:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war/
      org.jboss.deployers.spi.DeploymentException: Error creating classloader for vfsfile:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war/
      at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.createClassLoader(AbstractDeploymentContext.java:519)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.createClassLoader(AbstractDeploymentUnit.java:162)
      at org.jboss.deployers.spi.deployer.helpers.AbstractClassLoaderDeployer.deploy(AbstractClassLoaderDeployer.java:53)
      at org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer.deploy(WarClassLoaderDeployer.java:104)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:246)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
      at org.jboss.Main.boot(Main.java:208)
      at org.jboss.Main$1.run(Main.java:534)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.Error: Error visiting FileHandler@17387946[path=hudson.war/WEB-INF/lib/hudson-core-1.200.jar context=file:/opt/jboss-5.0.0.Beta4/server/default/deploy/ real=file:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war/WEB-INF/lib/hudson-core-1.200.jar]
      at org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderPolicy.determineAllPackages(VFSClassLoaderPolicy.java:442)
      at org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderPolicy.setExportAll(VFSClassLoaderPolicy.java:189)
      at org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer.createClassLoaderPolicy(WarClassLoaderDeployer.java:144)
      at org.jboss.deployers.plugins.classloading.AbstractClassLoaderSystemDeployer.createClassLoader(AbstractClassLoaderSystemDeployer.java:124)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.createClassLoader(AbstractDeploymentContext.java:510)
      ... 21 more
      Caused by: java.lang.IllegalStateException: File cannot contain children: FileHandler@17387946[path=hudson.war/WEB-INF/lib/hudson-core-1.200.jar context=file:/opt/jboss-5.0.0.Beta4/server/default/deploy/ real=file:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war/WEB-INF/lib/hudson-core-1.200.jar]
      at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:361)
      at org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderPolicy.determineAllPackages(VFSClassLoaderPolicy.java:438)
      ... 25 more


      There's another seemingly related message in the log, before this one:

      2008-03-22 22:43:14,258 DEBUG [org.jboss.virtual.plugins.context.file.FileSystemContext] Error opening jar file: file:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war/WEB-INF/lib/hudson-core-1.200.jar reason=error in opening zip file

      This is mysterious, because I can unjar that file just fine. The file ownership is for all files in the exploded war is set to my jboss daemon's user, and all read permissions are active.

      Additional info about my setup:

      I've made some tiny tweaks to affect startup, such as adding "-Dsun.lang.ClassLoader.allowArraySyntax=true" for JDK6 compatability, and "-Djava.awt.headless=true" as specified by the hudson docs.

      Hudson is supposed to run without need of a database, but if it helps analysis at all, I have a MySql datasource as well as the out-of-the-box HyperSonic.

      I'm running the default server, which I've attempted to change by adding Ales' spring-jboss bridge, and also adding rmi-iiop. I sincerely doubt this is causing the problem, but hey, it's an extra data point.

      Folks, I only post in these here forums when I'm totally stumped. I'm lost. Can anybody give me a clue?

        • 1. Re: Deploying Hudson on JBoss5 beta4
          jaikiran pai Master

          Try this. Remove your war file from the deploy folder and start JBoss. Once the server has started up without any errors, place your war file in the deploy folder. See if it deploys fine. There have been issues reported about applications not getting deployed when JBoss5 is booting.

          Btw, the logs that you posted look like DEBUG level messages (i guess you found them in server.log?). Are you sure the application is not deployed? Did you try some functionality of the application?

          • 2. Re: Deploying Hudson on JBoss5 beta4
            Bill Milligan Newbie

            Duh, I should have mentioned -- the server root context, jmx console etc. all comes up okay. There is no hudson war deployed, or findable. This is definitely a broken configuration somehow.

            I tried your suggestion, with removing all hudson paraphenalia, stopping, starting, and redeploying hudson.war into the deploy of the running server, with the same results as yesterday. It looks a little different from the one I posted yesterday, but the difference is because I posted a warfile rather than an unexploded war today. I will post the trace at the bottom.

            The message for deploying the war file itself is similar to the one I posted yesterday, but the severity is actually WARN (and yes, from server.log). See below for the exact trace I got when trying to deploy to an already running server.

            Also, given the error message "Error opening jar file" on the main hudson war (or jar, if I'm deploying the exploded version), this is not a minor "read-and-ignore" type error.

            2008-03-23 22:08:06,359 DEBUG [org.jboss.virtual.plugins.context.file.FileSystemContext] Error opening jar file: file:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war reason=Error opening jar file: jar:file:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war!/WEB-INF/lib/hudson-core-1.200.jar reason=error in opening zip file
            2008-03-23 22:08:06,372 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] Add deployment: vfsfile:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war
            2008-03-23 22:08:06,374 WARN [org.jboss.system.server.profileservice.hotdeploy.HDScanner] Scan failed
            org.jboss.deployers.spi.DeploymentException: Error determining structure: hudson.war
            at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
            at org.jboss.deployers.vfs.plugins.structure.jar.JARStructure.determineStructure(JARStructure.java:152)
            at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.determineStructure(StructureDeployerWrapper.java:65)
            at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.doDetermineStructure(VFSStructuralDeployersImpl.java:194)
            at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:218)
            at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77)
            at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:743)
            at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:280)
            at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:237)
            at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:267)
            at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
            at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: java.lang.IllegalStateException: File cannot contain children: FileHandler@15799662[path=hudson.war context=file:/opt/jboss-5.0.0.Beta4/server/default/deploy/ real=file:/opt/jboss-5.0.0.Beta4/server/default/deploy/hudson.war]
            at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:361)
            at org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer.addChildren(AbstractStructureDeployer.java:217)
            at org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer.addAllChildren(AbstractStructureDeployer.java:198)
            at org.jboss.deployers.vfs.plugins.structure.jar.JARStructure.determineStructure(JARStructure.java:143)
            ... 18 more

            • 3. Re: Deploying Hudson on JBoss5 beta4
              jaikiran pai Master

              I tried the hudson build on my local 5.0 Beta4 setup on Windows. I see the same exceptions. A similar sample war file of my own (irrespective of whether its deployed as a archive or exploded folder works fine). I wasnt able to spend too much time on this today. I just used JBoss-4.2.2 (the latest stable JBoss version) and deployed the hudson build there. It got deployed successfully. Any specific reason, why you are trying this on the Beta version of the server?

              • 4. Re: Deploying Hudson on JBoss5 beta4
                Bill Milligan Newbie


                "jaikiran" wrote:
                I tried the hudson build on my local 5.0 Beta4 setup on Windows. I see the same exceptions. A similar sample war file of my own (irrespective of whether its deployed as a archive or exploded folder works fine). I wasnt able to spend too much time on this today. I just used JBoss-4.2.2 (the latest stable JBoss version) and deployed the hudson build there. It got deployed successfully. Any specific reason, why you are trying this on the Beta version of the server?

                This isn't a professional deployment -- yet -- so my one and only machine for these purposes right now is a slightly underpowered laptop. I don't want to have multiple jboss versions running in parallel; it will slow down the rest of the machine, which I am using for various other things.

                On the other hand, I also need JB5 for a number of different things, for a couple of different business ideas as well as just for gratuitous, let's-learn-something-new-and-useful edutainment.

                Sure, since it's me myself and I, I could do builds without an integration server. But this was an opportunity to do a test deployment of a random warfile that I did not create, so it was a good check to see if I had understood everything and configured it correctly.

                I'm glad to see that you got these errors too. It means I'm not going crazy, and that my configuration is not definitely broken.

                • 5. Re: Deploying Hudson on JBoss5 beta4
                  Bill Milligan Newbie

                  On the other hand, this may be indicative of a defect in beta4 :(

                  • 6. Re: Deploying Hudson on JBoss5 beta4
                    jaikiran pai Master

                    I spent some time on this today with my local version of JBoss-5 Beta4. A bit of debugging and some modification to the JBoss server code (to print out some logs) pointed to a file named exposed.beans which is present in the META-INF folder of hudson.war/WEB-INF/lib/hudson-core-1.200.jar/META-INF folder. Apparently while parsing/opening this file there's some problem which leads to these exceptions. I haven't exactly been able to figure out what exactly is wrong with this file. As a workaround (just for tests) i deleted this file from the META-INF folder and deployed the application. The application deployed successfully without problems. I was even able to deploy the hudson.war file in an archive format (after deleting the exposed.beans file). I still don't exactly know what's the problem with the exposed.beans. Maybe you would want to point this to someone who's involved in developing Hudson (not sure whether they would entertain this request because you are using a Beta server and their documentation mentions using JBoss-4.2.x)?

                    P.S: If you are going to delete the exposed.beans for testing, you will also have to delete the HUDSON.SF from hudson.war/META-INF folder (remember this just for testing), or else the war file will fail verification (since this is a signed jar).

                    • 7. Re: Deploying Hudson on JBoss5 beta4
                      Bill Milligan Newbie

                      Wow, thanks! I truly appreciate the help.

                      My next plan for trying to solve this involved building hudson from source. I may yet do that, but at least I'd now know what the culprit is, and the focus would be on fixing rather than diagnosing.

                      You've saved me time from my terribly limited pool. Thanks heaps!