the Class-Path must contain .jar files, nothing else. Every jar listed in the Class-Path will then be ignored by the deployer (even if there is a deployment descriptor in its META-INF).
To achieve what you wanted to do, put the shared classes in a jar file. Then you have to build a ear with this jar in and your war. Add the jar file to the Class-Path of your manifest.mf in your war.
You should take a look at the J2EE spec, chapter 8 deployment and assembly.
thanks for your answer.
My file.war file can't be included in file.ear, because it's an optionnal module.
So, I've put in file.war the class from the ear it needs.
The trouble is that now i've got this exception :
java.lang.LinkageError: loader constraints violated when linking myClass class.
I think that it means i cannot load myClass.class twice : one by file.war and one by file.ear
What can i do ? How can i resolve my trouble ?
Try putting the shared classes in a jar and in server/default/lib or whatever appropriate instance library? Best approach if it is shared amongst applications.
I have similar problem with classpath ...
I have application which has some ejb modules. My EAR file looks like:
I need to have file: config.properties in ejb-module.jar classpath (there is configuration of a module).
When I use WLS or OC4J, I add "Class-Path: config" entry to ejb-module.jar manifest.mf file and in my Config service I access file using getResourceAsStream("/config.properties") method, it works fine.
Unfortunatelly in JBoss 3.2.1 I get following worning messages:
18:22:26,102 WARN [MainDeployer] The manifest entry in file:/C:/jboss/server/default/tmp/deploy/ser
ver/default/deploy/wms.ear/51.wms.ear-contents/mdb-ejb.jar references URL file:/C:/jboss/server/defa
ult/tmp/deploy/server/default/deploy/wms.ear/51.wms.ear-contents/config which could not be opened, entry ignored
Is there any other solution for it?
As I understand Manifest.mf Class-Path entry should only contain references to jars. How can I read configuration from property file?
As I mentioned before I use JBoss 3.2.1. How can I deploy my application using EXPLODED directory format. When I unpack EAR and all modules, change application.xml module entries pointing to directory (module) instead of jars/wars
I read that all I need is to unpack EAE ant its modules into JBoss's deploy directory ant everything will be ok.
It does not work!
Am I doing something wrong?
How can deploy application using Exploded directory format?
try this, as it works for me:
1. put your dependency libs in your ear
2. each lib has to be listed in your application.xml like this for xerces:
3. each .jar (ejb) or .war (or whatever) MUST have an entry in its Class-Path of the manifest.mf like this:
4. use the entry shown above in your jboss-app.xml to use a new loader repository for your ear
That's all. More info about this in the J2EE spec (Chapter 8, Assembly and Deployment) and the JBoss doco (look at sourceforge, the ClassLoader issue).