You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jens Reufsteck <je...@staufenbiel.de> on 2010/11/15 09:32:15 UTC

contribute mystery

Hi,

 

I’m having some mystery going on when contributing a dispatcher. The
dispatcher is always instantiated (according to the logs), but it’s used
only sometimes. In some cases, when I start jetty (or tomcat), the
dispatcher is used and then consequently it’s always used. But after a
restart it’s not used, though I haven’t changed anything in the code.

 

Most puzzling to me: I’ve inserted 2 calls to System.out.println() in the
contribute-method – and voila, the dispatcher is always used. As soon as I
comment the two lines, it’s again like described above. See code below (this
is T5.1).

 

Any help is much appreciated, no idea, where to look at.

 

 

    public static void contributeMasterDispatcher(

                        OrderedConfiguration<Dispatcher> dispatchers,

                        PageRenderRequestHandler renderer,

                        AuthenticationService auth,

                        Sitemap sitemap,

                        @Inject @Symbol ("loginPage") String loginPage) {

            

            Dispatcher authorizationDispatcher = new
AuthorizationDispatcher(

                                   renderer,

                                   auth,

                                   sitemap,

                                   loginPage);

            

            //System.out.println("xxxxx Dispatcher initialized");

            

            dispatchers.add("AuthorizationDispatcher",
authorizationDispatcher, "after:ComponentEvent", "before:PageRenderer");

            

            //System.out.println("xxxxxx Dispatcher contributed");      

    }

 

 

Many thanks

Jens

 

-- 
Jens Reufsteck
Marketing & Online Director 

Staufenbiel Institut GmbH
Events & Recruiting Solutions

Wildunger Straße 6, 60487 Frankfurt am Main
 <http://www.staufenbiel.de/> www.staufenbiel.de
<http://www.mba-master.de/> www.mba-master.de
<http://www.absolventenkongress.de/> www.absolventenkongress.de

Tel.:    +49 (0)69 25537-140
Fax:    +49 (0)69 25537-2140

Employer Branding mit Effekt: Treffen Sie Ihre Zielgruppe auf
<http://www.staufenbiel.de/> staufenbiel.de, dem Karriereportal mit Relevanz
–
<http://www.staufenbiel.de/fileadmin/fm-dam/PDF/Mediadaten/2011/Staufenbiel-
Institut-Media-Pack-2011n.pdf> Download Mediadaten
Die reelle Bewerber-Plattform: Ihr Stand auf dem
<http://www.absolventenkongress.de/> Absolventenkongress am 24./25. November
2010 –
<http://www.staufenbiel.de/fileadmin/fm-dam/PDF/Mediadaten/2010/Absolventenk
ongress-Media-Pack-0403.pdf> Download Ausstellerunterlagen

Staufenbiel GmbH

Geschäftsführer: Judith Oppitz, Birgit Giesen, Graham Storey, Martin
Halliday
Amtsgericht Köln HRB 9301

Internet communications are not secure and therefore Staufenbiel Institut
GmbH does not accept legal responsibility 
for the contents of this message. Any views or opinions presented are solely
those of the author and do not 
necessarily represent those of Staufenbiel Institut GmbH unless otherwise
specifically stated. 


RE: contribute mystery

Posted by Jens Reufsteck <je...@staufenbiel.de>.
Thanks Fred,

good point - just wanted to solve the other problem first.

Regards
Jens

-- 
Jens Reufsteck
Marketing & Online Director

Staufenbiel Institut GmbH
Events & Recruiting Solutions

Wildunger Straße 6, 60487 Frankfurt am Main
www.staufenbiel.de www.mba-master.de www.absolventenkongress.de

Tel.:  +49 (0)69 25537-140
Fax:   +49 (0)69 25537-2140

Geschäftsführer: Judith Oppitz, Birgit Giesen, Graham Storey, Martin Halliday
Amtsgericht Köln HRB 9301

Internet communications are not secure and therefore Staufenbiel Institut GmbH does not accept legal responsibility
for the contents of this message. Any views or opinions presented are solely those of the author and do not
necessarily represent those of Staufenbiel Institut GmbH unless otherwise specifically stated.

