wood burning stoves*
The moose likes Beginning Java and the fly likes utterly stumped - NPE thrown when calling a method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "utterly stumped - NPE thrown when calling a method" Watch "utterly stumped - NPE thrown when calling a method" New topic
Author

utterly stumped - NPE thrown when calling a method

Stuart Rogers
Ranch Hand

Joined: Oct 02, 2008
Posts: 133
greetings all,

Eclipse/Hibernate/MySQL on WinXP

I've written a stand-alone app that reads from numerous files and creates lots of objects that get populated into tables.
I run this app within Eclipse.

It all works great up until the app calls a particular method ( a DAO method to be precise), which throws an NPE immediately.
It doesn't even enter the method - I've tried replacing the method's guts with a single print statement and return null. And I've
Placing the offending call within a try/catch block and printing the stack trace isn't much help, it just shows NPE. Commenting out
the call to the offending method and the app runs to completion w/o error - but of course at the price of not loading one of my tables.

the call


and the method itself


Any ideas? I fear the loss of the rest of my hair over this nuttiness.


TIA,


Still-learning Stuart
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
Is the cteProgramDAO object reference null?


Ping & DNS - my free Android networking tools app
Stuart Rogers
Ranch Hand

Joined: Oct 02, 2008
Posts: 133
==DOH!!!==

I declared an instance of CteProgramDAO but never instantiated it.

HATS OFF TO ULF!! You da MAN!!

CASE CLOSED


Still-learning Stuart ( whose learned not to try to program at 02:00 local time )
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Yes, Ulf da man
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: utterly stumped - NPE thrown when calling a method
 
Similar Threads
Map Problem
Confused for threading ?
static methods and NULL
references and objects
utterly stumped - HQL query stalls program