• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Struts2 Null Pointer Exception at Session Scope Level

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 22857
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic