Return-Path: Delivered-To: apmail-beehive-user-archive@www.apache.org Received: (qmail 55114 invoked from network); 23 Jun 2006 11:11:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jun 2006 11:11:14 -0000 Received: (qmail 35394 invoked by uid 500); 23 Jun 2006 11:11:13 -0000 Delivered-To: apmail-beehive-user-archive@beehive.apache.org Received: (qmail 35371 invoked by uid 500); 23 Jun 2006 11:11:12 -0000 Mailing-List: contact user-help@beehive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Users" Delivered-To: mailing list user@beehive.apache.org Received: (qmail 35359 invoked by uid 99); 23 Jun 2006 11:11:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jun 2006 04:11:12 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mottagio@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jun 2006 04:11:11 -0700 Received: by py-out-1112.google.com with SMTP id b36so481542pyb for ; Fri, 23 Jun 2006 04:10:50 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=unDbxPGh4JWOvcgpWSdM0+DesgNR2MPJrk3EyexHxjU6xMkHq2Yit1rbyjstqozMEn/II/OL8E2OBtsBCUo6lU2GUIL45dHeFCHvIy44NyyUcGvL1miiVC1W8tndvCiL8zkCcn5w1bD8wK4Vb8K3Irih7vanJEkzujlGnIPvczc= Received: by 10.35.60.16 with SMTP id n16mr735250pyk; Fri, 23 Jun 2006 04:00:50 -0700 (PDT) Received: by 10.35.69.9 with HTTP; Fri, 23 Jun 2006 04:00:50 -0700 (PDT) Message-ID: <95473edf0606230400j6f2086a0x242cc5982366f774@mail.gmail.com> Date: Fri, 23 Jun 2006 13:00:50 +0200 From: "Giovanni Motta" To: "Beehive Users" Subject: Re: Inheritance of java controls in pageflows. In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_27500_25054877.1151060450307" References: <95473edf0606200724v4e517a3dte2df6be92756495e@mail.gmail.com> <95473edf0606210038i46fecadev3911ce56eec98fec@mail.gmail.com> <95473edf0606210345v144e342dxfbf7006c0b0379e0@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_27500_25054877.1151060450307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 : > > 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 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 : > > > > > > 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 : > > > > > > > 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 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 > > > > > operazione1.Operazione1Controller@1d6e3d2 > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------=_Part_27500_25054877.1151060450307--