You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ProAdmin Dariusz Dwornikowski <da...@proadmin.com.pl> on 2008/08/15 22:48:45 UTC

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
dariusz.dwornikowski@proadmin.com.pl

Re: Beanedit problem - book example

Posted by Howard Lewis Ship <hl...@gmail.com>.
I'm sorry, that was not accurate.

The BeanEditForm component fires a prepare event.  You can supply an
onPrepare() event handler method that can instantiate the bean as you
see fit.  This bypasses the logic inside BeanEditForm to instantiate
the bean for you.

On Sun, Aug 17, 2008 at 6:12 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
> There's another option; you can contribute to the
> ApplicationStateManager service, providing an ApplicationStateCreator
> for your bean.
>
> On Sun, Aug 17, 2008 at 2:04 AM, Andy Pahne <ap...@net22.de> wrote:
>>
>> I have the same problem. Unfortunately I cannot add the @Inject annotation
>>  to the class in question, because it is a company wide library and their
>> maintainers rejected to add web related annotations to the companies core
>> business objects.
>>
>> The only solution that came to my mind was using a DTO. Or just building a
>> regular form and not using BeanEditForm at all.
>>
>> Andy
>>
>>
>> Howard Lewis Ship wrote:
>>>
>>> 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.
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Beanedit problem - book example

Posted by Howard Lewis Ship <hl...@gmail.com>.
There's another option; you can contribute to the
ApplicationStateManager service, providing an ApplicationStateCreator
for your bean.

On Sun, Aug 17, 2008 at 2:04 AM, Andy Pahne <ap...@net22.de> wrote:
>
> I have the same problem. Unfortunately I cannot add the @Inject annotation
>  to the class in question, because it is a company wide library and their
> maintainers rejected to add web related annotations to the companies core
> business objects.
>
> The only solution that came to my mind was using a DTO. Or just building a
> regular form and not using BeanEditForm at all.
>
> Andy
>
>
> Howard Lewis Ship wrote:
>>
>> 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.
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Beanedit problem - book example

Posted by Andy Pahne <ap...@net22.de>.
I have the same problem. Unfortunately I cannot add the @Inject 
annotation  to the class in question, because it is a company wide 
library and their maintainers rejected to add web related annotations to 
the companies core business objects.

The only solution that came to my mind was using a DTO. Or just building 
a regular form and not using BeanEditForm at all.

Andy


Howard Lewis Ship wrote:
> 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.
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Beanedit problem - book example

Posted by ProAdmin Dariusz Dwornikowski <da...@proadmin.com.pl>.
Thank YOU  !! It solved problem.

Now i can proceed with my tapestry education :)

W dniu 16 sierpnia 2008 00:11 użytkownik Howard Lewis Ship
<hl...@gmail.com> napisał:
> 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 <bo...@eds.com>:
>> 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:dariusz.dwornikowski@proadmin.com.pl]
>> Sent: Friday, August 15, 2008 15:49
>> To: users@tapestry.apache.org
>> 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
>> dariusz.dwornikowski@proadmin.com.pl
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>



-- 

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
dariusz.dwornikowski@proadmin.com.pl

Re: Beanedit problem - book example

Posted by Howard Lewis Ship <hl...@gmail.com>.
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 <bo...@eds.com>:
> 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:dariusz.dwornikowski@proadmin.com.pl]
> Sent: Friday, August 15, 2008 15:49
> To: users@tapestry.apache.org
> 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
> dariusz.dwornikowski@proadmin.com.pl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

RE: Beanedit problem - book example

Posted by "Heck, Bob" <bo...@eds.com>.
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:dariusz.dwornikowski@proadmin.com.pl] 
Sent: Friday, August 15, 2008 15:49
To: users@tapestry.apache.org
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
dariusz.dwornikowski@proadmin.com.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org