• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 22785
131
Eclipse IDE Spring VI Editor 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.
 
I think she's lovely. It's this tiny ad that called her crazy:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic