Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2: Servlet.service() NullPointer

 
Sam Gardner
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • 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.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic