This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.NullPointerException on a jsp page

 
Ann Enzen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I m getting an error when I try to run the jsp below.


I get the following error when I run the page.





Please let me know the possible causes of this error.Thank You
 
Vicky Vijay
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your web descriptor file.

Provide your server details.. for further analysis
 
Ann Enzen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server details:Tomcat v7.0

web descriptor file is as shown below:
 
Stefan Evans
Bartender
Posts: 1721
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see anything obvious in the jsp you posted that would cause this.
In fact I don't see any java code at all in there, so a null pointer exception is quite difficult to create.

you did post the source of frameset.jsp right?
Is there a 'caused by' on this stack trace?
 
Ann Enzen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefen this is all we have. There is no 'caused by' in the error log and yes i did post the code for frameset.jsp

 
Stefan Evans
Bartender
Posts: 1721
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the only bit of JSP markup I see in that file is the directive at the top.
Everything else is template text.


Try removing this line. Does it work?

Are there any other errors in the Tomcat log? At startup maybe?

You're working with Tomcat, so check out the file [Tomcat]/work/Catalina/localhost/JasperCIS/org/apache/jsp/frameset_jsp.java (or something similar)
This is the Servlet file Tomcat generates from your JSP. Whats on line 22 that can create a null pointer exception?

 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The OP may want to try cleaning out unnecessary references in the form of jar files, this may cause it to give unexplained errors.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vic may be onto something. Sometimes the most inexplicable things can happen when the servlet or JSP jars are included in WEB-INF/lib. What jars have been placed there?
 
Ann Enzen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,there were unnecessary jar files in the WEB-INF/LIB as well as in the build path of the project.Once all this was cleaned it worked fine.There were jars such as jsp-api.jar,servlet-api.jar and many more such jar files which were not needed. Thank you all for your help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic