Ant: need help packing EJB and its dependencies in EAR

My goal is pretty simple: use ant to create an EAR that contains 1 EJB and 1 jar containing all the dependencies. This jar, called common.jar for example, contains the provider jar files in it, as well as other xml files that EJB depends on, and they will need to be seen at runtime.

So far I have packed everything correctly as an EAR, like this:

EARFILE.ear
 -EJBFILE.jar
   /META-INF
     -MANIFEST.MF
 -common.jar
   /META-INF
     -MANIFEST.MF
   /lib
     -(all vendor jars inside here)
   -(All the xml config files are inside the root of the common.jar)

Inside MANIFEST.MF for EJBFILE.jar there is ...

Class-path: ../../common.jar

Inside MANIFEST.MF for common.jar there is ...

Class-path: ../lib/some_common.jar

, (websphere) JAR . ClassDefNotFoundError, EJB JAR , . , common.jar , , EJB , - classpath javac.

, :

  • Vendor.
  • EJB xml ? , xml EJB , EAR, , EAR.
  • websphere? , , , MANIFEST.MF.
+3
1

, , .

  • , appxml Ant ear, ( named application.xml); JAR , .
  • JAR JAR - EAR , EJBFILE.jar
  • XML EJBFILE.jar (, config), /config/filename.xml.

application.xml WebSphere, JAR. , , JBoss .

, ( EAR) XML , .

+1

Source: https://habr.com/ru/post/1759241/


All Articles