• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 Null Pointer Exception at Session Scope Level

 
Monica Salvador
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with my struts2 action. It says that I have a null session scope attribute when it's printing out the code fine.. Here's where the code gets the error (this is actually line 48)..



Here's the output on the Server Log..



But after printing out the output, here's the error I get...



WTH's goin on with Java?
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you check out that stack trace, you see that the top level exception is a JSONException (line 2). That's caused by an InvocationTargetException (line 70). That in turn is caused by a NullPointerException (line 77). That's what you should focus on.

This tells you that the NullPointerException is thrown by method execute of class com.cashmate.struts.Release_EditVouchers, on line 48 of file Release_EditVouchers.java. That's now the number one piece of code to focus on. Why don't you post that line here; if it's not too long the entire execute method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic