• 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: Servlet.service() NullPointer

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey everyone,

I am getting a really bizzare null pointer error, perhaps someone can point me in the right direction here.

this is my Register.action class execute() method:



It throws the error at dbIO.writeUser(...,...) line.



It craps out at the newConnection line, but I have no idea why it would (I've been using the connection code on other projects and it works fine).



Here's the full exception info thrown. I don't know enough about struts yet to figure out why it's doing this, so if anyone could give me a hand I'd much appreciate it.
I'm using the latest Tomcat 6.x build, and deploying with the newest Eclipse Ganymede release.

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't mention where in the newConnection method it bombs out, not that this is Struts-related at all.

(Not sure why you'd be using the old o.g.m.m.Driver classname, although I know it still works--it's been com.mysql.jdbc.Driver for years now.)
 
Sam Gardner
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, I figured it out. You are correct, it wasn't Struts at all - I saw all of the webworks stuff in the exception and assumed incorrectly.

Turns out I forgot to initialize my writer object - it's been a while since I've used java.

Thanks anyway for taking a look,

Sam
 
What are you doing? You are supposed to be reading this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic