Many thanks Carlin for clarifications...Unfortunately, it did not solve my
problem, and i'm wondering if it is a version-related issue..
I found a workaround myself, even if it is a little bit dirty... I  was
forced to declare a JavaControl in the PageFlow P2, this causes the
generation of the ClientInitializer also for P2, and then all the controls
(even the ones defined in base class P1) work correctly (i have no more
NPE).
This forces me to define a fake java control in each pageFlow to be sure my
hierarchy never breaks...

I added a comment on your JIRA issue #1060, hope it helps.

Regards. Giovanni.

2006/6/21, Carlin Rogers <[EMAIL PROTECTED]>:

Hi Giovanni,

In BEEHIVE-1060, if the @Control member of the parent or base class
controller is defined with just the default package visibility (no
modifier)
as...

   @Control
   SomeControl _control;

...and used in a base class action method, then it will not get
initialized
when the inherited action is called for the derived controller. The work
around for now is to just declare the control with the protected modifier
in
the base class...

   @Control
   protected SomeControl _control;

I updated the zip file with the repro case for BEEHIVE-1060 so it includes
the control used to test this specific issue. You can download it as an
example. You will need to edit the ParentController and add the protected
modifier to the control so that it will work. Otherwise, this example
failas
as described in the bug.

Hope the example helps,
Carlin

On 6/21/06, Giovanni Motta <[EMAIL PROTECTED]> wrote:
>
> In https://issues.apache.org/jira/browse/BEEHIVE-1060 i read:
>
> ...The work around is to make the control field protected rather than
> package protected...
>
> Sorry, my fault, but i don't understand what does it mean...Carlin,
could
> you explain better, and/or complete your sample with the workaround?
Many
> thanks.
> Giovanni.
>
>
> 2006/6/21, Giovanni Motta <[EMAIL PROTECTED] >:
> >
> >  Thanks Carlin, i realized my explanation was not clear...
> > I noticed the ClientInitializer is built only for 'father' pageflow P1
> > (the base class), the one that holds the action and the control to be
> > executed.
> >
> > For pageflow P2 that inherits from P1, ClientInitializer is NOT
> > generated...I don't know if it is a bug the fact of not to generate
it,
> or
> > else the fact of look for it in this particular case, where the
> > ClientInitializer is generated for the base class...
> >
> > I think my problem is quite similar to the one you mentioned, i also
get
> a
> > NPE when the control is referenced by base class, but i noticed also
> that
> > other exception i reported. It is logged and probably handled by the
> > framework, since it doesn't stop execution...maybe it should???
> >
> > Could you point me to JIRA (some kind of bug tracker, i suppose?).
> > Many thanks, regards.
> > Giovanni.
> > 2006/6/20, Carlin Rogers <[EMAIL PROTECTED]>:
> >
> > > Hi Giovanni,
> > >
> > > The only issue I'm aware of is tracked in
> > > https://issues.apache.org/jira/browse/BEEHIVE-1060 where a package
> > > protected
> > > control in a parent page flow is not being initialized when using a
> > > derived
> > > page flow inheriting from the parent. In this case it throws an NPE
> when
> > > the
> > > base class method tries to access the control because the control
was
> > > never
> > > initialized. The non-initialization is similar to your experience
but
> I
> > > think different. Your stack trace indicates a problem in the
> > > initializeClient() method of
> > > org.apache.beehive.controls.api.bean.Controls. The call to the
> > > ClassLoader
> > > loadClass() is throwing a ClassNotFoundException for the class file
of
> > > your
> > > generated ClientInitializer,
> > > operazione1.Operazione1ControllerClientInitializer . You mentioned
that
> > > you
> > > noticed that the ClientInitializer is built. Is the class file in
> > > build/WEB-INF/classes/? Is it just an issue with the deployment in
> your
> > > Tomcat 5.5.9 configuration. If you have a simple repro case, you can
> log
> > > a
> > > separate JIRA issue.
> > >
> > > Thanks,
> > > Carlin
> > >
> > > On 6/20/06, Giovanni Motta <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hi all, i'm new to the list.
> > > > I'm trying to build a pageflows hierarchy (pageflow PF1 defines
java
> > > > control
> > > > C1 and an action A1 that internally performs a call to a method of
> C1,
> > > > pageflow PF2 inherits directly from PF1 and performs a forward to
A1
> > > ).
> > > > All
> > > > is done through annotations, no custom instanciation.
> > > > I'm developing with BEA 9.2 tools, but I'm using a tomcat
5.5.9server
> > > for
> > > > project requirements.
> > > > The application starts fine on PF2, invokes action A1 of PF1 with
no
> > > > problem, but when the java control C1 is first used, i see with
the
> > > debug
> > > > tool it is not instanciated (null) .
> > > > Also, during initialization of pageflow P2, i see in console
output
> > > the
> > > > exception reported.
> > > > It seems like no client initializer class is found for P2, but i'm
> > > > wondering
> > > > if it's ordinary stuff, since i see the client initializer class
is
> > > built
> > > > for pageflow P1, that in effect is the owner of the java
> > > control...Bug???
> > > >
> > > > Apart from this, i would like to know if someone else has already
> > > > developed
> > > > something similar and can produce a sample code.
> > > > Reading beehive 1.0.1 documentation, it seems this kind of
> inheritance
> > > > should be fully supported.
> > > > Problems with the container? Any points?
> > > >
> > > > Thanks in advance to who will answer.
> > > >
> > > > Exception follows:
> > > >
> > > > [INFO] FlowController - Handling exception in onCreate(),
> > > FlowController
> > > > [EMAIL PROTECTED]
> > > >
> > > > Throwable: *
> > > >
> > >
> org.apache.beehive.netui.pageflow.ControlFieldInitializationException*:
> > > > Exception occurred while initializing control field
> > > > operazione1.Operazione1Controller in
> > > > /operazione1/Operazione1Controller.jpf.
> > > >
> > > > Stack Trace:
> > > > *
> > > >
> > > >
> > >
> org.apache.beehive.netui.pageflow.ControlFieldInitializationException*:
> > > > Exception occurred while initializing control field
> > > > operazione1.Operazione1Controller in
> > > > /operazione1/Operazione1Controller.jpf.
> > > >
> > > > at
> > > >
> > > >
> > >
>
org.apache.beehive.netui.pageflow.internal.JavaControlUtils.initJavaControls
> > > > (* JavaControlUtils.java:177*)
> > > >
> > > > at org.apache.beehive.netui.pageflow.PageFlowManagedObject.create
(*
> > > > PageFlowManagedObject.java:83*)
> > > >
> > > > at org.apache.beehive.netui.pageflow.FlowController.create (*
> > > > FlowController.java:556*)
> > > >
> > > > at org.*apache*.beehive.netui.pageflow.PageFlowController.create(*

> > > > PageFlowController.java:405*)
> > > >
> > > > at
> > >
org.apache.beehive.netui.pageflow.FlowControllerFactory.createPageFlow
> > > > (*
> > > > FlowControllerFactory.java:294*)
> > > >
> > > > at
> > > >
> > > >
> > >
>
org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.getFlowController
> > > > (*PageFlowRequestProcessor.java:603*)
> > > >
> > > > at org.*apache*
> > > > .beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(*
> > > > PageFlowRequestProcessor.java:508*)
> > > >
> > > > at
> org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(*
> > > > PageFlowRequestProcessor.java:838*)
> > > >
> > > > at
> org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process
> > > (*
> > > > AutoRegisterActionServlet.java:634*)
> > > >
> > > > at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process
(*
> > > > PageFlowActionServlet.java:156*)
> > > >
> > > > at org.apache.struts.action.ActionServlet.doGet (*
ActionServlet.java
> > > :507*)
> > > >
> > > > at javax.servlet.http.HttpServlet.service(*HttpServlet.java:689*)
> > > >
> > > > at javax.servlet.http.HttpServlet.service (*HttpServlet.java:802*)
> > > >
> > > > at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (*
> > > > ApplicationFilterChain.java:252*)
> > > >
> > > > at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
> > > > ApplicationFilterChain.java:173*)
> > > >
> > > > at org.apache.catalina.core.ApplicationDispatcher.invoke (*
> > > > ApplicationDispatcher.java:672*)
> > > >
> > > > at org.apache.catalina.core.ApplicationDispatcher.processRequest(*
> > > > ApplicationDispatcher.java :463*)
> > > >
> > > > at org.apache.catalina.core.ApplicationDispatcher.doForward(*
> > > > ApplicationDispatcher.java :398*)
> > > >
> > > > at org.apache.catalina.core.ApplicationDispatcher.forward(*
> > > > ApplicationDispatcher.java:301*)
> > > >
> > > > at
> > > >
> > > >
> > >
>
org.apache.beehive.netui.pageflow.internal.DefaultForwardRedirectHandler.forward
> > > > (*DefaultForwardRedirectHandler.java:127*)
> > > >
> > > > at
> > > org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.doForward
(*
> > > > PageFlowRequestProcessor.java:1797*)
> > > >
> > > > at
> > > >
> > > >
> > >
>
org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processPageFlowRequest
> > > > (*PageFlowRequestProcessor.java:732*)
> > > >
> > > > at
> > > >
> > >
>
org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal
> > > > (*
> > > > PageFlowRequestProcessor.java:469*)
> > > >
> > > > at
> org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process
> > > (*
> > > > PageFlowRequestProcessor.java:838*)
> > > >
> > > > at
> org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(*
> > > > AutoRegisterActionServlet.java:634*)
> > > >
> > > > at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(*
> > > > PageFlowActionServlet.java:156*)
> > > >
> > > > at org.apache.struts.action.ActionServlet.doGet (*
ActionServlet.java
> > > :507*)
> > > >
> > > > at javax.servlet.http.HttpServlet.service(*HttpServlet.java:689*)
> > > >
> > > > at javax.servlet.http.HttpServlet.service(*HttpServlet.java:802*)
> > > >
> > > > at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
> > > > ApplicationFilterChain.java:252*)
> > > >
> > > > at org.apache.catalina.core.ApplicationFilterChain.doFilter (*
> > > > ApplicationFilterChain.java:173*)
> > > >
> > > > at org.apache.catalina.core.StandardWrapperValve.invoke (*
> > > > StandardWrapperValve.java:213*)
> > > >
> > > > at org.apache.catalina.core.StandardContextValve.invoke(*
> > > > StandardContextValve.java:178*)
> > > >
> > > > at org.apache.catalina.core.StandardHostValve.invoke (*
> > > > StandardHostValve.java
> > > > :126*)
> > > >
> > > > at org.apache.catalina.valves.ErrorReportValve.invoke(*
> > > > ErrorReportValve.java
> > > > :105*)
> > > >
> > > > at org.apache.catalina.core.StandardEngineValve.invoke (*
> > > > StandardEngineValve.java:107*)
> > > >
> > > > at org.apache.catalina.connector.CoyoteAdapter.service(*
> > > CoyoteAdapter.java
> > > > :148*)
> > > >
> > > > at org.apache.coyote.http11.Http11Processor.process(*
> > > Http11Processor.java
> > > > :856*)
> > > >
> > > > at
> > > >
> > > >
> > >
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection
> > > > (*Http11Protocol.java:744*)
> > > >
> > > > at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (*
> > > > PoolTcpEndpoint.java:527*)
> > > >
> > > > at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(*
> > > > LeaderFollowerWorkerThread.java:80*)
> > > >
> > > > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(*
> > > > ThreadPool.java:684*)
> > > >
> > > > at java.lang.Thread.run(*Thread.java:595*)
> > > >
> > > > Caused by: *java.lang.ClassNotFoundException*:
> > > > operazione1.Operazione1ControllerClientInitializer
> > > >
> > > > at org.apache.catalina.loader.WebappClassLoader.loadClass(*
> > > > WebappClassLoader.java :1332*)
> > > >
> > > > at org.apache.catalina.loader.WebappClassLoader.loadClass(*
> > > > WebappClassLoader.java:1181*)
> > > >
> > > > at org.apache.beehive.controls.api.bean.Controls.initializeClient(*
> > > > Controls.java:131*)
> > > >
> > > > at
> > > >
> > > >
> > >
>
org.apache.beehive.netui.pageflow.internal.JavaControlUtils.initJavaControls
> > > > (*JavaControlUtils.java:172*)
> > > >
> > > > ... 42 more
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Reply via email to