Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NullPointerException

Status
Not open for further replies.

scohan

Programmer
Dec 29, 2000
283
US
Ok, how do I g about determining what is causing a NullPointerException in my jsp page? The page contains a form that gets submitted, but I can't figure out how to determine what bombs out. I setup an error page, but that's not real helpful.

Here's the top of the stack trace:

java.lang.NullPointerException at pagecompile.jsp._godev._maint._maint__series._jspService(Compiled Code)


Stumped. :-(
 
Also, the url of the form action is the same jsp page. I'm guessing I'm reusing something that has not been properly reinitialized. Any clues would be most welcome.
 
It seems the error has to do with a resultset that I use. If I comment all references from the rs.next on, I don't get the NullPointerException. Even if I leave just the rs.next in there (actually its a while (rs4.next()) ), I get the NullPointerException. I've defined the rs as:

<%!String dbURL;
Connection dbCon=null;
Statement stmt=null;
ResultSet rs4=null;
String password=null;
%>

<% Class.forName(&quot;oracle.jdbc.driver.OracleDriver&quot;);
try {
dbCon=DriverManager.getConnection(&quot;jdbc:eek:racle:thin:uid/pw@beta:1521:lroldev&quot;);
}
catch (SQLException e) {
dbCon=DriverManager.getConnection(&quot;jdbc:eek:racle:thin:uid/pw@beta:1521:lrol&quot;);
}
stmt=dbCon.createStatement();

CallableStatement call = null;
rs=null;
int rtnval;

call =
dbCon.prepareCall (&quot;{ call pkgmnt_product.spmnt_collect_tc_products (?, ?, ?, ?)}&quot;);
call.registerOutParameter (3, OracleTypes.CURSOR);
call.registerOutParameter (4, java.sql.Types.INTEGER);
call.setString (1, idLender);
call.setString (2, idSeries);
call.execute ();
rs = (ResultSet)call.getObject (3);
rtnval=call.getInt(4);


The code works until the button is clicked causing the code to be re-used.

Still stumped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top