This is some behavior that changes since the writing of the book.

When the BeanEditForm instantiates a new Celeberty instance, it now
uses the same code that instantiates service implementations (and
injects dependencies).  By default, Tapestry will find the constructor
with the most parameters for this purpose, and will attempt to match
each parameter to a service.

In this case, we don't want that behavior; we want BeanEditForm to
instantiate via the public no-arguments constructor.

By placing an @Inject annotation on the public no-arguments
constructor, we can direct BeanEditForm to use that constructor
instead.

2008/8/15 Heck, Bob <[EMAIL PROTECTED]>:
> Make sure Celebrity has a blank constructor and try again.
>
> Educated guess, not 100% sure this is the issue.
>
> Bob Heck
>
>
> -----Original Message-----
> From: ProAdmin Dariusz Dwornikowski [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 15, 2008 15:49
> To: [email protected]
> Subject: Beanedit problem - book example
>
> Hi, Im new to tapestry and this list.
> Im learnign tapestry using the book: Tapestry 5: Building web applications, 
> and there is the Celebrities application example. I use tapestry 5.0.13, but 
> when I try to do adding celebrity part i get
> exception:
> Page code:
>
> <t:beaneditform t:id="celebrity"/>
>
> ~~~~~
> Render queue error in SetupRender[AddCelebrity:celebrity.editor]:
> Exception instantiating instance of
> com.proadmin.celebrities.model.Celebrity (for component
> 'AddCelebrity:celebrity.editor'): Error invoking constructor 
> com.proadmin.celebrities.model.Celebrity(String, String, Date, Occupation, 
> String, boolean) (at Celebrity.java:35) (for service
> 'BeanModelSource'): No service implements the interface java.util.Date ~~~~~
>
> Celebrity.java is a normal POJO model.
>
> I suspect it is something Tapestry internal, that changed over time, but i 
> could not find any clues on google.
>
> --
>
> Pozdrawiam,
> Dariusz Dwornikowski
> ------------------------------------
> ProAdmin
> ul. Królowej Jadwigi 44/2
> 61-872 Poznań
> tel:  061 623-20-92
> fax: 061 623-20-93
> www.proadmin.com.pl
> [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

Reply via email to