Solved

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

Posted on 2006-11-05
6
822 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
J2SE 5.0 metadata 1 61
iterator example remove 8 75
runtime exception and error differences 4 84
listing all functions in JavaScript 19 216
Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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