Try changing to: @InjectObject("engine-service:ical") public abstract IEngineService getIcal();
On 10/28/06, Warner Onstine <[EMAIL PROTECTED]> wrote:
Ok, I've updated the getName(): public String getName() { return "ical"; } which now matches the definition in the hivemodule.xml: <contribution configuration-id=" tapestry.services.ApplicationServices"> <service name="ical" object="service:ICalService" /> </contribution> <service-point id="ICalService" interface="org.apache.tapestry.engine.IEngineService"> <invoke-factory model="singleton"> <construct class="ICalService"> <set-object property="eventDAO" value="spring:eventDAO"/> </construct> </invoke-factory> </service-point> When I hit UpcomingEvents.html I still get the stack trace and nothing in the console (catalina.out) about the service being discarded. Here is the complete stack trace: No engine service named '<SingletonProxy for eventscalendar.ICalService(org.apache.tapestry.engine.IEngineService) >' is available. Stack Trace: org.apache.tapestry.services.impl.ServiceMapImpl.buildProxy (ServiceMapImpl.java:143) org.apache.tapestry.services.impl.ServiceMapImpl.getService (ServiceMapImpl.java:105) $ServiceMap_10e90805ee1.getService($ServiceMap_10e90805ee1.java) org.apache.tapestry.engine.AbstractEngine.getService (AbstractEngine.java:164) org.apache.tapestry.link.AbstractLinkComponent.getLink (AbstractLinkComponent.java:197) org.apache.tapestry.link.ServiceLink.getLink(ServiceLink.java:38) org.apache.tapestry.link.DefaultLinkRenderer.constructURL (DefaultLinkRenderer.java:112) org.apache.tapestry.link.DefaultLinkRenderer.renderLink (DefaultLinkRenderer.java:62) org.apache.tapestry.link.AbstractLinkComponent.renderComponent (AbstractLinkComponent.java:95) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.AbstractComponent.renderBody (AbstractComponent.java:434) org.apache.tapestry.components.RenderBody.renderComponent (RenderBody.java:44) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.AbstractComponent.renderBody (AbstractComponent.java:434) org.apache.tapestry.html.Body.renderComponent(Body.java:129) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.AbstractComponent.renderBody (AbstractComponent.java:434) org.apache.tapestry.html.Shell.renderComponent(Shell.java:115) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92) org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617) org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:275) org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java: 366) org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse (ResponseRendererImpl.java:71) $ResponseRenderer_10e90805ec8.renderResponse ($ResponseRenderer_10e90805ec8.java) $ResponseRenderer_10e90805ec7.renderResponse ($ResponseRenderer_10e90805ec7.java) org.apache.tapestry.engine.HomeService.service(HomeService.java:65) $IEngineService_10e90805f2d.service($IEngineService_10e90805f2d.java) org.apache.tapestry.services.impl.EngineServiceInnerProxy.service (EngineServiceInnerProxy.java:77) org.apache.tapestry.services.impl.EngineServiceOuterProxy.service (EngineServiceOuterProxy.java:66) org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java: 248) org.apache.tapestry.services.impl.InvokeEngineTerminator.service (InvokeEngineTerminator.java:60) $WebRequestServicer_10e90805f10.service ($WebRequestServicer_10e90805f10.java) $WebRequestServicer_10e90805f0f.service ($WebRequestServicer_10e90805f0f.java) $WebRequestServicer_10e90805f0c.service ($WebRequestServicer_10e90805f0c.java) $WebRequestServicer_10e90805f0b.service ($WebRequestServicer_10e90805f0b.java) org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.servi ce(WebRequestServicerPipelineBridge.java:56) $ServletRequestServicer_10e90805ef2.service ($ServletRequestServicer_10e90805ef2.java) $ServletRequestServicer_10e90805ef1.service ($ServletRequestServicer_10e90805ef1.java) org.apache.tapestry.request.DecodedRequestInjector.service (DecodedRequestInjector.java:55) $ServletRequestServicerFilter_10e90805eee.service ($ServletRequestServicerFilter_10e90805eee.java) $ServletRequestServicerFilter_10e90805eed.service ($ServletRequestServicerFilter_10e90805eed.java) $ServletRequestServicer_10e90805ef3.service ($ServletRequestServicer_10e90805ef3.java) org.apache.tapestry.multipart.MultipartDecoderFilter.service (MultipartDecoderFilter.java:52) $ServletRequestServicerFilter_10e90805eec.service ($ServletRequestServicerFilter_10e90805eec.java) $ServletRequestServicerFilter_10e90805eeb.service ($ServletRequestServicerFilter_10e90805eeb.java) $ServletRequestServicer_10e90805ef3.service ($ServletRequestServicer_10e90805ef3.java) org.apache.tapestry.services.impl.SetupRequestEncoding.service (SetupRequestEncoding.java:53) $ServletRequestServicerFilter_10e90805ef0.service ($ServletRequestServicerFilter_10e90805ef0.java) $ServletRequestServicerFilter_10e90805eef.service ($ServletRequestServicerFilter_10e90805eef.java) $ServletRequestServicer_10e90805ef3.service ($ServletRequestServicer_10e90805ef3.java) $ServletRequestServicer_10e90805ee6.service ($ServletRequestServicer_10e90805ee6.java) $ServletRequestServicer_10e90805ee5.service ($ServletRequestServicer_10e90805ee5.java) org.apache.tapestry.ApplicationServlet.doService (ApplicationServlet.java:123) org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:79) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:237) org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:157) org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:214) org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) org.apache.catalina.core.StandardContextValve.invokeInternal (StandardContextValve.java:198) org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:152) org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:137) org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:118) org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:102) org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109) org.apache.catalina.core.StandardValveContext.invokeNext (StandardValveContext.java:104) org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:520) org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 799) org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.processConnection(Http11Protocol.java:705) org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java: 577) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:683) java.lang.Thread.run(Thread.java:613) UpcomingEvents.java (should be the important bits): @InjectObject("service:eventscalendar.ICalService") public abstract IEngineService getIcal(); public ICalService.CalendarType getCalendarType() { return CalendarType.Week; } Let me know if you need more. -warner On Oct 28, 2006, at 10:02 AM, Howard Lewis Ship wrote: > Also, check the console, there should be a log error. > > My current theory: service "ical" was discarded because the names > didn't > match AND the code that outputs the "missing engine service" error > message > is broken. > > On 10/28/06, Howard Lewis Ship <[EMAIL PROTECTED]> wrote: >> >> First problem I see: >> >> hivemodule.xml: >> <service name="ical" object="service:ICalService" /> >> >> public String getName() { >> return "ICalService"; >> } >> >> These need to be the same string. Tapestry is checking that the >> engine >> service knows its own name, in case it generates any links. >> >> I don't think that's your root problem. >> >> I need to see the code from UpcomingEvents.java and a readable and >> complete stack trace. >> >> On 10/27/06, Warner Onstine <[EMAIL PROTECTED]> wrote: >> > >> > Hi all, >> > I'm having some difficulties injecting a service, when I reference >> > the service through a @ServiceLink I get this exception: >> > org.apache.hivemind.ApplicationRuntimeException >> > No engine service named '<SingletonProxy for >> > eventscalendar.ICalService >> (org.apache.tapestry.engine.IEngineService)>' >> > is available. >> > Stack Trace: >> > >> > * >> > org.apache.tapestry.services.impl.ServiceMapImpl.buildProxy >> (ServiceMapIm >> > pl.java:143) >> > * >> > org.apache.tapestry.services.impl.ServiceMapImpl.getService >> (ServiceMapIm >> > pl.java:105) >> > * $ServiceMap_10e8b71c9d5.getService >> ($ServiceMap_10e8b71c9d5.java) >> > * >> > org.apache.tapestry.engine.AbstractEngine.getService ( >> > AbstractEngine.java >> > :164) >> > * >> > org.apache.tapestry.link.AbstractLinkComponent.getLink >> (AbstractLinkCompo >> > nent.java:197) >> > * org.apache.tapestry.link.ServiceLink.getLink >> (ServiceLink.java:38) >> > * >> > org.apache.tapestry.link.DefaultLinkRenderer.constructURL >> (DefaultLinkRen >> > derer.java:112) >> > * >> > org.apache.tapestry.link.DefaultLinkRenderer.renderLink >> (DefaultLinkRende >> > rer.java:62) >> > >> > >> > Here is my setup: >> > hivemodule.xml >> > <module id="eventscalendar" version="4.0.0" >> > package="com.sourcebeat.tap101.services"> >> > <contribution configuration- >> > id="tapestry.services.ApplicationServices "> >> > <service name="ical" >> object="service:ICalService" /> >> > </contribution> >> > >> > >> > <service-point id="ICalService" >> > interface=" >> org.apache.tapestry.engine.IEngineService"> >> > <invoke-factory model="singleton"> >> > <construct class="ICalService"> >> > <set-object property="eventDAO" >> > value="spring:eventDAO"/> >> > </construct> >> > </invoke-factory> >> > </service-point> >> > </module> >> > >> > UpcomingEvents.java (all but the injection ommitted) >> > @InjectObject("service: eventscalendar.ICalService") >> > public abstract IEngineService getIcal(); >> > >> > UpcomingEvents.html (servicelink call) >> > <a href="WeeksEvents.ics" jwcid="@ServiceLink" service="ognl:ical" >> > parameters="ognl:calendarType"/> >> > >> > Now one thing I'm not sure on is my service implements the >> > IEngineService but it returns null on the getLink(), I don't >> know if >> > this is the root cause of the error or not. But I thought I'd shoot >> > this off before testing that theory out. >> > >> > >> --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> > >> >> >> -- >> Howard M. Lewis Ship >> TWD Consulting, Inc. >> Independent J2EE / Open-Source Java Consultant >> Creator and PMC Chair, Apache Tapestry >> Creator, Apache HiveMind >> >> Professional Tapestry training, mentoring, support >> and project work. http://howardlewisship.com > > > > > -- > Howard M. Lewis Ship > TWD Consulting, Inc. > Independent J2EE / Open-Source Java Consultant > Creator and PMC Chair, Apache Tapestry > Creator, Apache HiveMind > > Professional Tapestry training, mentoring, support > and project work. http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com