You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "Rich Feit (JIRA)" <de...@beehive.apache.org> on 2005/08/31 05:49:05 UTC

[jira] Commented: (BEEHIVE-903) Incoherent error message when an exception handler method throws an unhandled exception

    [ http://issues.apache.org/jira/browse/BEEHIVE-903?page=comments#action_12320658 ] 

Rich Feit commented on BEEHIVE-903:
-----------------------------------

These are the diffs for fixing the problem:

Index: pageflow/org/apache/beehive/netui/pageflow/FlowController.java
===================================================================
--- pageflow/org/apache/beehive/netui/pageflow/FlowController.java      (revision 264849)
+++ pageflow/org/apache/beehive/netui/pageflow/FlowController.java      (working copy)
@@ -28,6 +28,7 @@
 import org.apache.beehive.netui.pageflow.internal.InternalConstants;
 import org.apache.beehive.netui.pageflow.internal.InternalExpressionUtils;
 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.internal.UnhandledException;
 import org.apache.beehive.netui.pageflow.scoping.ScopedRequest;
 import org.apache.beehive.netui.util.internal.FileUtils;
 import org.apache.beehive.netui.util.internal.InternalStringBuilder;
@@ -1404,7 +1405,7 @@
                 if ( ex instanceof ServletException ) throw ( ServletException ) ex;
                 if ( ex instanceof IOException ) throw ( IOException ) ex;
                 if ( ex instanceof Error ) throw ( Error ) ex;
-                throw new ServletException( ex );
+                throw new UnhandledException( ex );
             }

             return null;

> Incoherent error message when an exception handler method throws an unhandled exception
> ---------------------------------------------------------------------------------------
>
>          Key: BEEHIVE-903
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-903
>      Project: Beehive
>         Type: Bug
>   Components: NetUI
>     Versions: v1m1
>     Reporter: Rich Feit
>     Assignee: Rich Feit
>      Fix For: V1

>
> This bug was distilled from a conversation with Xibin Zeng about http://issues.apache.org/jira/browse/BEEHIVE-899 .
> Repro:
>     - Create the following page flow controller:
> ----
> @Jpf.Controller(
>     catches={
>         @Jpf.Catch(type=Exception.class, method="handleIt")
>     }
> )
> public class Controller extends PageFlowController
> {
>     @Jpf.Action
>     public Forward begin()
>     {
>         throw new IllegalStateException("intentional");
>     }
>     @Jpf.ExceptionHandler
>     public Forward handleIt(Exception ex, String actionName, String message, Object formBean)
>     {
>         throw new UnsupportedOperationException("another intentional exception");
>     }
> }
> ----
>     - Hit it in the browser.
> EXPECTED: go to the normal unhandled-exception page, with a stack trace for the IllegalStateException (the original exception), and also see the stacktrace for the UnsupportedOperationException in the logs.
> ACTUAL:
> java.lang.ClassNotFoundException: handleIt
> 	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
> 	org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
> 	org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:117)
> 	org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)
> 	org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:529)
> 	org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processException(PageFlowRequestProcessor.java:1026)
> 	org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
> 	org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:105)
> 	org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2048)
> 	org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:90)
> 	org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2119)
> 	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
> 	org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:600)
> 	org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:886)
> 	org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:613)
> 	org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:163)
> 	org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira