aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Manifest file not working in J2EE project? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Manifest file not working in J2EE project?" Watch "Manifest file not working in J2EE project?" New topic
Author

Manifest file not working in J2EE project?

Kevin Cheong
Greenhorn

Joined: May 17, 2006
Posts: 10
I have a problem with my project. I have an EAR file with a few jars in it.
a.jar, b.jar, c.jar.

a.jar has the logging classes and uses log4j. Therefore a.jar has a manifest file with log4j in its class path.

The final EAR file has in its root:
a.jar
b.jar
c.jar
log4j

b.jar references a.jar. I get NoClassDefFound log4j errors due to the Category class. Basically, it can't find the log4j jar even though its specified in the manifest. Strangest thing is it works in all of my servers but not on one of them. Is there some configuration problem I have that is problematic in that one server? I tried adding log4j explicitly to the server startup classpath, and it works. However, that's not a long term solution.

Its as though the manifest file of a.jar is not being read in correctly. I think I have the projects organized correctly... Any help or suggestions would really help.
naveen gupta
Ranch Hand

Joined: Apr 12, 2006
Posts: 129
Manifest file has many rules as per i know

after the last line, press enter for extra line
case sesitive
it gives error even if small space is extra

search google for all it's rules
Kevin Cheong
Greenhorn

Joined: May 17, 2006
Posts: 10
Thanks. I have Websphere building the manifest file initially and later on Ant modifies it with some version info. If the manifest file is invalid, it probably shouldn't work for the other servers as well. I'm thinking it should have something to do with the server. Is there a possibility that the Application Server (I'm using WAS) is 'corrupt' and not processing the manifest file?
naveen gupta
Ranch Hand

Joined: Apr 12, 2006
Posts: 129
i really doubt of application server being corrupt

If you are sure, what your are doing is correct, then i would say, do it all over again from the begining, you might have missed something
Kevin Cheong
Greenhorn

Joined: May 17, 2006
Posts: 10
I would but its not as easy as that.. We have everything automated by Ant. It used to work on the server that does not presently though. My colleague tried to make a mod just before this problem though. WAS actually extracts the EAR that you deploy and places it somewhere in the WAS directory. My colleague tried replacing a utility jar in that EAR and everything suddenly blowed up. I've double checked and triple checked the classpaths and settings across all servers and I can't find anything drastically different that will cause the problems. We're going to decide what to do next. Meanwhile if you have any other suggestions on what I should do, I would be glad to hear it!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Manifest file not working in J2EE project?