5 Replies Latest reply on May 14, 2004 12:20 AM by lahirukarunatilake

    Problem deploying WAR in JBoss 3.2.3

    adam1970

      Hello and help!

      I run in this problem during the deployment of a Struts WAR in JBoss 3.2.3. First deployment OK, everything running fine, done a code change in an Action class, redeploying, everything running fine again, only the result is the same as before the code change. Since then I have redeployed a lot of times, done a lot of code changes but every time the application running is the same. I checked the war in the deploy directory and it is the new one, I deleted the content of server/default/tmp/deploy directory and redeployed, every time the same thing is running!!!! I am crazy or what :-( ?
      Can this be related to the warning message during the (re)deployment:

      WARN [DeploymentInfo] Could not delete file:/D:/jboss-3.2.3/server/default/tmp/deploy/tmp11463MyStoreWeb.war/ restart will delete it ?

      Also, sometimes when I redeploy and try to run the application in browser, I got:

      org.apache.jasper.JasperException: Exception creating bean of class com.mystore.struts.form.LoginUserForm

      There is no problem in code or descriptors, as after I restart the server everything is running fine (except for the first problem...)

      Any ideea? Any help will be appreciated.
      (win2k/eclipse2.1.1/lomboz2.1.1/JBoss3.2.3/jdk1.4.1_03)

        • 1. Re: Problem deploying WAR in JBoss 3.2.3
          jonlee

          It seems like some class didn't unload properly from the JVM. This tends to happen a lot with Struts but it also happens with anything that the JVM understands to be still in use - that is; an active instance of the class remains in use in the JVM.

          For your issue, you might be able to get around it by deploying the Struts framework separate to your WAR. YMMV.

          Your other option is to track down the class unloading problem and work out what is holding the instance in memory. For a very large application, the effort is usually not worth it.

          Otherwise, stopping and restarting JBoss is the other alternative.

          Hope that helps and that I have the right of the situation.

          • 2. Re: Problem deploying WAR in JBoss 3.2.3
            adam1970

            Thanks Jonlee for your reply.

            Yes, for sure there is something not unloading here, but what, why, where etc? And the problem is not that simple, I have stopped/started the server already and the result is the same! In my browser is running now an application from 3 days ago, I cannot see any change I did in the last days, even one as small as commenting/uncommenting or introducing a new test line (a simple System.out.println).
            I've tried to use the debugger in Eclipse step by step and every time when I get to the new code, it is ignored, as if it was not there...
            I changed the jdk (I was using BEA) to SUN 1.4.1_07 (tried even with 1.4.2) - no result.
            Does JBoss keep some cache of applications?

            Also, does anybody know about a solution to the "hot code replace" problem that I saw on forums many people have? Nobody has given a good answer until now. For any change I made in code, however small it is and not affecting the class structure (for example the commenting of a System.out.println line) after saving, I get a message box stating: org.jboss.Main at localhost:xxxx (may be out of synch) was unable to replace the running code with the code in the workspace. Reason: Hot code replace failed - Scheme change not implemented
            Some people say it is the jdk - I tried 1.3, 1.4.1, 1.4.2 etc, so no - others say is the changes in class structure - see above, only a comment changed, so no!

            • 3. Re: Problem deploying WAR in JBoss 3.2.3
              adam1970

              Problem solved... Of course, I was the stupid one, not JBoss... Having separate projects for EJB and WEB, my ejb deployment script was including by mistake the web compiled classes. I tested and deployed the EJB module 3 days ago and not touching it since, so it was normal the web classes to be the old ones... Although, when I open the application in browser, shouldn't the classes called be the ones in the WAR and not the ones in the ejb JAR? Anyway, everything is working now.

              The problem with the hot code replace still remains.

              • 4. Re: Problem deploying WAR in JBoss 3.2.3
                jonlee

                Have a look at the classloading comments in JBOSS_HOME/examples/dtd/jboss-web_3_2.dtd for information, in particular around the line, <class-loading java2ClassLoadingCompliance='false'/>. There are also quite a number of posts in the forums discussing this.

                The hot deployment issue is as I have originally described. Try moving Struts out of the WAR and deployed in lib or similar tricks. There might be several "support" libraries you need to move out before you can hot deploy your application. That is generally the easiest solution.

                • 5. Re: Problem deploying WAR in JBoss 3.2.3
                  lahirukarunatilake

                  Hi Adam,

                  Did you found a solution to your "hot code replace" problem. Im also encounting the same problem. If u have any idea please help me out.

                  thanks in advance,
                  Lahiru