-
1. Re: richfaces js files sometimes served with size 0
mhn Sep 20, 2011 12:18 PM (in response to mhn)I corrected my initial bug report. This issue occurs also in Firefox.
Now I got a new logfile with more detailed logging, which contains a NullPointerException in the PhaseListener!
[2011-09-19 12:27:11,601] http-8080-16 [DEBUG] [] BaseFilter doFilter: Filter start request processing at 9/19/11 12:27 PM for uri: /test_ax/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/modalPanel.js
[2011-09-19 12:27:11,601] http-8080-16 [DEBUG] [] AjaxPhaseListener beforePhase: Process before phase RESTORE_VIEW(1)
[2011-09-19 12:27:11,601] http-8080-16 [DEBUG] [] ResourceLifecycle invokePhaseListener: Exception in PhaseListener, phase :RESTORE_VIEW(1) : beforePhase
java.lang.NullPointerException
[2011-09-19 12:27:11,601] http-8080-16 [DEBUG] [] InternetResourceService serviceResource: Get content from cache for resource org/richfaces/renderkit/html/scripts/modalPanel.js
[2011-09-19 12:27:11,601] http-8080-16 [DEBUG] [] BaseFilter doFilter: Finished request processing total time 0ms for uri: /test_ax/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/modalPanel.js
Does this help?
Why is a PhaseListener even called for a js file?
The Faces Servlet is mapped to <url-pattern>/faces/*</url-pattern>
javax.faces.DEFAULT_SUFFIX is ".xhtml"
Any help is highly appreciated here
-
2. Re: richfaces js files sometimes served with size 0
mhn Sep 21, 2011 5:00 AM (in response to mhn)Now I got a stacktrace from another js file (we changed the LoadStrategy)
[2011-09-20 16:59:27,479] http-8080-1 [DEBUG] [] BaseFilter doFilter: Filter start request processing at 9/20/11 4:59 PM for uri: /xxx/faces/a4j/g/3_3_3.Final/org/ajax4jsf/framework.pack.js
[2011-09-20 16:59:27,479] http-8080-1 [DEBUG] [] AjaxPhaseListener beforePhase: Process before phase RESTORE_VIEW(1)
[2011-09-20 16:59:27,479] http-8080-1 [DEBUG] [] ResourceLifecycle invokePhaseListener: Exception in PhaseListener, phase :RESTORE_VIEW(1) : beforePhase
java.lang.NullPointerException
at org.apache.catalina.connector.Request.setAttribute(Request.java:1469)
at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
at org.apache.myfaces.context.servlet.RequestMap.setAttribute(RequestMap.java:53)
at org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:105)
at org.apache.myfaces.util.AbstractAttributeMap.put(AbstractAttributeMap.java:38)
at org.apache.myfaces.webapp.filter.ServeResourcePhaseListener.beforePhase(ServeResourcePhaseListener.java:71)
at org.ajax4jsf.resource.ResourceLifecycle.invokePhaseListener(ResourceLifecycle.java:202)
at org.ajax4jsf.resource.ResourceLifecycle.processPhaseListeners(ResourceLifecycle.java:178)
at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:117)
at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:226)
at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:508)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:384)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.recommind.litigation.client.web.filters.LoginFilter.doFilter(LoginFilter.java:224)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.recommind.litigation.client.web.filters.CacheFilter.doFilter(CacheFilter.java:114)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
[2011-09-20 16:59:27,479] http-8080-1 [DEBUG] [] BaseFilter doFilter: Finished request processing total time 15ms for uri: /xxx/faces/a4j/g/3_3_3.Final/org/ajax4jsf/framework.pack.js
Could there be a problem with the FacesContext?
-
3. Re: richfaces js files sometimes served with size 0
mhn Sep 22, 2011 4:19 AM (in response to mhn)Issue could be solved.
It was caused by a not released FacesContext which I created manually in a non faces request. This FacesContext was created in the http thread of the login request which was redirected to another page. The javascript error occurred when this http thread was reused in order to fetch a richfaces javascript. The deprecated FacesContext was reused in this thread and richfaces was therefore not able to serve the javascript resource.
Unfortunately this error was logged with debug level only and mostly without any stacktrace and the js file was served without any content as a consequence of this.