Discussion:
Manifest problem in nested jars
(too old to reply)
Jakkaro Jakkaro
2005-01-12 11:39:09 UTC
Permalink
I ve created an enterprise archive file ( APP.ear ) which contains all EJB's and WAR's etc.

I also put in my APP.ear's manifest.mf file some application specific information (such as app-name=app-value).

I wonder now how can my EJB's, WAR's, code... read this values?

Shall I care about weblogic classloaders? is there any standard way? I want to keep my APP.ear 'clean' from absolut pathes and stuff that limit its portability.

APP.ear
+-- META-INF/manifest.mf
+-- OtherJAR.jar (code here wants to read manifest above)

Thanks for your time.
pradeep tiwari
2005-01-12 19:36:01 UTC
Permalink
Hi,
Manifest.mf file contains meta information about application .So your application can't read this information.If you want to store your own informatin tou should use any text file and and your aplication can read values from this file.For more details you can go through the following link
http://java.sun.com/docs/books/tutorial/jar/basics/manifest.html
Pradeep
Rob Woollen
2005-01-13 00:30:43 UTC
Permalink
While you could use the manifest for this, I wouldn't recommend it.

instead add a directory in your ear named resources (or whatever you
want to call it).

In your OtherJar.jar add a manifest class-path entry to ../resources

In resources, include your configuration files, perhaps my.xml

In your code, you can do
getClass().getClassLoader().getResourceAsStream("my.xml");

-- Rob
Post by Jakkaro Jakkaro
I ve created an enterprise archive file ( APP.ear ) which contains all EJB's and WAR's etc.
I also put in my APP.ear's manifest.mf file some application specific information (such as app-name=app-value).
I wonder now how can my EJB's, WAR's, code... read this values?
Shall I care about weblogic classloaders? is there any standard way? I want to keep my APP.ear 'clean' from absolut pathes and stuff that limit its portability.
APP.ear
+-- META-INF/manifest.mf
+-- OtherJAR.jar (code here wants to read manifest above)
Thanks for your time.
Loading...