File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Obtaining MANIFEST.MF of an EAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Obtaining MANIFEST.MF of an EAR" Watch "Obtaining MANIFEST.MF of an EAR" New topic
Author

Obtaining MANIFEST.MF of an EAR

kobus de bruyn
Greenhorn

Joined: Jul 23, 2007
Posts: 1
Hi there,

I need to read the content of the MANIFEST.MF file inside my EAR from my servlet. How can I do this?

thanks
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by kobus de bruyn:
Hi there,

I need to read the content of the MANIFEST.MF file inside my EAR from my servlet. How can I do this?

thanks


Though never done this , but here is my best shot.
You can create java.util.JarFile pointing to the ear file and then try getMenifest() method.


Rahul Bhattacharjee
LinkedIn - Blog
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30894
    
158

Kobus,
Welcome to JavaRanch!

Note that an ear file does not have a Manifest.MF. The war file (containing the servlet) does. So it is really two levels in. What are you trying to accomplish by looking up the Manifest? Maybe there is an easier way.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
I think the EAR file also has a META-INF directory containing MENIFEST.MF file.I usually deploy my application ear in OC4J container and the EAR contains few other configuration files along with MENIFEST.MF file.

Even we add some custom entries in the MENIFEST.MF file.
Christoph Brill
Greenhorn

Joined: Aug 21, 2008
Posts: 1
Originally posted by Rahul Bhattacharjee:


Though never done this , but here is my best shot.
You can create java.util.JarFile pointing to the ear file and then try getMenifest() method.


I think this method is the only way to do it, but how do I point to the EAR file? I'm running in a JBoss and can't hardcode the path to the EAR :-(
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Obtaining MANIFEST.MF of an EAR