Discussion:
JSP/MySQL debugging issue
(too old to reply)
Damon Getsman
2008-09-17 16:40:50 UTC
Permalink
Not exactly JavaBeans, but pretty close... If anybody knows a better
resource on usenet for just JSP, please feel free to let me know.

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/
Programmer/Systems Administrator
-=-=-=-
Chris Riesbeck
2008-09-17 17:40:08 UTC
Permalink
Post by Damon Getsman
Not exactly JavaBeans, but pretty close... If anybody knows a better
resource on usenet for just JSP, please feel free to let me know.
comp.lang.java.programmer might be more appropriate for pure JSP issues,
but this is really about mySql
Post by Damon Getsman
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?
I use Derby so I'm just guessing here, but seems like the first thing
would be to enable and check the mysql logs

http://dev.mysql.com/doc/refman/5.0/en/query-log.html
Post by Damon Getsman
TIA
-Damon Getsman
-=-=-=-
ITRx http://www.itrx-nd.com/
Programmer/Systems Administrator
-=-=-=-
Damon Getsman
2008-09-17 19:03:29 UTC
Permalink
More information in this post... Looks like the MySQL bit was fooling
me; that's a nonfatal error that likely has been there since before I
modified anything in this code.

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

PS I am posting this new information to the newsgroup you recommended
as well if it is, indeed, more appropriate there.

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)
Chris Riesbeck
2008-09-18 17:39:49 UTC
Permalink
I just posted what I hope is some helpful tips over on
comp.lang.java.programmer.
Post by Damon Getsman
More information in this post... Looks like the MySQL bit was fooling
me; that's a nonfatal error that likely has been there since before I
modified anything in this code.
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
PS I am posting this new information to the newsgroup you recommended
as well if it is, indeed, more appropriate there.
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
374)
at
337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
290)
at
206)
at
630)
at
535)
at
472)
at
968)
at
1521)
at
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
374)
at
337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
290)
at
206)
at
233)
at
175)
at
128)
at
102)
at
109)
at
286)
at
844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
447)
at java.lang.Thread.run(Thread.java:619)
Loading...