wood burning stoves
The moose likes Other Open Source Projects and the fly likes java.lang.VerifyError Error for Log4j Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "java.lang.VerifyError Error for Log4j" Watch "java.lang.VerifyError Error for Log4j" New topic

java.lang.VerifyError Error for Log4j

Rahul Kappor

Joined: Nov 10, 2007
Posts: 12
I am getting following error on the following statement in my servlet

I have log4j.jar in directory java\classes and WEB-INF\lib. Both are the same files and I have verified this by size of the and number of files in each jar. This error is generated occasionally when window server is rebooted which in turn restart the application server. Servlet which is using above code is set to load on start using load-on-startup tag. Could anyone have any idea why I am getting this error and as I mentioned it does not happen all the time but once a while.

java.lang.VerifyError: (class: org/apache/log4j/Hierarchy, method: updateChildren signature: (Lorg/apache/log4j/ProvisionNode;Lorg/apache/log4j/Logger;)V) Bad type in putfield/putstatic
at org.apache.log4j.LogManager.<clinit>(LogManager.java:69)
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:315)
at gov.ca.aoc.vision.struts.base.VisionInitServlet.init(VisionInitServlet.java:40)
at com.sybase.jaguar.servlet.JagServlet.init(JagServlet.java:235)
at com.sybase.jaguar.servlet.ServletPool.createInitializedInstance(ServletPool.java:180)
at com.sybase.jaguar.servlet.ServletPool.getInstance(ServletPool.java:72)
at com.sybase.jaguar.servlet.ServletPool.start(ServletPool.java:292)
at com.sybase.jaguar.servlet.JagServletContext.startServlet(JagServletContext.java:2856)
at com.sybase.jaguar.servlet.JagServletContext.startWebAppServlets(JagServletContext.java:2491)
at com.sybase.jaguar.servlet.ServletEngine.startWebAppServlets(ServletEngine.java:1137)
at com.sybase.jaguar.servlet.ServletServiceImpl.startWebAppServlets(ServletServiceImpl.java:173)
at com.sybase.jaguar.servlet._sk_JaguarServlet_ServletService.remoteInvoke(_sk_JaguarServlet_ServletService.java:547)
at com.sybase.jaguar.servlet._sk_JaguarServlet_ServletService.invoke(_sk_JaguarServlet_ServletService.java:125)
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

This might be occurring because you have the two copies of log4j.jar, try having only one (the one in the WEB-INF\lib directory)

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Rahul Kappor

Joined: Nov 10, 2007
Posts: 12
Thanks Martijn for the response.

Can I keep the log4j.jar in java\classes and delete the one WEB-INF\lib. Does it matter which one I keep.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

In a web application, dependent jars are supposed to be put in the WEB-INF/lib folder. But web applications don't have a java/classes folder so it's unclear what that's about.
Rahul Kappor

Joined: Nov 10, 2007
Posts: 12
I am using EA Server as application server and it comes with log4j.jar in EA_Server_Home/java/classes folder. I believe most of J2EE servers have java/classes and java/lib folder which are used to have jar file at server level instead at individual web application level. So my question was Can I keep the log4j.jar file in EA_Server_Home/java/classes and delete from webapplication/WEB-INF/lib.


I agree. Here's the link: http://aspose.com/file-tools
subject: java.lang.VerifyError Error for Log4j
It's not a secret anymore!