Stripes

"ActionBean execution threw an exception" - root cause is not logged

Details

Description

hello,

Perhaps I have something configured wrong. But occasionally I get this error here, with no help as to what I actually have wrong:

10:50:25,230 WARN DefaultExceptionHandler:90 - Unhandled exception caught by the Stripes default exception handler.
net.sourceforge.stripes.exception.StripesServletException: ActionBean execution threw an exception.
at net.sourceforge.stripes.controller.DispatcherServlet.doPost(DispatcherServlet.java:190)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at net.sourceforge.stripes.mock.MockFilterChain.doFilter(MockFilterChain.java:66)
at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:246)
at net.sourceforge.stripes.mock.MockFilterChain.doFilter(MockFilterChain.java:63)
at net.sourceforge.stripes.mock.MockServletContext.acceptRequest(MockServletContext.java:255)
at net.sourceforge.stripes.mock.MockRoundtrip.execute(MockRoundtrip.java:195)
at net.sourceforge.stripes.mock.MockRoundtrip.execute(MockRoundtrip.java:207)
at test.com.upmc.cancercenters.pathways.core.TestPathwayViewer.testViewDiseasePDF(TestPathwayViewer.java:42)
at test.com.upmc.cancercenters.pathways.core.TestPathwayViewer.testBody(TestPathwayViewer.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

This doesn't help, the cause of that exception needs to be logged.

looking at the trunk, I see:

throw throwable;
}
}
catch (ServletException se) { throw se; }
catch (IOException ioe) { throw ioe; }
catch (Throwable t) { throw new StripesServletException("Unhandled exception in exception handler.", t); }

so it's throwing it inside a try block and catching it.. something isn't right here.

Activity

Hide
John Newman added a comment - 11/Jun/09 11:26 AM

ok through the debugger I found the actual error I am getting is: java.lang.OutOfMemoryError: Java heap space. That explains why this was only happening rarely.

I was always taught not to catch Throwable, because you'll catch things like java.lang.OutOfMemoryError, that, well, aren't supposed to be caught. If you do catch an out of memory error: now what? LinkageError etc. My ExceptionHandler class really shouldn't have a method for those, right?

I temporarily added a Throwable method to my exception handler class and I am able to log it myself now. But if I remove my exception handler and use the default one that ships with stripes, it doesn't get logged like it should, so IMO this is a bug.

Show
John Newman added a comment - 11/Jun/09 11:26 AM ok through the debugger I found the actual error I am getting is: java.lang.OutOfMemoryError: Java heap space. That explains why this was only happening rarely. I was always taught not to catch Throwable, because you'll catch things like java.lang.OutOfMemoryError, that, well, aren't supposed to be caught. If you do catch an out of memory error: now what? LinkageError etc. My ExceptionHandler class really shouldn't have a method for those, right? I temporarily added a Throwable method to my exception handler class and I am able to log it myself now. But if I remove my exception handler and use the default one that ships with stripes, it doesn't get logged like it should, so IMO this is a bug.
Hide
John Newman added a comment - 01/Jul/09 3:41 PM

I ran into this again today. Minimal test case to reproduce this is attached

Show
John Newman added a comment - 01/Jul/09 3:41 PM I ran into this again today. Minimal test case to reproduce this is attached
Hide
Frederic Daoud added a comment - 16/Sep/09 4:20 PM

Fixed in revision 1143.

Show
Frederic Daoud added a comment - 16/Sep/09 4:20 PM Fixed in revision 1143.

People

Vote (0)
Watch (0)

Dates

  • Created:
    11/Jun/09 10:05 AM
    Updated:
    04/Jan/11 1:26 PM
    Resolved:
    27/Oct/09 2:24 PM