> -----Original Message-----
> From: Fred van Engen [mailto:fred@wooha.org]
> Sent: Monday, November 15, 2010 10:48 AM
> To: Tapestry users
> Subject: Re: contribute mystery
> 
> We use before:ComponentEvent and before:PageRenderer and that works.
> The additional benefit is that event are also checked. In your case
> event code can be called without any authentication checks. I'm not
> sure why you would want to allow that.
> 
> Regards,
> 
> 
> Fred.
> 
> Op 15 nov 2010 om 09:32 heeft "Jens Reufsteck" <jens.reufsteck@staufenbiel.de
>  > het volgende geschreven:\
> 
> > Hi,
> >
> >
> >
> > I’m having some mystery going on when contributing a dispatcher. The
> >  dispatcher is always instantiated (according to the logs), but it’s
> >  used only sometimes. In some cases, when I start jetty (or tomcat),
> >  the dispatcher is used and then consequently it’s always used. But
> > after a restart it’s not used, though I haven’t changed anything
> > in the code.
> >
> >
> >
> > Most puzzling to me: I’ve inserted 2 calls to System.out.println() i
> > n the contribute-method – and voila, the dispatcher is always used.
> > As soon as I comment the two lines, it’s again like described above.
> >  See code below (this is T5.1).
> >
> >
> >
> > Any help is much appreciated, no idea, where to look at.
> >
> >
> >
> >
> >
> >     public static void contributeMasterDispatcher(
> >
> >                         OrderedConfiguration<Dispatcher> dispatchers,
> >
> >                         PageRenderRequestHandler renderer,
> >
> >                         AuthenticationService auth,
> >
> >                         Sitemap sitemap,
> >
> >                         @Inject @Symbol ("loginPage") String
> > loginPage) {
> >
> >
> >
> >             Dispatcher authorizationDispatcher = new
> > AuthorizationDispatcher(
> >
> >                                    renderer,
> >
> >                                    auth,
> >
> >                                    sitemap,
> >
> >                                    loginPage);
> >
> >
> >
> >             //System.out.println("xxxxx Dispatcher initialized");
> >
> >
> >
> >             dispatchers.add("AuthorizationDispatcher",
> > authorizationDispatcher, "after:ComponentEvent",
> > "before:PageRenderer");
> >
> >
> >
> >             //System.out.println("xxxxxx Dispatcher contributed");
> >
> >     }
> >
> >
> >
> >
> >
> > Many thanks
> >
> > Jens
> >
> >
> >
> > --
> > Jens Reufsteck
> > Marketing & Online Director
> >
> > Staufenbiel Institut GmbH
> > Events & Recruiting Solutions
> >
> > Wildunger Straße 6, 60487 Frankfurt am Main
> > www.staufenbiel.de www.mba-master.de www.absolventenkongress.de
> >
> > Tel.:    +49 (0)69 25537-140
> > Fax:    +49 (0)69 25537-2140
> >
> > Employer Branding mit Effekt: Treffen Sie Ihre Zielgruppe auf staufenbiel.de
> > , dem Karriereportal mit Relevanz – Download Mediadaten
> > Die reelle Bewerber-Plattform: Ihr Stand auf dem Absolventenkongress
> > am 24./25. November 2010 – Download Ausstellerunterlagen
> >
> >
> >
> > Geschäftsführer: Judith Oppitz, Birgit Giesen, Graham Storey, Martin
> >  Halliday
> > Amtsgericht Köln HRB 9301
> >
> > Internet communications are not secure and therefore Staufenbiel
> > Institut GmbH does not accept legal responsibility
> > for the contents of this message. Any views or opinions presented
> > are solely those of the author and do not
> > necessarily represent those of Staufenbiel Institut GmbH unless
> > otherwise specifically stated.

Re: contribute mystery

Posted by Fred van Engen <fr...@wooha.org>.
We use before:ComponentEvent and before:PageRenderer and that works.  
The additional benefit is that event are also checked. In your case  
event code can be called without any authentication checks. I'm not  
sure why you would want to allow that.

Regards,


Fred.

Op 15 nov 2010 om 09:32 heeft "Jens Reufsteck" <jens.reufsteck@staufenbiel.de 
 > het volgende geschreven:\

