beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlin Rogers (JIRA)" <>
Subject [jira] Resolved: (BEEHIVE-1205) project with a global.Global class that does not extend SharedFlowController or the derecated GlobalApp causes runtime exceptions
Date Fri, 14 Sep 2007 05:30:32 GMT


Carlin Rogers resolved BEEHIVE-1205.

    Resolution: Fixed
      Assignee: Julie Zhuo  (was: Carlin Rogers)

Fixed with SVN revision 575538.

> project with a global.Global class that does not extend SharedFlowController or the derecated
GlobalApp causes runtime exceptions
> ---------------------------------------------------------------------------------------------------------------------------------
>                 Key: BEEHIVE-1205
>                 URL:
>             Project: Beehive
>          Issue Type: Bug
>          Components: NetUI
>    Affects Versions: 1.0, 1.0.1, 1.0.2
>            Reporter: Carlin Rogers
>            Assignee: Julie Zhuo
>            Priority: Minor
>             Fix For: V.Next
> To reproduce:
> - Add a simple POJO named in a /global package.
> - Build/compile the project. Note that the generated Struts module config files for the
page flow controllers in the project (that do not have references to shared flows) will have
a property defined by the
> <set-property property="sharedFlows" value="__global=global.Global"/>
> element with in the <controller>
> - Deploy the app on a server and hit a page flow controller begin action. Note the exception.
> java.lang.ClassCastException: global.Global
> 	at org.apache.beehive.netui.pageflow.FlowControllerFactory.createSharedFlow(
> 	at org.apache.beehive.netui.pageflow.FlowControllerFactory.createSharedFlow(
> 	at org.apache.beehive.netui.pageflow.FlowControllerFactory.addSharedFlow(
> 	at org.apache.beehive.netui.pageflow.FlowControllerFactory.getSharedFlowsForPath(
> 	at org.apache.beehive.netui.pageflow.FlowControllerFactory.getSharedFlowsForRequest(
> 	at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(
> 	at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(
> 	at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(
> 	at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(
> 	at org.apache.struts.action.ActionServlet.doGet(
> 	at javax.servlet.http.HttpServlet.service(
> The global.Global class in this scenario is just a POJO and not a Shared Flow. When the
application is compiled, the NetUI annotation processor (AP) assumes that it is a Shared Flow
to support the old deprecated and generates a Struts module config file that includes
a property for this class as a shared flow.
> The <controller> element in the generated Struts module config includes the following
> <set-property property="sharedFlows" value="__global=global.Global"/>
> The NetUI AP first looks for any shared flows referenced by a given page flow. If there
are none, then it just looks to see if there is a global.Global type declaration, but does
not check that it is an instance of org.apache.beehive.netui.pageflow.GlobalApp or a SharedFlowController.
Since it finds the global.Global class in this scenario, it adds it as a default Shared Flow.
> Then at runtime when we try to load shared flows for the page flow, we fail with a ClassCastException.
> Note, this will only occur if a user defines a global.Global class in their NetUI project.
> The fix requires a change to org.apache.beehive.netui.compiler.FlowControllerInfo.setSharedFlowInfo()
to check that the class inherits from GlobalApp or SharedFlowController.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message