I have an old J2EE application (J2EE 1.3), which packages into an EAR, and in the EAR, there are WARs and EJB JARs. Now one of the EJB JARs needs to refer to some 3rd party library JARs, so what's the best place to package those JARs and how?
In the Project Explorer view of the Java™ EE perspective, select File > Import. Under Select an import source, click EJB > EJB JAR file and click Next. In the EJB JAR file field, enter the location and name of the EJB JAR file that you want to import.
Advertisements. Requirement of Packaging applications using EJB 3.0 are similar to that of J2EE platform. EJB components are packaged into modules as jar files and are packaged into application enterprise archive as ear file. There are majorly three components of any enterprise application −
An EJB JAR file is portable and can be used for various applications. To assemble a Java EE application, package one or more modules, such as EJB JAR files, into an EAR file, the archive file that holds the application.
They go in the ear file, at the root or you can create a lib directory to store them. Any project (EJB or WAR) that needs to reference them must include them in the Class-Path: of the manifest file.
Ear contents
- log4j.jar
- lib
- commons-lang.jar
- MyEJBProj.jar
- MyWAR.war
MyEJBProj contents
- classes
- META-INF
- MANIFEST.MF
MANIFEST.MF
Manifest-Version: 1.0
Class-Path: log4j.jar lib/commons-lang.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With