> Hi,
>
>
>
> I’m having some mystery going on when contributing a dispatcher. The 
>  dispatcher is always instantiated (according to the logs), but it’s 
>  used only sometimes. In some cases, when I start jetty (or tomcat), 
>  the dispatcher is used and then consequently it’s always used. But  
> after a restart it’s not used, though I haven’t changed anything  
> in the code.
>
>
>
> Most puzzling to me: I’ve inserted 2 calls to System.out.println() i 
> n the contribute-method – and voila, the dispatcher is always used.  
> As soon as I comment the two lines, it’s again like described above. 
>  See code below (this is T5.1).
>
>
>
> Any help is much appreciated, no idea, where to look at.
>
>
>
>
>
>     public static void contributeMasterDispatcher(
>
>                         OrderedConfiguration<Dispatcher> dispatchers,
>
>                         PageRenderRequestHandler renderer,
>
>                         AuthenticationService auth,
>
>                         Sitemap sitemap,
>
>                         @Inject @Symbol ("loginPage") String  
> loginPage) {
>
>
>
>             Dispatcher authorizationDispatcher = new  
> AuthorizationDispatcher(
>
>                                    renderer,
>
>                                    auth,
>
>                                    sitemap,
>
>                                    loginPage);
>
>
>
>             //System.out.println("xxxxx Dispatcher initialized");
>
>
>
>             dispatchers.add("AuthorizationDispatcher",  
> authorizationDispatcher, "after:ComponentEvent",  
> "before:PageRenderer");
>
>
>
>             //System.out.println("xxxxxx Dispatcher contributed");
>
>     }
>
>
>
>
>
> Many thanks
>
> Jens
>
>
>
> -- 
> Jens Reufsteck
> Marketing & Online Director
>
> Staufenbiel Institut GmbH
> Events & Recruiting Solutions
>
> Wildunger Straße 6, 60487 Frankfurt am Main
> www.staufenbiel.de www.mba-master.de www.absolventenkongress.de
>
> Tel.:    +49 (0)69 25537-140
> Fax:    +49 (0)69 25537-2140
>
> Employer Branding mit Effekt: Treffen Sie Ihre Zielgruppe auf staufenbiel.de 
> , dem Karriereportal mit Relevanz – Download Mediadaten
> Die reelle Bewerber-Plattform: Ihr Stand auf dem Absolventenkongress  
> am 24./25. November 2010 – Download Ausstellerunterlagen
>
>
>
> Geschäftsführer: Judith Oppitz, Birgit Giesen, Graham Storey, Martin 
>  Halliday
> Amtsgericht Köln HRB 9301
>
> Internet communications are not secure and therefore Staufenbiel  
> Institut GmbH does not accept legal responsibility
> for the contents of this message. Any views or opinions presented  
> are solely those of the author and do not
> necessarily represent those of Staufenbiel Institut GmbH unless  
> otherwise specifically stated.

RE: contribute mystery

Posted by Jens Reufsteck <je...@staufenbiel.de>.
Thanks Kris,

maybe I wasn't quite clear: on some startups my dispatcher is used (and than is always used, which is what I want). On other startups (i.e. restarting jetty/tomcat) the dispatcher is never used. Though log show, that it is instantiated. But then it feels, as if it wasn't included in the dispatchers chain of commands.

It seems just random, more a less a 50% chance that it's used, but not exactly every second time. And as I said: If it's once used, it's always used, or it is never used at all. Seems to be decided directly after startup of the application.

Thanks
Jens

-- 
Jens Reufsteck
Marketing & Online Director

Staufenbiel Institut GmbH
Events & Recruiting Solutions

Wildunger Straße 6, 60487 Frankfurt am Main
www.staufenbiel.de www.mba-master.de www.absolventenkongress.de

Tel.:  +49 (0)69 25537-140
Fax:   +49 (0)69 25537-2140

Geschäftsführer: Judith Oppitz, Birgit Giesen, Graham Storey, Martin Halliday
Amtsgericht Köln HRB 9301

Internet communications are not secure and therefore Staufenbiel Institut GmbH does not accept legal responsibility
for the contents of this message. Any views or opinions presented are solely those of the author and do not
necessarily represent those of Staufenbiel Institut GmbH unless otherwise specifically stated.

> -----Original Message-----
> From: Kristian Marinkovic [mailto:kristian.marinkovic@porscheinformatik.at]
> Sent: Monday, November 15, 2010 10:38 AM
> To: Tapestry users
> Subject: Re: contribute mystery
> 
> Hi Jens,
> 
> the contribute methods are used for configuration... therefore there are
> only executed once on startup (... or on lazy load)
> once your dispatcher is in place only your dispatcher will be called.
> 
> please re-read the tapestry-ioc documentation.
> 
> g,
> kris
> 
> 
> 
> 
> Von:    "Jens Reufsteck" <je...@staufenbiel.de>
> An:     "'Tapestry users'" <us...@tapestry.apache.org>
> Datum:  15.11.2010 09:32
> Betreff:        contribute mystery
> 
> 
> 
> Hi,
> 
> I’m having some mystery going on when contributing a dispatcher. The
> dispatcher is always instantiated (according to the logs), but it’s used
> only sometimes. In some cases, when I start jetty (or tomcat), the
> dispatcher is used and then consequently it’s always used. But after a
> restart it’s not used, though I haven’t changed anything in the code.
> 
> Most puzzling to me: I’ve inserted 2 calls to System.out.println() in the
> contribute-method – and voila, the dispatcher is always used. As soon as I
> comment the two lines, it’s again like described above. See code below
> (this is T5.1).
> 
> Any help is much appreciated, no idea, where to look at.
> 
> 
>     public static void contributeMasterDispatcher(
>                         OrderedConfiguration<Dispatcher> dispatchers,
>                         PageRenderRequestHandler renderer,
>                         AuthenticationService auth,
>                         Sitemap sitemap,
>                         @Inject @Symbol ("loginPage") String loginPage) {
> 
>             Dispatcher authorizationDispatcher = new
> AuthorizationDispatcher(
>                                    renderer,
>                                    auth,
>                                    sitemap,
>                                    loginPage);
> 
>             //System.out.println("xxxxx Dispatcher initialized");
> 
>             dispatchers.add("AuthorizationDispatcher",
> authorizationDispatcher, "after:ComponentEvent", "before:PageRenderer");
> 
>             //System.out.println("xxxxxx Dispatcher contributed");
>     }
> 
> 
> Many thanks
> Jens
> 
> --
> Jens Reufsteck
> Marketing & Online Director
> Staufenbiel Institut GmbH
> Events & Recruiting Solutions
> 
> Wildunger Straße 6, 60487 Frankfurt am Main
> www.staufenbiel.de www.mba-master.de www.absolventenkongress.de
> 
> Tel.:    +49 (0)69 25537-140
> Fax:    +49 (0)69 25537-2140
> 
> Employer Branding mit Effekt: Treffen Sie Ihre Zielgruppe auf
> staufenbiel.de, dem Karriereportal mit Relevanz – Download Mediadaten
> Die reelle Bewerber-Plattform: Ihr Stand auf dem Absolventenkongress am
> 24./25. November 2010 – Download Ausstellerunterlagen
> 
> 
> 
> Geschäftsführer: Judith Oppitz, Birgit Giesen, Graham Storey, Martin
> Halliday
> Amtsgericht Köln HRB 9301
> 
> Internet communications are not secure and therefore Staufenbiel Institut
> GmbH does not accept legal responsibility
> for the contents of this message. Any views or opinions presented are
> solely those of the author and do not
> necessarily represent those of Staufenbiel Institut GmbH unless otherwise
> specifically stated.


