Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-11-05
6
Medium Priority
?
856 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

704 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