Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts2: Servlet.service() NullPointer

 
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.

 
Author
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
    Bookmark Topic Watch Topic
  • New Topic