You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Daniel Kleine-Albers (JIRA)" <de...@tapestry.apache.org> on 2008/02/26 17:44:51 UTC

[jira] Commented: (TAPESTRY-1556) EventConnectionVisitor is sometimes not wired properly

    [ https://issues.apache.org/jira/browse/TAPESTRY-1556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572554#action_12572554 ] 

Daniel Kleine-Albers commented on TAPESTRY-1556:
------------------------------------------------

I had a similar problem some months ago. Here's the scenario I was having trouble with and posted to the ML (http://mail-archives.apache.org/mod_mbox/tapestry-users/200708.mbox/%3cA7244006-EA35-4AED-9147-AA4A6A0BA239@dka-edv.net%3e):

Component C has a form in it that contains a Suggest component. An EventListener is attached to that suggest field (on the onblur event). I found out that I needed to specify the submitForm parameter for this event listener to actually get the form data submitted.

C is embedded in pages A and B. As long as I turn off caching everything works fine. As soon as I turn on caching and access only page A everything's fine as well, but as soon as I access page B after page A has been accessed (also if not triggering the event) I get the following Exception (also happens if accessing A after B so I exclude a problem with this particular page):

No component found in tree for EventListener binding with a matching component id of A/$component...C.

The whole stacktrace follows below. I've searched the archives and found some references that this behavior might be solved if I use an explicit component specification (instead of using annotations) - so I tried that but it didn't make a difference.

What I think is strange is that it searches a component on Page B which has actually its component id prefixed by the name of Page A - this sounds a bit like some variables not getting recalculated correctly when borrowing the component from the pool.

Here's the complete error and stack trace:

No component found in tree for EventListener binding with a matching component id of ValidateEmail/$CPublicBorder.$CRegistration.registrationForm.

Stack Trace:

   * org.apache.tapestry.pageload.EventConnectionVisitor.wireElementFormEvents(EventConnectionVisitor.java:114)
   * org.apache.tapestry.pageload.EventConnectionVisitor.visitComponent(EventConnectionVisitor.java:86)
   * $IComponentVisitor_1144d16ac97.visitComponent($IComponentVisitor_1144d16ac97.java)
   * $IComponentVisitor_1144d16ac98.visitComponent($IComponentVisitor_1144d16ac98.java)
   * org.apache.tapestry.pageload.ComponentTreeWalker.walkComponentTree(ComponentTreeWalker.java:45)
   * org.apache.tapestry.pageload.ComponentTreeWalker.walkComponentTree(ComponentTreeWalker.java:57)
   * org.apache.tapestry.pageload.ComponentTreeWalker.walkComponentTree(ComponentTreeWalker.java:57)
   * org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:655)
   * $IPageLoader_1144d16ac85.loadPage($IPageLoader_1144d16ac85.java)
   * $IPageLoader_1144d16ac86.loadPage($IPageLoader_1144d16ac86.java)
   * org.apache.tapestry.pageload.PageSource.makeObject(PageSource.java:153)
   * org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:797)
   * org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:177)
   * $IPageSource_1144d16abe2.getPage($IPageSource_1144d16abe2.java)
   * org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:239)
   * org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:226)
   * org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:559)
   * org.apache.tapestry.engine.PageService.service(PageService.java:66)
   * $IEngineService_1144d16ac6c.service($IEngineService_1144d16ac6c.java)
   * org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:72)
   * org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:237)
   * org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:54)
   * $WebRequestServicer_1144d16ac48.service($WebRequestServicer_1144d16ac48.java)
   * $WebRequestServicer_1144d16ac44.service($WebRequestServicer_1144d16ac44.java)
   * org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:61)
   * $ServletRequestServicer_1144d16ac2a.service($ServletRequestServicer_1144d16ac2a.java)
   * org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
   * $ServletRequestServicerFilter_1144d16ac26.service($ServletRequestServicerFilter_1144d16ac26.java)
   * $ServletRequestServicer_1144d16ac2c.service($ServletRequestServicer_1144d16ac2c.java)
   * org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
   * $ServletRequestServicerFilter_1144d16ac24.service($ServletRequestServicerFilter_1144d16ac24.java)
   * $ServletRequestServicer_1144d16ac2c.service($ServletRequestServicer_1144d16ac2c.java)
   * org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
   * $ServletRequestServicerFilter_1144d16ac28.service($ServletRequestServicerFilter_1144d16ac28.java)
   * $ServletRequestServicer_1144d16ac2c.service($ServletRequestServicer_1144d16ac2c.java)
   * $ServletRequestServicer_1144d16ac1e.service($ServletRequestServicer_1144d16ac1e.java)
   * org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:126)
   * org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:103)
   * javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
   * javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   * org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
   * org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
   * com.dkaedv.util.HibernateFilter.doFilter(HibernateFilter.java:33)
   * org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
   * org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
   * org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
   * org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
   * org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
   * org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
   * org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
   * org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
   * org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
   * org.mortbay.jetty.Server.handle(Server.java:285)
   * org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
   * org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
   * org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
   * org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
   * org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
   * org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
   * org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

> EventConnectionVisitor is sometimes not wired properly
> ------------------------------------------------------
>
>                 Key: TAPESTRY-1556
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1556
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 4.1.1
>            Reporter: Lionel Touati
>            Assignee: Jesse Kuhnert
>             Fix For: 4.1.6
>
>
> The method wireElementFormEvents is sometimes broken. When comparing listener.getFormId() to f.getId(), get different results. Sometimes the ids for the same page, same component the id match, but after a tomcat restart, the ids won't match as getFormId returns the form extended id rather than the local one.
> I've changed the method to :
>  void wireElementFormEvents(EventBoundListener listener, IComponent component, IComponentSpecification spec)
>     {
>         if (listener.getFormId() == null)
>             return;
>         if (_forms.size() < 1)
>             discoverPageForms(component.getPage());
>         IForm form = null;
>         for (int i=0; i < _forms.size(); i++) {
>             IForm f = (IForm) _forms.get(i);
>             if (listener.getFormId().equals(f.getExtendedId()) || listener.getFormId().equals(f.getId())) {
>                 form = f;
>                 break;
>             }
>         }
>         // couldn't find the form they specified
>         if (form == null)
>             throw new ApplicationRuntimeException(PageloadMessages.componentNotFound(listener.getFormId()), component, component.getLocation(), null);
>         String idPath = form.getExtendedId();
>         
>         listener.setFormId(idPath);
>         _invoker.addFormEventListener(idPath, spec);
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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