aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Struts2 Null Pointer Exception at Session Scope Level Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Struts2 Null Pointer Exception at Session Scope Level" Watch "Struts2 Null Pointer Exception at Session Scope Level" New topic
Author

Struts2 Null Pointer Exception at Session Scope Level

Monica Salvador
Greenhorn

Joined: Feb 24, 2011
Posts: 23
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

Joined: Oct 27, 2005
Posts: 19720
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Don't get me started about those stupid light bulbs.
 
subject: Struts2 Null Pointer Exception at Session Scope Level