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(ComponentSpecification.java:674)
*
org.apache.tapestry.spec.ComponentSpecification.addInjectSpecification(ComponentSpecification.java:645)
*
org.apache.tapestry.annotations.InjectStateAnnotationWorker.performEnhancement(InjectStateAnnotationWorker.java:49)
*
org.apache.tapestry.annotations.AnnotationEnhancementWorker.performMethodEnhancement(AnnotationEnhancementWorker.java:125)
*
org.apache.tapestry.annotations.AnnotationEnhancementWorker.performMethodEnhancement(AnnotationEnhancementWorker.java:108)
*
org.apache.tapestry.annotations.AnnotationEnhancementWorker.performEnhancement(AnnotationEnhancementWorker.java:68)
*
$EnhancementWorker_106b7b9f8bb.performEnhancement($EnhancementWorker_106b7b9f8bb.java)
*
$EnhancementWorker_106b7b9f8bd.performEnhancement($EnhancementWorker_106b7b9f8bd.java)
*
$EnhancementWorker_106b7b9f89d.performEnhancement($EnhancementWorker_106b7b9f89d.java)
*
org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl.getComponentConstructor(ComponentConstructorFactoryImpl.java:79)
*
$ComponentConstructorFactory_106b7b9f888.getComponentConstructor($ComponentConstructorFactory_106b7b9f888.java)
*
org.apache.tapestry.pageload.PageLoader.instantiateComponent(PageLoader.java:565)
*
org.apache.tapestry.pageload.PageLoader.createImplicitComponent(PageLoader.java:515)
*
$IPageLoader_106b7b9f882.createImplicitComponent($IPageLoader_106b7b9f882.java)
*
$IPageLoader_106b7b9f883.createImplicitComponent($IPageLoader_106b7b9f883.java)
*
org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.createImplicitComponent(ComponentTemplateLoaderLogic.java:218)
*
org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.process(ComponentTemplateLoaderLogic.java:172)
*
org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.process(ComponentTemplateLoaderLogic.java:111)
*
org.apache.tapestry.services.impl.ComponentTemplateLoaderLogic.loadTemplate(ComponentTemplateLoaderLogic.java:88)
*
org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl.loadTemplate(ComponentTemplateLoaderImpl.java:60)
*
$ComponentTemplateLoader_106b7b9f88c.loadTemplate($ComponentTemplateLoader_106b7b9f88c.java)
*
org.apache.tapestry.pageload.PageLoader.loadTemplateForComponent(PageLoader.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.java: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(EngineServiceOuterProxy.java:65)
*
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:248)
*
org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
*
$WebRequestServicer_106b7b9f84d.service($WebRequestServicer_106b7b9f84d.java)
*
org.apache.tapestry.services.impl.DisableCachingFilter.service(DisableCachingFilter.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.service(WebRequestServicerPipelineBridge.java:56)
*
$ServletRequestServicer_106b7b9f82d.service($ServletRequestServicer_106b7b9f82d.java)
*
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
*
$ServletRequestServicerFilter_106b7b9f829.service($ServletRequestServicerFilter_106b7b9f829.java)
*
$ServletRequestServicer_106b7b9f82f.service($ServletRequestServicer_106b7b9f82f.java)
*
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
*
$ServletRequestServicerFilter_106b7b9f827.service($ServletRequestServicerFilter_106b7b9f827.java)
*
$ServletRequestServicer_106b7b9f82f.service($ServletRequestServicer_106b7b9f82f.java)
*
org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
*
$ServletRequestServicerFilter_106b7b9f82b.service($ServletRequestServicerFilter_106b7b9f82b.java)
*
$ServletRequestServicer_106b7b9f82f.service($ServletRequestServicer_106b7b9f82f.java)
*
$ServletRequestServicer_106b7b9f821.service($ServletRequestServicer_106b7b9f821.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(WebApplicationHandler.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(WebApplicationContext.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]