7 Replies Latest reply on Apr 13, 2010 3:47 AM by anon137564

    Problems deploying exploded .war, deploying zipped .war works fine (JBoss 4.2.3.GA)

      Hi,

       

      I'm pretty new to JBoss and I'm encountering a problem when deploying an exploded .war file. When I'm deploying it as a zipped .war, everything works fine. I'm using a JBoss application server in the version of 4.2.3.GA.

       

      By deploying I mean that I simply copy the whole zipped file respectively the whole exploded directory into the JBoss deploy directory. I'm doing this when JBoss has already started up and is running. Two other Java applications are already resting in the deploy directory and deployed at the startup with no problems.

       

      When deploying it as a exploded war, I'm always getting the error java.lang.ClassNotFoundException (the whole error log is appended as a text file to the post). The JBoss progress to deploy the files starts soon after I'm beginning to copy the exploded .war directory. At this moment, only a few files are copied. Could it be that because of this, JBoss can't find the class — it's simply not there yet? The directory is pretty large and takes approximately 40 seconds to copy.

       

      Do you know a way to start the deploy progress not before the directory has finished copying? Or is there another solution for my problem? Our projects are using maven, maybe there's a way this could help to ...

       

      Thank you for your help

       

      Guy

        • 1. Re: Problems deploying exploded .war, deploying zipped .war works fine (JBoss 4.2.3.GA)
          wolfgangknauf

          Hi,

           

          first thing: I would delete the old directory and wait some seconds so that JBoss can undeploy the old stuff. Copying things over an existing deployment might cause problems.

           

          I read somewhere that a "move" operation is much faster than a "copy". So, place your exploded deployment somewhere else on the same disc as jboss, then MOVE it to the deploy directory.

           

          Hope this helps

           

          Wolfgang

          • 2. Re: Problems deploying exploded .war, deploying zipped .war works fine (JBoss 4.2.3.GA)

            Thank you for your quick answer, Wolfgang.

             

            When I'm deploying either the zipped or the exploded war file, I haven't deployed it before. So there's no directory with it's name in the deploy directory and nothing to undeploy.

             

            I'm working with Windows Vista and I copy the files using the Windows Explorer. So I don't know if I can speed up this process.

             

            Isn't there a way to tell the TomcatDeployer to wait for the file transfer to be completed? Is such a thing feasible with an Ant script?

             

            Guy

            • 3. Re: Problems deploying exploded .war, deploying zipped .war works fine (JBoss 4.2.3.GA)

              Ok, maybe the problems has nothing to do with the duration of the file copying.

               

              I have now changed the EnhancedSuffixOrder in the MainDeployer-xmbean.xml to deploy .war files after .ear files. Now I can start the JBoss with the .war file already in the deploy directory.

               

              With this setting the zipped .war still works fine, but with the exploded .war I'm again getting an error. It says that it's unable to initialize group definition. The whole log file is appended to the post.

               

              This is the same application, once zipped and once exploded. Are they treated in any way different by JBoss? Cause if they weren't, there wouldn't be any error, or am I wrong?

               

              Guy

              • 4. Re: Problems deploying exploded .war, deploying zipped .war works fine (JBoss 4.2.3.GA)
                wolfgangknauf

                Hi Bernhard,

                 

                {quote}I'm working with Windows Vista and I copy the files using the Windows  Explorer. So I don't know if I can speed up this process.{quote}

                 

                how do you copy? If you use drag&drop, it should by default MOVE the files, while copy/paste performs a file COPY. Make sure that the files are on the same disk.

                I would advice you to use the command line and the "MOVE" command.

                 

                Hopefully, your deployment errors are only a timing issue.

                 

                By the way: you could stop JBoss, copy the exploded deployment and start the server afterwards. Now it should deploy without errors. If it does not, there is a problem with your EAR ;-).

                 

                Hope this helps

                 

                Wolfgang

                1 of 1 people found this helpful
                • 5. Re: Problems deploying exploded .war, deploying zipped .war works fine (JBoss 4.2.3.GA)

                  As I've written above, there seems to be another error too.

                   

                  When I copy the zipped war in the deploy directory and then start JBoss, everything is working fine.

                  When I copy the exploded war in the deploy directory and then start the JBoss, I'm getting the following error.

                   

                  org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:frontend.xml], factory key [service-context]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service-context' defined in URL [file:/C:/jboss-4.2.3.GA/server/default/deploy/frontend.war/WEB-INF/classes/frontend.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rules' defined in file [C:\jboss-4.2.3.GA\server\default\deploy\frontend.war\WEB-INF\classes\package\Rules.class]: Invocation of init method failed; nested exception is java.lang.NullPointerException

                   

                  The exploded and the zipped war should be identical to JBoss, or are there any differences how JBoss is treating them?

                  • 6. Re: Problems deploying exploded .war, deploying zipped .war works fine (JBoss 4.2.3.GA)

                    It seems to me now, that the problem lies elsewhere. The maven goal war:explode, with which I'm assembling the exploded war, doesn't include the pom.xml and the pom.properties. The goal war:war, which creates the zipped war, does include these two files.

                     

                    With these files everything is working fine, but without them I'm getting the errors.

                    • 7. Re: Problems deploying exploded .war, deploying zipped .war works fine (JBoss 4.2.3.GA)

                      As I've found out, the projects needs the pom.properties file to run, which is not included in an exploded war by maven's default settings. So this problem has got nothing to do with JBoss.

                       

                      Of course the timing problem still exists, but if I'm deploying the war within a deploy.last directory in the deploy directory, I can bypass this nuisance.

                       

                      Thank you for your help, Wolfgang.