permaculture playing cards*
The moose likes Tomcat and the fly likes Strange null exception on Tomcat 6.0.18 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Strange null exception on Tomcat 6.0.18" Watch "Strange null exception on Tomcat 6.0.18" New topic

Strange null exception on Tomcat 6.0.18

Slawek Ch

Joined: Oct 16, 2008
Posts: 2
I have a big problem with removing attributes by Tomcat 6.0.18. This happens after migrating from Tomcat 5.5.23 (on this version there wasn't such error). Exception occur occasionally and for now I don't know how to resolve it. Below there is a stack trace from error:

Anyone know how to resolve it, please?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12756
Looking at the source code around line 1354 for Tomcat 6.0.18 we find:

Looks like if context is null you get an NPE

Around line 500 there are setContext and getContext methods - this is the normal javax.servlet.ServletContext we are talking about.

To further track this down, you might try calling the request getContext method to see if it is null before calling the removeAtribute method.

Slawek Ch

Joined: Oct 16, 2008
Posts: 2
Now I'm using Tomcat 6.0.9 problem doesn't occur. It happens only from version 6.0.10 or higher. Maybe it is Tomcat new bug.

Anyway thanks for suggestion.
subject: Strange null exception on Tomcat 6.0.18
Similar Threads
Exception in PhaseListener RESTORE_VIEW 1 afterPhase
java.sql.BatchUpdateException: IO Error: Socket read timed out error
Apache Tomcat error... org.apache.catalina.core.StandardWrapperValve invoke .. Help Please
Not able to access Session Bean in Seam Framework
org.springframework.beans.factory.NoSuchBeanDefinitionException No bean named