Have a look at the ApplicationStateManager. It is responsible for
instantiating SessionStateObjects (aka ApplicationStateObjects), that can't
be created with new.

HTH,
Olle


2009/7/29 xfile80303 <l...@grokers.net>

>
> Thanks Thiago,
>
> Your insight, as always, is appreciated.
>
> Unfortunately there seems to be a snag...
>
> In my page I have this:
>
>        @SessionState
>        private User ssUser;
>
> In my Module I have this:
>
>        public static void bind(ServiceBinder binder)
>        {
>                //...
>                binder.bind(User.class, UserImpl.class);
>                //...
>        }
>
> (I've commented out the contribution of the new service scope for now)
>
> and I get this:
>
> org.apache.tapestry5.runtime.ComponentEventException
> Class com.java.dse.cwp.eos.idm.User does not contain a public constructor
> needed to autobuild.
>
> It's as if Tapestry does not recognize the binding.  Other bindings I have
> work as expected... is there something special about SessionState objects?
>
> BTW, User and UserImpl are in my services package, with my other, working,
> bound services.
>
> Thanks,
>
> Levi
>
>
> Thiago H. de Paula Figueiredo wrote:
> >
> > Hi!
> >
> > I guess you need a new service scope. Tapestry-IoC provides two
> > out-of-the-box: singleton (default) and per-thread (one object created
> for
> > each different thread). You can add a new lifecycle that always returns a
> > new object. In Spring, this is called the prototype scope.
> >
> http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/ioc/annotations/Scope.html
> > will give you some hints about how to add new scopes.
> >
> > A less elegant solution is to inject ObjectLocator and use its
> autobuild()
> > method.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > http://www.arsmachina.com.br/thiago
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/-T5.1--Avoiding-%22new%22-tp3346190p3346523.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se

Reply via email to