Re: contribute mystery

Posted by Kristian Marinkovic <kr...@porscheinformatik.at>.
Hi Jens, 

the contribute methods are used for configuration... therefore there are 
only executed once on startup (... or on lazy load)
once your dispatcher is in place only your dispatcher will be called.

please re-read the tapestry-ioc documentation.

g,
kris




Von:    "Jens Reufsteck" <je...@staufenbiel.de>
An:     "'Tapestry users'" <us...@tapestry.apache.org>
Datum:  15.11.2010 09:32
Betreff:        contribute mystery



Hi,
 
I’m having some mystery going on when contributing a dispatcher. The 
dispatcher is always instantiated (according to the logs), but it’s used 
only sometimes. In some cases, when I start jetty (or tomcat), the 
dispatcher is used and then consequently it’s always used. But after a 
restart it’s not used, though I haven’t changed anything in the code.
 
Most puzzling to me: I’ve inserted 2 calls to System.out.println() in the 
contribute-method – and voila, the dispatcher is always used. As soon as I 
comment the two lines, it’s again like described above. See code below 
(this is T5.1).
 
Any help is much appreciated, no idea, where to look at.
 
 
    public static void contributeMasterDispatcher(
                        OrderedConfiguration<Dispatcher> dispatchers,
                        PageRenderRequestHandler renderer,
                        AuthenticationService auth,
                        Sitemap sitemap,
                        @Inject @Symbol ("loginPage") String loginPage) {
            
            Dispatcher authorizationDispatcher = new 
AuthorizationDispatcher(
                                   renderer,
                                   auth,
                                   sitemap,
                                   loginPage);
            
            //System.out.println("xxxxx Dispatcher initialized");
            
            dispatchers.add("AuthorizationDispatcher", 
authorizationDispatcher, "after:ComponentEvent", "before:PageRenderer");
            
            //System.out.println("xxxxxx Dispatcher contributed");      
    }
 
 
Many thanks
Jens
 
-- 
Jens Reufsteck
Marketing & Online Director 
Staufenbiel Institut GmbH
Events & Recruiting Solutions

Wildunger Straße 6, 60487 Frankfurt am Main
www.staufenbiel.de www.mba-master.de www.absolventenkongress.de

Tel.:    +49 (0)69 25537-140
Fax:    +49 (0)69 25537-2140

Employer Branding mit Effekt: Treffen Sie Ihre Zielgruppe auf 
staufenbiel.de, dem Karriereportal mit Relevanz – Download Mediadaten
Die reelle Bewerber-Plattform: Ihr Stand auf dem Absolventenkongress am 
24./25. November 2010 – Download Ausstellerunterlagen



Geschäftsführer: Judith Oppitz, Birgit Giesen, Graham Storey, Martin 
Halliday
Amtsgericht Köln HRB 9301

Internet communications are not secure and therefore Staufenbiel Institut 
GmbH does not accept legal responsibility 
for the contents of this message. Any views or opinions presented are 
solely those of the author and do not 
necessarily represent those of Staufenbiel Institut GmbH unless otherwise 
specifically stated.