File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.VerifyError Error for Log4j

 
Rahul Kappor
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting following error on the following statement in my servlet
PropertyConfigurator.configure(log4j_property_file_path)

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
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Rahul Kappor
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20160
23
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks
Harman

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic