Re: java.lang.NullPointerException (Tomcat)
Original message from email@example.com (shaab mohagir) on Thu, 22
May 2003 19:12:44 -0700:
SM> The JavaBean code compiles and runs fine off line, I can connect to
SM> the DB I get my results correct and everything is smooth until I try
SM> to use the bean in a JSP page.
Have you made sure the driver is available within the context? (place it
in the correct directory of the WEB-INF)
SM> root cause
SM> at star.TAStatus.getCount(TAStatus.java:50)
This could be anything,
I don't know where line 50 it (:set nonu in vi points it at the return
If it did happen at the return rst.getString() then there must
be some message logged in your logfile if you have turned loggin on.
You should have rethrown the SQLException in the catch clause.
Since if the connection does not exist, your servlet will not detect it as
such, and you will get a NullPointerException instead.
Furthermore you are introducing a possible bug. You call
rst.next() but do not check on the return value, the servlet will probably
crash in such an event.
|All times are GMT. The time now is 05:31 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.