1 Reply Latest reply on Sep 18, 2006 3:47 PM by Y C

    New wiki for sharing libs in an EAR?

    John Blackmore Newbie

      Following a long weekend of getting started with EJB3.0, I spent a while trying to figure out how to share libs across modules in the EAR. I know from searching that this topic has been beaten to death in other forums, but there are new options in Java EE 5 that either haven't been discussed or eluded my search. It seems to be a common source of confusion for J2EE (er, JEE?) developers, especially those just getting started.

      I'd like to propose a new Wiki for sharing libs in an EAR, and naturally, I'll volunteer to write it. I found the info I needed eventually, but the existing classloading wikis are a bit overwhelming, and I sense the community would benefit from a concise reference for this simple, common task. According to the latest proposed final draft of Java EE Spec., v5, we should have the following options for accessing shared libraries in an EAR file:


      1. Class-Path header in the referencing JAR's manifest file.

      2. A .ear file may contain a directory that contains libraries packaged in JAR files. The library-directory element of the .ear file?s deployment descriptor contains the name of this directory. If a library-directory element isn?t specified... the directory named lib is used... All files in this directory (but not subdirectories) with a .jar extension must be made available to all components packaged in the EAR file.

      3. A web application may include libraries in the WEB-INF/lib directory.

      I couldn't get the first two options to work, however I resolved my classloading problems by adding
      <module><java>lib/mylib.jar</java></module>
      to my application.xml.

      First, is anyone against a new Wiki for this information? If not, I'd welcome guidance, suggestions, references, links, etc.

      Second, has the library-directory option been implemented, as of RC3?

      Regards,