4 Replies Latest reply on Sep 9, 2010 9:14 AM by sandy007

    Issues with JBOSS hot deployment

    sandy007

      Hi,

      I am using Jboss 5.0.1 version and it has two appliaction deplyoed. Say applicatin A and B.

      Aplication B needs few classes from A so what I did is exposed the jars of Application A by using jboss-classloading.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <classloading xmlns="urn:jboss:classloading:1.0"
                name="A"
                domain="DefaultDomain"
                top-level-classloader="true"
                export-all="NON_EMPTY"
                import-all="true">
      </classloading>

       

      But after doing that whernever I want to do hot deplyoment for application A, it doesnt work.(It doesnt give any error but the changes doesnt reflect)

       

      I have to restart the JBOSS which I dont want.

       

      Please help to find the solution or let me know if you need more information.

      Thanks,

      Sandy

        • 1. Re: Issues with JBOSS hot deployment
          welle

          Does it work as you want if you redeploy B after the redeploy of A?

          • 2. Re: Issues with JBOSS hot deployment
            sandy007

            Yes , Acutally I was wrong in first comment ...with latest investigation I found that hot deployment is working but the classes which are used by  application B are not getting changed/reflected only for application B.

             

            In short the  application B is not picking the updated classes of application A.

            Is there any way with which I can configure this.

            • 3. Re: Issues with JBOSS hot deployment
              welle

              To get B to find the new classes in A you need to redeploy B after you redeployed A. The redploy starts a new classloader to load new instances in the archive. After a redeploy of A,  B still has references to the old ones until it gets redeplyed. There is no way to throw out a loaded class in Java, you can only create a new classloader and load the class again in that one instead of the old classloader.

               

              PS. I haven't actually tested/played with the classloading in AS 5 yet though DS.

              • 4. Re: Issues with JBOSS hot deployment
                sandy007

                Anders,

                 

                Thank you very much for the suggestions. I dont know but there should be way to configure the classloader to reload. I mean for application B without redeplyoing it should be able to pick the changes.

                I am not sure JBOSS's latest version can help or not?