4 Replies Latest reply on Apr 3, 2009 4:07 AM by bdt

    What's the best way to package utility jars in exploded depl

      Well I have quite a complex app to develop and I'd like to use exploded ear deployment during development.

      I've been using Class-Path entry in MANIFEST.MF file and it works absolutly fine for packaged deployment.

      When your server is running Windows (not Unix/Linux) and you come to exploded deployment, you face a problem explained here : http://jira.jboss.com/jira/browse/JBAS-2434

      The utility jars referenced in a MANIFEST.MF are locked by the classloader and you have no chance of redeploying or changing the utility jar without stopping the JBoss server (which is not exactly the way I want to work).

      So well I can accept that the cause of the problem is a Sun bug, but I was looking for a way to work it out. Other App servers like WebLogic provide specific APP-INF/lib thing to manage this problem, but I'd like first to stay general and second to keep JBoss as app server.

      I have found a nasty way to do it but I hope there is better. My nasty solution is not to place utility jars in the MANIFEST.MF file but rather reference them in application.xml as ejb modules. The EJB3 deployer opens them despereatly looking for EJB's but it works fine. It gives no error and everything is works alright. The files don't get locked and hot deployment works.

      Has anybody found another (les awful) solution to this problem ?

      Thanks

      Bernard

        • 1. Re: What's the best way to package utility jars in exploded

          Well I found myself something already better. Using java module instead of ejb module works fine with JBoss. So im my application.xml file I put something like


          mylib.jar


          If I understand this method is not portable but anyway, at least it works and does not lock the jars.

          • 2. Re: What's the best way to package utility jars in exploded
            jtorres

            Is it possible for you to post your META-INF/manifest.mf for your EJB jar to see how you have the Class-Path entry setup?

            I posted a question http://www.jboss.com/index.html?module=bb&op=viewtopic&t=73214 about a standard way of deploying the EAR with dependent "utility" jars and was hoping to seee your example.

            • 3. Re: What's the best way to package utility jars in exploded
              mikemil

              Hi,

              I am running into this exact problem except that I need to be able to support both Weblogic and JBoss. For years we've been supporting Weblogic using the manifest Class-Path option. Now we've added support for JBoss (on both Windows and Linux) in an exploded folder deployment.

              I am in the process of trying to run the tests on Linux. As far as Windows is concerned, it is broken. I can fix it by moving the entries out of manifest Class-Path and into the application.xml as java modules BUT unfortunately this break Weblogic!!!

              I'd really like to keep our deployments consistent across the board for the app server and the OSs being used.

              • 4. Re: What's the best way to package utility jars in exploded

                mikemil,

                In the mean time, the EJB spec has included a portable solution to this problem. JBoss 4.2.x is compatible with this new standard. Just put your jars in your.ear/lib

                It is a bit like putting jars in yourapp.war/WEB-INF/lib except that they are loaded in the class loader of the ear. You will find more info googling.

                Bernard