> Re: java.lang.NullPointerException (Tomcat)
Re: java.lang.NullPointerException (Tomcat)
Dhek Bhun Kho
Original message from
(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.
Dhek Bhun Kho
struts tag inside a tag
error 500 with out.println method in tomcat 4.1 jsp
Show Printable Version
Email this Page
post new threads
edit your posts
HTML code is
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc..
SEO by vBSEO ©2010, Crawlability, Inc.