Solved

JSP + Struts: Error 9 java.lang.NoSuchFieldError:  org.apache.log4j.Priority.INFO)

Posted on 2006-11-05
6
809 Views
Last Modified: 2010-05-18
I need to create jsp page using struts

First i follow the below link
http://www.oracle.com/technology/obe/obe9051jdev/strutsvalidator/validator.htm#o

But when i run i got the following error.

500 Internal Server Error

java.lang.NoSuchFieldError:  org.apache.log4j.Priority.INFO  <=== i got no idea where to cause this problem

      at org.apache.commons.logging.impl.Log4JLogger.info(Log4JLogger.java:152)
      at org.apache.struts.util.PropertyMessageResources.<init>(PropertyMessageResources.java:127)
      at org.apache.struts.util.PropertyMessageResourcesFactory.createResources(PropertyMessageResourcesFactory.java:90)
      at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:577)
      at org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
      at org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)

Please help urgent

0
Comment
Question by:LeanMoreTryMore
6 Comments
 
LVL 10

Assisted Solution

by:kupra1
kupra1 earned 200 total points
ID: 17879777
Since "NoSuchFieldError" is coming, you are getting the 500 error.
The reason being is that you are probably using the log4j 1.3 instead of 1.2.

log4j1.3 doesn't extend Priority. Hence, it doesn't find the field "INFO" and throws the "NoSuchFieldError".

To avoid this, you should use log4j1.2.*.
0
 
LVL 8

Expert Comment

by:reach2piyush
ID: 17879780
Make sure you have both log4j.jar and commons-logging.jar in your classpath
0
 
LVL 10

Assisted Solution

by:kupra1
kupra1 earned 200 total points
ID: 17879860
It shouldn't be the classpath issue becoz u would be getting the "NoSuchClass" error otherwise.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 10

Accepted Solution

by:
jaggernat earned 300 total points
ID: 17881024
Make sure your log4j.properties is set correctly.

log4j.properties file  should be  like this :

log4j.rootLogger=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n
log4j.logger.httpclient.wire.header=DEBUG
log4j.logger.org.apache.commons.httpclient=DEBUG
0
 

Author Comment

by:LeanMoreTryMore
ID: 17902403
it works.
that's exactly the problem is.

MANY THANKS
0
 
LVL 10

Expert Comment

by:jaggernat
ID: 17902598
u r welcome
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now