K
kaeli
Hey all,
In my code (JSP), when I catch an exception and print the stack trace, it
isn't giving me the full error like I see in the server logs.
Any hints on how to get the entire error message? (the "caused by" part most
important)
For example, looking at this message, WAY at the bottom, you can see the real
problem was the unparseable date.
The server logs:
[03/Nov/2004:08:33:03] failure (13157): Internal error: servlet service
function had thrown ServletException (uri=/ops_b
eta/events_retrofit_updateNow.jsp): org.apache.jasper.JasperException, stack:
org.apache.jasper.JasperException
at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:199)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146)
at _jsps._ops_beta._events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:138)
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915)
at com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)
, root cause: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:195)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146)
at _jsps._ops_beta._events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:138)
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915)
at com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)
Caused by: java.text.ParseException: Unparseable date: " "
at java.text.DateFormat.parse(DateFormat.java:334)
at OPS_Beans_20.OPS_EventBean.setSchPrelimDueDate
(OPS_EventBean.java:435)
... 10 more
Yet when I just do exception.printStackTrace in the JSP code, I get only the
first few lines, thus making it impossible to see what the problem was.
From the JSP:
Message: null
Stack Trace: org.apache.jasper.JasperException at
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:199) at
org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146) at _jsps._ops_beta.
_events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:148) at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915) at
com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)
JSP code:
catch (Exception e)
{
String errMsg = e.getMessage();
%>
<p class="bigAttention">Message: <%= errMsg %></p>
<p>Stack Trace:
<%
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
out.print(sw);
sw.close();
pw.close();
}
--
--
~kaeli~
Never argue with an idiot! People may not be able to tell
you apart.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
In my code (JSP), when I catch an exception and print the stack trace, it
isn't giving me the full error like I see in the server logs.
Any hints on how to get the entire error message? (the "caused by" part most
important)
For example, looking at this message, WAY at the bottom, you can see the real
problem was the unparseable date.
The server logs:
[03/Nov/2004:08:33:03] failure (13157): Internal error: servlet service
function had thrown ServletException (uri=/ops_b
eta/events_retrofit_updateNow.jsp): org.apache.jasper.JasperException, stack:
org.apache.jasper.JasperException
at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:199)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146)
at _jsps._ops_beta._events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:138)
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915)
at com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)
, root cause: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:195)
at org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146)
at _jsps._ops_beta._events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:138)
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915)
at com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)
Caused by: java.text.ParseException: Unparseable date: " "
at java.text.DateFormat.parse(DateFormat.java:334)
at OPS_Beans_20.OPS_EventBean.setSchPrelimDueDate
(OPS_EventBean.java:435)
... 10 more
Yet when I just do exception.printStackTrace in the JSP code, I get only the
first few lines, thus making it impossible to see what the problem was.
From the JSP:
Message: null
Stack Trace: org.apache.jasper.JasperException at
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:199) at
org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146) at _jsps._ops_beta.
_events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:148) at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915) at
com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)
JSP code:
catch (Exception e)
{
String errMsg = e.getMessage();
%>
<p class="bigAttention">Message: <%= errMsg %></p>
<p>Stack Trace:
<%
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
out.print(sw);
sw.close();
pw.close();
}
--
--
~kaeli~
Never argue with an idiot! People may not be able to tell
you apart.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace