tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship (JIRA)" <tapestry-...@jakarta.apache.org>
Subject [jira] Commented: (TAPESTRY-696) Race condition during page loading can cause anomoylous exceptions related to annotations
Date Fri, 07 Oct 2005 15:28:50 GMT
    [ http://issues.apache.org/jira/browse/TAPESTRY-696?page=comments#action_12331602 ] 

Howard M. Lewis Ship commented on TAPESTRY-696:
-----------------------------------------------

I believe the culprit is ComponentConstructorFactoryImpl.getComponentConstructor().

This method encapsulates the entire enhancement process, including the part where annoations
updated the component specification.

The method isn't synchronized, but is a classic null-check situation.

I'm adding a synchronized block that synchronizes on the component specification object. I
think that is safe, and will provide the best throughput (rather than just adding a synchronized
modifier to the method). This will allow multiple threads to enhance different components
or pages simultaneously.



> Race condition during page loading can cause anomoylous exceptions related to annotations
> -----------------------------------------------------------------------------------------
>
>          Key: TAPESTRY-696
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-696
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>     Reporter: Howard M. Lewis Ship
>     Assignee: Howard M. Lewis Ship
>     Priority: Blocker

>
> Been seeing a trickle of thsee on the mailing lists, under load, Tapestry may try to
enhance the same class twice and the annotations (many of which work by modifying the in-memory
component specification) cause exceptions as they conflict with themselves.
> 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)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message