Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-11-05
6
Medium Priority
?
867 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 800 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 800 total points
ID: 17879860
It shouldn't be the classpath issue becoz u would be getting the "NoSuchClass" error otherwise.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Accepted Solution

by:
jaggernat earned 1200 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

886 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