Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Obtaining MANIFEST.MF of an EAR

 
kobus de bruyn
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34681
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :-(
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic