[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

why this error is coming org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:253) - Servlet.service() for servlet action threw exception

Posted on 2011-05-08
28
Medium Priority
?
1,678 Views
Last Modified: 2012-05-11
why this error is coming org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:253) - Servlet.service() for servlet action threw exception
0
Comment
  • 10
  • 10
  • 8
28 Comments
 
LVL 92

Expert Comment

by:objects
ID: 35717792
because an unhandled exception is being thrown while processing a request
check your logs for the details of the exception
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35717803
You probably want to post more of the stack trace, it just says there is error
in Servlet.service():

http://stackoverflow.com/questions/2322031/severe-servlet-service-for-servlet-jsp-threw-exception

More specific information will help
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35717812
look at the bottom of this page, which I posted above, they give some examples of the siuations which caused
similar error:

http://stackoverflow.com/questions/2322031/severe-servlet-service-for-servlet-jsp-threw-exception
0
Independent Software Vendors: 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 20

Author Comment

by:Sathish David Kumar N
ID: 35718007
>>>>because an unhandled exception is being thrown while processing a request
check your logs for the details of the exception

unhandle means .. i put all java try catch ... then how it will be handle exectipion .

for_yan i am checking the link
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35718055
this both error are occur continously

org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) - Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException

04 May 2011 13:45:48 [80-Processor114] ERROR      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:253) - Servlet.service() for servlet action threw exception
java.lang.NullPointerException
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35718064
If this is your servlet add

exception.printStackTrace()

where you catch exceptions in your code
and it will print to catalina.out full stack tracce including the line
wher exceptiion occurred - you'll be able to track the error
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35718066
You are probably using some varaibale without its prior intilization,
say didn't initialize array or not created arraylist but trying to access it - something
 like that , but cathch this exception adn printStackTrace() - you'll know the exact line
0
 
LVL 92

Expert Comment

by:objects
ID: 35718107
have you checked the logs yet?  They will contain details of the cause of the exception
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35718174
>>>>>>have you checked the logs yet?  They will contain details of the cause of the exception
This is the line which i take from log file . its have this much only not full trace .
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35718176
yan i am not getting your point .
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 400 total points
ID: 35718200
If you didn't see any useful information in your log file and
it is your serlet and your code is running
you can probably guess what part of the code is throwing
thsi error - first look at it - maybe you'll guess
nullpointer happens when you try to use object or array
which you forgot to initialize - so you are using array before initialization or ArrayList
or execute method on the object which was declared but not yet created with constructore

If you don't see it wiith your eyes try to put

try{
//your big chunk of the code where you think it happens

}catch (Exception ex){
System.out.println(ex.toString());
ex.printStackTrace()
}

then in catalina.out you'll see the line of your code which thows thsi exception
 
Of course be careful when you addbrraces wome
vbaraible may go out of scope - compiler will prompt you to take care of it
by declaring them outside braces

 
0
 
LVL 92

Expert Comment

by:objects
ID: 35718290
> This is the line which i take from log file . its have this much only not full trace .

your looking in the wrong log by the sound of it, check the localhost logs
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35718435
As you are riunning Tomcat on version 6 I have all exceptions in the file logs/catalina.out
inside Tomcat's home directory
0
 
LVL 92

Expert Comment

by:objects
ID: 35718844
> unhandle means .. i put all java try catch ... then how it will be handle exectipion .

you don't want to be catching it, its caused by an error in your code. you need to find it and fix it instead
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35718859
>>>>>>your looking in the wrong log by the sound of it, check the localhost logs
you means tomcat log
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35718869
You need to fix it no questuion about it, but if you cannot at all see
where it is than exception.pintStackTrace() will help you to fin the line
where it happens
0
 
LVL 92

Expert Comment

by:objects
ID: 35718872
yes tomcats localhost logs
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35719413
>>you don't want to be catching it, its caused by an error in your code. you need to find it and fix it instead
How to find that with out try ,catch .
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35719441
Don't worry, put try catch, you can always remove them later,
but they don't bring any bad

If it is not very long code look - maybe you'll find.
If long put try catch in the appropriate plaec adn it will give you the line
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35719453
yan

its in production so i am not able to do that !! (exception.printStackTrace())
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35719463
Then try to look at the code - if you cannot change that's the only way.

It is probably smowe null object  wher you try to access iits method, or as I said above

Still do you see anything in the log as it is?
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35719705
SEVERE: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
	at org.apache.log4j.helpers.PatternConverter.spacePad(PatternConverter.java:106)
	at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:79)
	at org.apache.log4j.PatternLayout.format(PatternLayout.java:503)
	at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301)
	at org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:234)
	at org.apache.log4j.WriterAppender.append(WriterAppender.java:159)
	at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
	at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
	at org.apache.log4j.Category.callAppenders(Category.java:203)
	at org.apache.log4j.Category.forcedLog(Category.java:388)
	at org.apache.log4j.Category.log(Category.java:853)
	at org.apache.commons.logging.impl.Log4JLogger.info(Log4JLogger.java:133)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:108)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Unknown Source)

Open in new window

0
 
LVL 47

Expert Comment

by:for_yan
ID: 35719831
Looks like the issue linked to logging. Maybe you could change some logging conditions without chnaging the code. That is of course just a guess
0
 
LVL 92

Accepted Solution

by:
objects earned 1600 total points
ID: 35725028
Thats a classloader issue, try moving log4j to common/lib (or server/lib). Also check you don't have multiple versions of the log4j jar available to your webapp
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35728662
shall i remove from application /lib ?
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35729287
then what is the difference between application/lib and server lib or common/lib
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1600 total points
ID: 35733534
> shall i remove from application /lib ?

application lib jars are only available to that app
common jars are available to all apps
0
 
LVL 92

Expert Comment

by:objects
ID: 35733542
yes remove it from application
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month19 days, 14 hours left to enroll

872 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