7 Replies Latest reply on Oct 4, 2006 2:14 PM by wcydaip

    Jar Isolation Not Working

    wcydaip

      All,

      I've been up and down this road many times, but, I've finally come to the conclusion that the Jar Isolation mechanism posted in the documents does not work. Here's why:

      I've flipped the flag UseJbossWebLoader found in server\default\deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml to read:

      <attribute name="UseJBossWebLoader">false</attribute>
      


      I have two apps which require three of the same jar files. If both apps exist in the deploy directory at the same time and JBoss is restarted I get an array of LinkageError's and ClassCastException errors.

      However, if one single app containing the three redundant jar files is deployed alone. And if that app is navigated completly through. Then if the next app is deployed the applications work.

      This just leads me to believe that the isolation isn't handled correctly and that app2 is actually using classes from the app1 deployment.

      What do you think?


        • 1. Re: Jar Isolation Not Working

          I am facing the same problem. Is this thing working on Weblogic??

          • 2. Re: Jar Isolation Not Working
            wcydaip

            don't know. we don't use it.

            • 3. Re: Jar Isolation Not Working
              thoennes

              Which JBoss version are you using?

              I remember that I hit a bug related ordering of classloaders used (ie parent first etc) with JBoss 4.0.2.

              Maybe you could search JIRA whether your issue is already being tracked.

              Cheers, Jörg


              • 4. Re: Jar Isolation Not Working
                wcydaip

                Thanks for the suggestion. It looks like this still may be an issue with both 4.0.2 and 4.0.4.GA. Unless the problem is with my packaging and/or Manifest.mf CLASSPATH references. Anyone know of any resources which describe basic packaging procedures which allow ejb jar files and war files to communicate smoothly?

                Here's what I found searching on JIRA:
                http://www.jboss.org/index.html?module=bb&op=viewtopic&t=61036
                http://jira.jboss.com/jira/browse/JBAS-1549?vote=vote

                http://www.jboss.com/index.html?module=bb&op=viewtopic&t=80758
                http://jira.jboss.com/jira/browse/JBAS-3086?vote=vote

                After those readings I found I really hadn't setup my environment for full isolation. So after changing the server/default/deploy/ear-deploy.xml attribute's to read:

                 <attribute name="Isolated">true</attribute>
                 <attribute name="CallByValue">true</attribute>
                

                I realize this statement was incorrect on the initial post:

                However, if one single app containing the three redundant jar files is deployed alone. And if that app is navigated completly through. Then if the next app is deployed the applications work.

                Now I start getting the old ClassCastException and I'm guessing it's because of the isolation? Is this right?
                java.lang.ClassCastException
                 at com.security.delegate.SecurityAuthenticator.getSecurityAuthenticator(SecurityAuthenticator.java:104)
                 at com.security.delegate.SecurityAuthenticator.authenticate(SecurityAuthenticator.java:41)
                 at com.portal.action.LoginAction.execute(Unknown Source)
                 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
                

                Could anyone please comment on my current deployment?
                - .ear 1
                | --- application.xml
                | --- security-ejb.jar // shared by app 2
                | --- util-client.jar // shared by app 2
                | --- calendar-client.jar // shared by app 2
                | --- portal-main.jar
                | --- portal-ejb.jar // uses util-client.jar and portal-main.jar
                | --- portal.war // uses all shared libraries
                


                The application.xml just lists all the archives as their respective module. I have no classpath reference within the war archive or any of the others.

                App2.ear is setup almost identically only the portal is a reg app.

                Thanks alot,

                g

                • 5. Re: Jar Isolation Not Working
                  wcydaip

                  Anyone?

                  • 6. Re: Jar Isolation Not Working
                    genman

                    Wrong forum for one.

                    You should also try debugging classloading using advice from the Wiki.

                    • 7. Re: Jar Isolation Not Working
                      wcydaip

                      Thanks. Sorry 'bout the forum, seemed right at the time.

                      That http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration
                      reads abit clunky, but, makes sense after the hundreth time.

                      So, basically, you just need to add the meta-inf/jboss-app.xml to a deployment and at least the ear isolation is achieved.

                      <jboss-app>
                       <loader-repository>
                       myapp:loader=myapp.ear
                       </loader-repository>
                      </jboss-app>
                      


                      Thanks again, I was about to give up and fully resent the modules I created.