tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19075] New: - ResultSet returned is not null but next() on such ResultSet throws java.lang.NullPointerException
Date Wed, 16 Apr 2003 15:37:09 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19075>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19075

ResultSet returned is not null but next() on such ResultSet throws java.lang.NullPointerException

           Summary: ResultSet returned is not null but next() on such
                    ResultSet throws java.lang.NullPointerException
           Product: Tomcat 4
           Version: 4.1.24
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: jakubd@metrosoft.com


Here is the simplified code:

stmt.execute(sql);
ResultSet rs = stmt.getResultSet();
if (rs!=null)
{
if (rs.next())
{
...
}
}

It happens that NullPointerException is thrown inside ResultSet next(), inspite 
it is not null.
"sql" which is a String contains stored procedure with parameters. It may 
return update counts.
According to java documentation getResultSet in case when there is update count 
or there are no more results should return null.
It seems to me that in DelegatingResultSet.java 
_res is null.
Here is code from DelegatingResultSet.java:
    public boolean next()
        throws SQLException
    {
        return _res.next();
    }



Here is stack:

java.lang.NullPointerException
	at org.apache.commons.dbcp.DelegatingResultSet.next
(DelegatingResultSet.java:135)
	at com.metrosoft.iq.IQManager.save(IQManager.java:493)
	at com.metrosoft.iq.IQManager.save(IQManager.java:425)
	at org.apache.jsp.handle_request_new_jsp._jspService
(handle_request_new_jsp.java:184)
	at com.metrosoft.servlets.jsp.JspLoggingPage.service
(JspLoggingPage.java:80)
	at org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:210)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:256)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:191)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2415)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:171)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:172)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
	at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNex
t(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service
(CoyoteAdapter.java:223)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:594)
	at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnectio
n(Http11Protocol.java:392)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:565)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:484)

It happens also on 4.1.18, but tt was working fine on Apache Tomcat version 
4.0.4

best regards
Jakub Dudek

Jakub Dudek, IT developer
Microsoft Certified Professional
Metrosoft Polska
email:jakubd@metrosoft.com
email:jdudek@elf.ii.uj.edu.pl
www.metrosoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message