Re: No service implements the interface java.util.Date.
Am 05.01.16 um 14:14 schrieb Thiago H de Paula Figueiredo: On Tue, 05 Jan 2016 09:03:59 -0200, Andreas Ernst wrote: Hi, Hi! "No service implements the interface XXX" means you're trying to inject a dependency of type XXX in some service or object created by ObjectLocator/Registry.autobuild(). The class you're editing in BeanEditForm, Tanken, probably has constructors other than a no-arg one and you're leaving the instantiation of Tanken to BeanEditForm/BeanEditor, which does that by calling ObjectLocator.autobuild(), which takes the constructor with the longest list of parameters then considers them as dependencies (services) to inject. Here's my proposed fix: instantiate the object yourself in your page: void onPrepare() { if (tanken == null) { tanken = new Tanken(); } } The 'prepare' event is triggered just before a Form is rendered (BeanEditForm uses this component internally) and also just before a form submission is handled, triggering the 'validate', 'success' and 'failure' events as needed. You saved my day. I think, i never would find to change setupRender to onPrepare. The other T5 project got onPrepare ... Thanks a lot! -- ae | Andreas Ernst | IT Spektrum Postfach 5, 65612 Beselich Schupbacher Str. 32, 65614 Beselich, Germany Tel: +49-6484-91002 Fax: +49-6484-91003 a...@ae-online.de | www.ae-online.de www.tachyon-online.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: No service implements the interface java.util.Date.
On Tue, 05 Jan 2016 09:03:59 -0200, Andreas Ernst wrote: Hi, Hi! "No service implements the interface XXX" means you're trying to inject a dependency of type XXX in some service or object created by ObjectLocator/Registry.autobuild(). The class you're editing in BeanEditForm, Tanken, probably has constructors other than a no-arg one and you're leaving the instantiation of Tanken to BeanEditForm/BeanEditor, which does that by calling ObjectLocator.autobuild(), which takes the constructor with the longest list of parameters then considers them as dependencies (services) to inject. Here's my proposed fix: instantiate the object yourself in your page: void onPrepare() { if (tanken == null) { tanken = new Tanken(); } } The 'prepare' event is triggered just before a Form is rendered (BeanEditForm uses this component internally) and also just before a form submission is handled, triggering the 'validate', 'success' and 'failure' events as needed. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: no service implements the interface java.util.Date
Use BeanEditForm "prepare" event to instantiate your Celebrity instead of letting BeanEditForm to do that. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: no service implements the interface java.util.Date
Hi ?. http://tapestry.apache.org/tapestry5/faq/general.html Cheers, nillehammer > While I'm using BeanEditForm component from T5.0.18, it throws an > error says "no servicie implements java.util.Date". My code is quite > simple. > > > > and Celebrity is just a POJO which has an constructor like "public > Celebrity(String firstName, String lastName,Date dateOfBirth)". I'm a > newbie and can't find any clue due to the poor documentation of > Tapestry. Could someone give me a hint or tell me which doc I should > read. Thanks a lot. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- http://www.winfonet.eu - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: no service implements the interface java.util.Date
你把缺省的构造去掉就可以了 否则T5IoC会去自动进行参数注入 注入的参数就会去找实现的service 找不到就报这个错误了 - Original Message - From: "孙立伟" To: "Tapestry users" Sent: Tuesday, March 03, 2009 1:57 PM Subject: no service implements the interface java.util.Date While I'm using BeanEditForm component from T5.0.18, it throws an error says "no servicie implements java.util.Date". My code is quite simple. and Celebrity is just a POJO which has an constructor like "public Celebrity(String firstName, String lastName,Date dateOfBirth)". I'm a newbie and can't find any clue due to the poor documentation of Tapestry. Could someone give me a hint or tell me which doc I should read. Thanks a lot. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org