We're currently trying to get a handle on the exact same problem, but we experience under different circumstances.
All of our pages implement a VisitHolder interface, which injects the Visit. This concept was described on Howard's blog (http://howardlewisship.com/blog/2005/06/annotations-bytecode-generation -mixins.html). Currently if two requests come in for the same page at the same time, one of the requests will receive this same stack trace. I agree with your assessment that this looks like a bug, but I'll investigate you're workaround and see if we can make that work as a stop-gap. -----Original Message----- From: Shawn Church [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 04, 2005 10:12 AM To: [email protected] Subject: Re: InjectState exception within activateExternalPage The only solution (work-around) I could come up with for this problem is to replace this in my Border component: @InjectState("visit") public abstract Visit getVisitObject(); with this: @InjectObject("infrastructure:applicationStateManager") public abstract ApplicationStateManager getApplicationStateManager(); public Visit getVisitObject() { return (Visit) getApplicationStateManager().get("visit"); } By the way, I'm using Tapestry 4 beta-9. I assume this is a bug, but the work-around seems to be working for now. Shawn Quoting Shawn Church <[EMAIL PROTECTED]>: > I'm converting one of my Tapestry 3 apps to version 4. Since the > AbstractPage implementation of getVisit() is deprecated, I have > refactored by pages to inject the visit as > > @InjectState("visit") > public abstract Visit getVisitObject(); > > I'm also doing this in my Border object. This has all been working > fine, but I'm now encountering an exception when requesting a page > using > the external service (within activateExternalPage). > > The process here is basically handling a "My Account" feature: > > 1. An outside application makes a request to a Login page (a page > which > implements IExternalPage within the failing app). > > 2. Within activateExternalPage, the app determines if the user is > logged > in (by observing the Visit object). > > 3. If logged in, activate the desired page (in this case, a > ViewProfile > page). > > I'm getting an ApplicationRuntimeException on this line: > > ViewProfile viewProfile = ( ViewProfile ) > cycle.getPage("ViewProfile"); > > stating: > > Error: An error occured processing annotation > @org.apache.tapestry.annotations.InjectState(value=visit) of public > abstract com.mcelroy.auth.Visit > com.mcelroy.auth.component.Border.getVisitObject(): Property > visitObject > has already been accounted for by the element at Annotation > @org.apache.tapestry.annotations.InjectState(value=visit) of public > abstract com.mcelroy.auth.Visit > com.mcelroy.auth.component.Border.getVisitObject(). > > Am I doing something wrong here? I can transition from page-to-page > without any trouble as long as I'm not entering the app through the > external service. > > In case it's useful, here's the full stack trace: > > * > org.apache.tapestry.spec.ComponentSpecification.claimProperty(ComponentS pecification.java:674) > * > org.apache.tapestry.spec.ComponentSpecification.addInjectSpecification(C omponentSpecification.java:645) > * > org.apache.tapestry.annotations.InjectStateAnnotationWorker.performEnhan cement(InjectStateAnnotationWorker.java:49) > * > org.apache.tapestry.annotations.AnnotationEnhancementWorker.performMetho dEnhancement(AnnotationEnhancementWorker.java:125) > * > org.apache.tapestry.annotations.AnnotationEnhancementWorker.performMetho dEnhancement(AnnotationEnhancementWorker.java:108) > * > org.apache.tapestry.annotations.AnnotationEnhancementWorker.performEnhan cement(AnnotationEnhancementWorker.java:68) > * > $EnhancementWorker_106b7b9f8bb.performEnhancement($EnhancementWorker_106 b7b9f8bb.java) > * > $EnhancementWorker_106b7b9f8bd.performEnhancement($EnhancementWorker_106 b7b9f8bd.java) > * > $EnhancementWorker_106b7b9f89d.performEnhancement($EnhancementWorker_106 b7b9f89d.java) > * > org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl.getCom ponentConstructor(ComponentConstructorFactoryImpl.java:79) > * > $ComponentConstructorFactory_106b7b9f888.getComponentConstructor($Compon entConstructorFactory_106b7b9f888.java) > * > org.apache.tapestry.pageload.PageLoader.instantiateComponent(PageLoader. java:565) > * > org.apache.tapestry.pageload.PageLoader.createImplicitComponent(PageLoad er.java:515) > * > $IPageLoader_106b7b9f882.createImplicitComponent($IPageLoader_106b7b9f88 2.java) > * > $IPageLoader_106b7b9f883.createImplicitComponent($IPageLoader_106b7b9f88 3.java) > * > org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.createImp licitComponent(ComponentTemplateLoaderLogic.java:218) > * > org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.process(C omponentTemplateLoaderLogic.java:172) > * > org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.process(C omponentTemplateLoaderLogic.java:111) > * > org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.loadTempl ate(ComponentTemplateLoaderLogic.java:88) > * > org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl.loadTempla te(ComponentTemplateLoaderImpl.java:60) > * > $ComponentTemplateLoader_106b7b9f88c.loadTemplate($ComponentTemplateLoad er_106b7b9f88c.java) > * > org.apache.tapestry.pageload.PageLoader.loadTemplateForComponent(PageLoa der.java:671) > * > org.apache.tapestry.BaseComponent.readTemplate(BaseComponent.java:77) > * > org.apache.tapestry.BaseComponent.finishLoad(BaseComponent.java:107) > * $ViewProfile_41.finishLoad($ViewProfile_41.java) > * > org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.ja va:473) > * > org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:642) > * > $IPageLoader_106b7b9f882.loadPage($IPageLoader_106b7b9f882.java) > * > $IPageLoader_106b7b9f883.loadPage($IPageLoader_106b7b9f883.java) > * > org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:118) > * > $IPageSource_106b7b9f7ed.getPage($IPageSource_106b7b9f7ed.java) > * > org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:265) > * > org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:248) > * > com.mcelroy.auth.pages.Login.activateExternalPage(Login.java:216) > * > org.apache.tapestry.engine.ExternalService.service(ExternalService.java: 160) > * > $IEngineService_106b7b9f87a.service($IEngineService_106b7b9f87a.java) > * > org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(Engine ServiceOuterProxy.java:65) > * > org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:24 8) > * > org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeE ngineTerminator.java:60) > * > $WebRequestServicer_106b7b9f84d.service($WebRequestServicer_106b7b9f84d. java) > * > org.apache.tapestry.services.impl.DisableCachingFilter.service(DisableCa chingFilter.java:48) > * > $WebRequestServicerFilter_106b7b9f84f.service($WebRequestServicerFilter_ 106b7b9f84f.java) > * > $WebRequestServicer_106b7b9f851.service($WebRequestServicer_106b7b9f851. java) > * > $WebRequestServicer_106b7b9f849.service($WebRequestServicer_106b7b9f849. java) > * > org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.servi ce(WebRequestServicerPipelineBridge.java:56) > * > $ServletRequestServicer_106b7b9f82d.service($ServletRequestServicer_106b 7b9f82d.java) > * > org.apache.tapestry.request.DecodedRequestInjector.service(DecodedReques tInjector.java:55) > * > $ServletRequestServicerFilter_106b7b9f829.service($ServletRequestService rFilter_106b7b9f829.java) > * > $ServletRequestServicer_106b7b9f82f.service($ServletRequestServicer_106b 7b9f82f.java) > * > org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDe coderFilter.java:52) > * > $ServletRequestServicerFilter_106b7b9f827.service($ServletRequestService rFilter_106b7b9f827.java) > * > $ServletRequestServicer_106b7b9f82f.service($ServletRequestServicer_106b 7b9f82f.java) > * > org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequ estEncoding.java:53) > * > $ServletRequestServicerFilter_106b7b9f82b.service($ServletRequestService rFilter_106b7b9f82b.java) > * > $ServletRequestServicer_106b7b9f82f.service($ServletRequestServicer_106b 7b9f82f.java) > * > $ServletRequestServicer_106b7b9f821.service($ServletRequestServicer_106b 7b9f821.java) > * > org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java :141) > * > org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:97) > * javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > * javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > * > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427) > * > org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH andler.java:475) > * > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567) > * org.mortbay.http.HttpContext.handle(HttpContext.java:1565) > * > org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon text.java:635) > * org.mortbay.http.HttpContext.handle(HttpContext.java:1517) > * org.mortbay.http.HttpServer.service(HttpServer.java:954) > * > org.mortbay.http.HttpConnection.service(HttpConnection.java:814) > * > org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981) > * > org.mortbay.http.HttpConnection.handle(HttpConnection.java:831) > * > org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244 ) > * > org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) > * > org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) > > > Thanks, > Shawn > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
