It is currently Fri May 18, 2012 3:53 pm


Post a new topicPost a reply Page 1 of 1   [ 3 posts ]
Author Message
 Post subject: debugging JSP/MySQL interaction
PostPosted: Wed Sep 17, 2008 4:38 pm 

Joined: Thu Sep 11, 2008 3:26 pm
Posts: 11
Location: Bismarck, ND
Another day, another stupid question proving how little I know about this language that I'm supposed to be coding in right now...

I have a 'subroutine' in the jsp that I'm currently working on that works with about 20-30 different variables; general manipulation, tossing them in to various database tables, etc... Anyway, there's a whole load of SQL queries, inserts, and updates going on in this piece of code, too. One of them (at least) is broken. Judging by the error that I'm getting from the tomcat logfiles, it's in one of the queries, and it seems that one of my variables is being interpolated as a table column... So I need to find a way to view the SQL interactions as they're happening or an easy way to dump all of my variables somewhere so that I can take a peek at them in order to locate what is going on.

Commenting out all of the SQL and adding debugging output is an option, but one that is going to be a real pain in the buttocks. I'd much rather find an easier way.

Any ideas?

TIA

Damon Getsman

_________________
-=-=-=-
ITRx http://www.itrx-nd.com/
Systems Administrator/Programmer
-=-=-=-


Top
 Profile Send private message  
 
 Post subject: Re: debugging JSP/MySQL interaction
PostPosted: Wed Sep 17, 2008 6:57 pm 

Joined: Thu Sep 11, 2008 3:26 pm
Posts: 11
Location: Bismarck, ND
More information in this post... As you can see, I've gotten past the SQL interaction, which doesn't appear to be a fatal error, and threw me off track for a bit...

Is there anything in this snippet of error log that can help me locate my error? Like what line # in timesheet.jsp or index.jsp it's dying on here? Or maybe even something subtle that I'm missing like follow around one of the myBean.intBean objects to locate the error in one of these files?

I really dislike the way tomcat reports errors.

-Damon

Code:
Sep 17, 2008 1:49:02 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NumberFormatException: null
   at java.lang.Integer.parseInt(Integer.java:415)
   at java.lang.Integer.parseInt(Integer.java:497)
   at org.apache.jsp.timesheet_jsp._jspService(timesheet_jsp.java:862)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
   at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
   at org.apache.jsp.index_jsp._jspx_meth_c_005fotherwise_005f0(index_jsp.java:1521)
   at org.apache.jsp.index_jsp._jspx_meth_c_005fchoose_005f0(index_jsp.java:1423)
   at org.apache.jsp.index_jsp._jspService(index_jsp.java:145)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)


*Damon Getsman

_________________
-=-=-=-
ITRx http://www.itrx-nd.com/
Systems Administrator/Programmer
-=-=-=-


Top
 Profile Send private message  
 
 Post subject: Re: debugging JSP/MySQL interaction
PostPosted: Tue Oct 14, 2008 10:08 am 
Site Admin

Joined: Sat Aug 02, 2008 8:00 am
Posts: 147
Hi Damon

sorry for the late reply

I can see from the log file that you quoted here that6 an exception has been thrown in the timesheet.jsp page
it seems that you are trying to pase a number somewhere in the page and the problem is that the number is not in the same format the formatter expects
look at this :

java.lang.NumberFormatException: null

this means that the object you are trying to parse or formate is null

try looking for methods in you code such as (intvalue, parseint,...etc)

also if you can post the code of this jsp that will be much more helpful

Hope that was helpful and waiting for your prompt

Muhammad Safwat

_________________

Muhammad Safwat Fuad
The Java Code Admin
Java Technical Lead.
Mobile: +2010-2942-538
Email:mtv134@yahoo.com


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 3 posts ]


Who is online

Registered users: Acoutle, Elungartlinia


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
twilightBB Style by Daniel St. Jules of Gamexe.net

[
SEO MOD © 2007 StarTrekGuide ]