No service implements the interface java.util.Date.
Hi, i got this error, and have to glue how to fix it. Because i got serveral other T5 apps with Timestamp without this issue. Information: [ERROR] ioc.Registry No service implements the interface java.util.Date. Information: [ERROR] ioc.Registry Operations trace: Information: [ERROR] ioc.Registry [ 1] Handling traditional 'action' component event request for Tank:tankform.form. Information: [ERROR] ioc.Registry [ 2] Triggering event 'action' on Tank:tankform.form Information: [ERROR] ioc.Registry [ 3] Instantiating new instance of de.aeits.erda.ccis.mariadb.Tanken Information: [ERROR] ioc.Registry [ 4] Creating plan to instantiate de.aeits.erda.ccis.mariadb.Tanken via public de.aeits.erda.ccis.mariadb.Tanken(java.util.Date,int,int,java.lang.String,int,int) Information: [ERROR] ioc.Registry [ 5] Determining injection value for parameter #1 (java.util.Date) Information: [ERROR] ioc.Registry [ 6] Resolving object of type java.util.Date using MasterObjectProvider Information: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: org.apache.tapestry5.runtime.ComponentEventException: Exception instantiating instance of de.aeits.erda.ccis.mariadb.Tanken (for component 'Tank:tankform.editor'): org.apache.tapestry5.ioc.internal.OperationException: No service implements the interface java.util.Date. [at classpath:org/apache/tapestry5/corelib/components/BeanEditForm.tml, line 2] org.apache.tapestry5.runtime.ComponentEventException: Exception instantiating instance of de.aeits.erda.ccis.mariadb.Tanken (for component 'Tank:tankform.editor'): org.apache.tapestry5.ioc.internal.OperationException: No service implements the interface java.util.Date. [at classpath:org/apache/tapestry5/corelib/components/BeanEditForm.tml, line 2] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1126) package de.aeits.ccis.pages; import de.aeits.ccis.components.Layout; import de.aeits.erda.ccis.mariadb.Tanken; import de.aeits.erda.ccis.mssql.Adresse; import de.aeits.erda.ccis.mssql.AuftragFahrzeug; import de.aeits.erda.ccis.mssql.Fahrzeug; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Locale; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.tapestry5.annotations.Component; import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.Log; import org.apache.tapestry5.annotations.Persist; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.beaneditor.BeanModel; import org.apache.tapestry5.corelib.components.BeanEditForm; import org.apache.tapestry5.jpa.annotations.CommitAfter; import org.apache.tapestry5.services.BeanModelSource; import org.slf4j.Logger; /** * * @author andreas */ @RequiresAuthentication public class Tank { @PersistenceContext(unitName = "de.aeits_ERDA-CCIS-EJB_ejb_1.01PU") private EntityManager entityManager; @PersistenceContext(unitName = "de.aeits_ERDA-CCIS-EJB_ejb_1.0PU") private EntityManager entityManagerMS; private Query query; @Component(id = "tankForm") private BeanEditForm tankForm; @InjectPage private Tank indexPage; @Property private Tanken tanken; @Property private Fahrzeug fahrzeug; private Adresse adresse; @Property private String email, fahrer; @Property @Persist String selectedValue;//= "UTA"; @Property @Persist String fahrzeugValue;// = "WWFD9988"; private final Locale locale = Locale.getDefault(); private Calendar jetzt = Calendar.getInstance(locale); @Property private Date datzeit = new Date(); @Property List fahrzeuge; @Log void setupRender() throws Exception { jetzt = Calendar.getInstance(); try { adresse = entityManagerMS.find(Adresse.class, Layout.getAdresse().getIDAdresse()); query = entityManagerMS.createNamedQuery("Fahrzeug.findByEigene"); List fahrzeugListe = query.getResultList(); fahrzeuge = new ArrayList(); for (Fahrzeug fahrzeug1 : fahrzeugListe) { fahrzeuge.add(fahrzeug1.getKennzeichen()); } adresse.getIDAdresse().intValue()); tanken = new Tanken(datzeit, 1, 1, "UTA", 600, 109585); fahrer = adresse.getSuchName(); query = entityManagerMS.createNamedQuery("AuftragFahrzeug.findByFahrer"); query.setParameter("iDFahrer", adresse.getIDAdresse()); query.setParameter("datzeit", jetzt.getTime()); List auftragFahrzeug = query.getResultList(); for (AuftragFahrzeug at : auftragFahrzeug) { if (String.valueOf(at.getIDAuftragFS().getStatus()).equals("F") | String.valueOf(at.getID
Re: No service implements the interface java.util.Date.
On Tue, 05 Jan 2016 09:03:59 -0200, Andreas Ernstwrote: 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.
Am 05.01.16 um 14:14 schrieb Thiago H de Paula Figueiredo: On Tue, 05 Jan 2016 09:03:59 -0200, Andreas Ernstwrote: 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
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
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. t:beaneditform t:id=celebrity / 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
Re: no service implements the interface java.util.Date
你把缺省的构造去掉就可以了 否则T5IoC会去自动进行参数注入 注入的参数就会去找实现的service 找不到就报这个错误了 - Original Message - From: 孙立伟 dante@gmail.com To: Tapestry users users@tapestry.apache.org 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. t:beaneditform t:id=celebrity / 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
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. t:beaneditform t:id=celebrity / 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