1 Reply Latest reply on Jan 13, 2006 11:42 AM by bertrand xxxx

    Building and Packaging

    Matthew Hibberd Newbie

      I am building a simple Enterprise Application and have managed to package everything into a EAR file and deploy to JBOSS.

      Now I have created another project, whose classes are both used by both EJB and WEB tiers. I am looking for the best way to package all this up into an EAR (if this is the best way). The only way I have got things working so far is by packaging this external project into another jar and adding it to the default server lib directort, which im quite sure is wrong.

      Can anyone suggest a cleaner/proper way of doing this? or at least point me to some examples/docs that will explain how this should be done?


        • 1. Re: Building and Packaging
          bertrand xxxx Newbie

          A solution might be to add your jar file directly into to your ear.
          Then each module (EJB,WEB,...) using this library must have its classpath modified to reference this library. This can be done in the MANIFEST file of each module.

          Example of configuration:

          bertou$ jar xvf MyApp.ear
          created: META-INF/
          extracted: META-INF/MANIFEST.MF
          extracted: META-INF/application.xml
          created: lib/
          extracted: lib/MyLib.jar
          extracted: MyEJB.jar

          bertou$ jar xvf lib/MyEJB.jar
          created: META-INF/
          extracted: META-INF/MANIFEST.MF
          extracted: META-INF/ejb-jar.xml
          extracted: META-INF/jboss.xml
          created: mypkg/
          extracted: mypkg/myhome.class
          extracted: mypkg/mybean.class
          extracted: mypkg/my.class

          bertou$ cat META-INF/MANIFEST.MF
          Manifest-Version: 1.0
          Ant-Version: Apache Ant 1.6.2
          Created-By: 1.4.2_04-b04 (Sun Microsystems Inc.)
          Class-Path: ./lib/MyLib.jar