2 Replies Latest reply on Feb 18, 2009 11:56 AM by Ingo Jobling

    Phase Listeners being called for resource requests (Resource

    Ingo Jobling Master

      Hello,

      org.ajax4jsf.resource.ResourceLifecycle seems to invoke PhaseListeners for Ajax4Jsf resource requests (CSS, JavaScript)

      This results in a performance problem as Transactions are initiated and commited by Seam.

      Shouldn't these requests be treated as non-JSF requests?

      Thank you.

      Environment: Seam 2.1.1.GA, Richfaces 3.3.0.GA

      org.ajax4jsf.resource.ResourceLifecycle:

      public void send(ResourceContext resourceContext, InternetResource resource)
       throws IOException {
       FacesContext facesContext = FacesContext.getCurrentInstance();
       PhaseListener[] phaseListeners = null;
       PhaseEvent renderViewEvent = null;
       if (null != facesContext) {
       Lifecycle facesLifecycle = getFacesLifecycle();
       phaseListeners = facesLifecycle.getPhaseListeners();
       PhaseEvent restoreViewEvent = new PhaseEvent(facesContext,
       PhaseId.RESTORE_VIEW, this);
       processPhaseListeners(phaseListeners, restoreViewEvent, true);


      Seam Log:

      00:12:52,457 DEBUG [org.jboss.seam.contexts.FacesLifecycle] >>> Begin JSF request for /agritrace/a4j/s/3_3_0.GAcss/tabPanel.xcss/DATB/eAEz5pZast7LlhkACdQCNg__
      00:13:13,830 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] beginning transaction prior to phase: RESTORE_VIEW 1
      00:13:13,835 TRACE [org.jboss.seam.jsf.SeamPhaseListener] after phase: RESTORE_VIEW 1
      00:13:13,835 DEBUG [org.jboss.seam.core.Manager] No stored conversation
      00:13:13,837 DEBUG [org.jboss.seam.theme.ThemeSelector] loaded resource bundle: wine
      00:13:13,837 TRACE [org.jboss.seam.jsf.SeamPhaseListener] before phase: RENDER_RESPONSE 6
      00:13:13,872 TRACE [org.jboss.seam.jsf.SeamPhaseListener] after phase: RENDER_RESPONSE 6
      00:13:13,873 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] committing transaction after phase: RENDER_RESPONSE 6
      00:13:13,874 DEBUG [org.jboss.seam.core.Manager] Discarding conversation state: 16
      00:13:13,874 DEBUG [org.jboss.seam.contexts.FacesLifecycle] After render response, destroying contexts
      00:13:13,875 DEBUG [org.jboss.seam.contexts.FacesLifecycle] <<< End JSF request for /agritrace/a4j/s/3_3_0.GAcss/tabPanel.xcss/DATB/eAEz5pZast7LlhkACdQCNg__
      



      Execution Stack:

      Daemon Thread [http-127.0.0.1-8080-4] (Suspended (breakpoint at line 53 in org.jboss.seam.contexts.FacesLifecycle))
       org.jboss.seam.contexts.FacesLifecycle.beginRequest(javax.faces.context.ExternalContext) line: 53
       org.jboss.seam.jsf.SeamPhaseListener.beforeRestoreView(javax.faces.context.FacesContext) line: 379
       org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(javax.faces.event.PhaseEvent) line: 138
       org.jboss.seam.jsf.SeamPhaseListener.beforePhase(javax.faces.event.PhaseEvent) line: 116
       org.ajax4jsf.resource.ResourceLifecycle.invokePhaseListener(javax.faces.event.PhaseListener, javax.faces.event.PhaseEvent, boolean) line: 199
       org.ajax4jsf.resource.ResourceLifecycle.processPhaseListeners(javax.faces.event.PhaseListener[], javax.faces.event.PhaseEvent, boolean) line: 175
       org.ajax4jsf.resource.ResourceLifecycle.send(org.ajax4jsf.resource.ResourceContext, org.ajax4jsf.resource.InternetResource) line: 119
       org.ajax4jsf.resource.InternetResourceService.load(java.lang.Object, java.lang.Object) line: 335
       org.ajax4jsf.cache.LRUMapCache.load(java.lang.Object, java.lang.Object) line: 116
       org.ajax4jsf.cache.LRUMapCache.get(java.lang.Object, java.lang.Object) line: 87
       org.ajax4jsf.resource.InternetResourceService.serviceResource(java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 195
       org.ajax4jsf.resource.InternetResourceService.serviceResource(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 141
       org.ajax4jsf.Filter(org.ajax4jsf.webapp.BaseFilter).doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 510
       org.jboss.seam.web.Ajax4jsfFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 56
       org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 69
       org.jboss.seam.web.LoggingFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 58
       org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 69
       org.jboss.seam.servlet.SeamFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 158
       org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 235
       org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206
       org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 96
       org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 235
       org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206
       org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 230
       org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 175
       org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 182
       org.apache.catalina.authenticator.BasicAuthenticator(org.apache.catalina.authenticator.AuthenticatorBase).invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 432
       org.jboss.web.tomcat.security.JaccContextValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 84
       org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 127
       org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 102
       org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 157
       org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 109
       org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request, org.apache.coyote.Response) line: 262
       org.apache.coyote.http11.Http11Processor.process(java.net.Socket) line: 844
       org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(java.net.Socket) line: 583
       org.apache.tomcat.util.net.JIoEndpoint$Worker.run() line: 446
       java.lang.Thread.run() line: 619