NetBeans 6.9
Tomcat 6.0.26
JSF(Mojarra) 2.0.3
JSTL 1.2
I'm getting the following error in the browser:
- Stack Trace
java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(EventObject.java:38)
at javax.faces.event.SystemEvent.<init>(SystemEvent.java:67)
at javax.faces.event.ComponentSystemEvent.<init>(ComponentSystemEvent.java:69)
at javax.faces.event.PostRestoreStateEvent.<init>(PostRestoreStateEvent.java:69)
at com.sun.faces.lifecycle.RestoreViewPhase.deliverPostRestoreStateEvent(RestoreViewPhase.java:256)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:245)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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:558)
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:852)
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:619)
+- Component Tree
... this is empty ...
I'm using a template xhtml file and the error above occurs in one of the template client files. Actually it occurs in any template client that contain a javascript 'for' loop. Here's an excerpt from the template client page:
<ui:composition template="../WEB-INF/template.xhtml">
<ui:define name="left">
<a href="#{facesContext.externalContext.requestContextPath}/path1/home.xhtml">Home</a>
<c:if test="#{request.isUserInRole('Administrator')}">
<br/><a href="#{facesContext.externalContext.requestContextPath}/path2/reporting.xhtml">Reporting</a>
</c:if>
</ui:define>
<ui:define name="center">
<script type="text/javascript">
function some_function()
{
for( var i = 0; i < 2; i++ ) { ... some code ... } // Without this line, the page renders successfully.
}
</script>
...
Looking at the Mojarra 2.0.3 code and the exception's call stack, it appears the UIViewRoot is not being created in RestoreViewPhase.execute(). Also, I don't know if this has any bearing, but I've replaced the following two jar files in Tomcat 6, with updated versions from Tomcat 7, so I can use EL method calls with parameters.
el-api.jar
jasper-el.jar
Not sure if this is a bug or the result of my non-standard configuration. I'd be grateful if someone could point me in the right direction.
Thanks,
Andrew
[Message sent by forum member 'andrewlaughlin']
http://forums.java.net/jive/thread.jspa?messageID=476829