1 Reply Latest reply on Dec 1, 2005 3:01 AM by Bernard de Terwangne

    Confirm Proper Way to Deploy Dependent Jar Files in EAR

    Jeremy T Newbie

      Hello. I'm using JBoss 4.0.3SP1 and would like to determine the correct way (preferrably J2EE compliant) to bundle dependent jar files within an EAR file. I've checked the forum, but did not find the answer.

      Specifically, I have an EJB jar file that has dependencies on 3-rd party jars.

      Is modifying the application.xml file within the EAR and using

      <module><java>my-3rd-party.jar</java></module>


      correct? Thanks in advance!

        • 1. Re: Confirm Proper Way to Deploy Dependent Jar Files in EAR
          Bernard de Terwangne Newbie

           

          Hello. I'm using JBoss 4.0.3SP1 and would like to determine the correct way (preferrably J2EE compliant) to bundle dependent jar files within an EAR file. I've checked the forum, but did not find the answer.


          Up to my understanding, there is 2 options :

          1. Either referencing your utility jars from the Class-Path attribute of your MANIFEST.MF file (the one of the module, either EJB or WAR, that requires classes from the utility jar).

          eg:

          Class-Path: mylib.jar
          

          2. Or add the utility jars as java module in application.xml

          eg:

          <module><java>mylib.jar</java></module>


          Option 1 is portable. It should work on any App server. Option 2 is JBoss specific. It might work on other app servers, but is not something specified by J2EE.

          Option 1 is perfect as long as you ar doing packaged deployment. It will also be good enough if you are doing exploded EAR deployment on a non Windows box.

          Option 2 is the only workable option (up to my knowledge) if you are working with JBoss, running on Windows and want to do Exploded EAR deployment in a development environment (that is you want to be able to change and redeploy things without restarting the app server all the time).

          Bernard