Hello
I've a JSF app deploying from Eclipse Ganymede through Tomcat 6. The latter suggests JSP 2.0. I'm using Sun RI JSF implementation and RichFaces 3.3.2SR1.
My index.jsp file on request from the browser causes this error to the console:
05-Mar-2010 12:04:41 org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /index.jsp(35,41) #{..} is not allowed in template text
...
OK, I've seen various other posts on this subject including incompatibilities of versions of the various jars/taglibs/syntaxes etc.
The index.jsp is called using http://localhost:8989/myapp/index.jsf
(or .jsp - gives the same error), and contains
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
which should be alright as facelets is in Mojarra 2.0.2FCS which I'm using. I seem to have to use the above syntax rather than eg. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
as the facelets URI causes Eclipse to say Cannot find the tag library descriptor for "http://java.sun.com/jsf/facelets"
.
Is my problem to do with the way I'm listing these tags?
My Ant build file refers to these Tomcat jars:
<fileset dir="${cliTomcatlib}">
<include name="servlet-api.jar" />
<include name="jsp-api.jar" />
</fileset>
so I'm stumped as to how I can get round this error. It feels like it would be a simple fix but as I'm using latest jars that should be compatible with JSP 2.0, I'm wondering why I'm getting this error. JSF
EDIT
In response to BalusC's wisdom, I corrected two references to external jsp files and renamed all .jsp
to .xhtml
. I remembered to also update my faces-config.xml
.
Redeploying now errors with a large and repeating error when the index.xhtml
is requested like this:
05-Mar-2010 13:29:26 org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.StackOverflowError
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:824)
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:544)
...
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:544)
at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:151)
at javax.faces.application.ViewHandler.calculateCharacterEncoding(ViewHandler.java:242)
at javax.faces.application.ViewHandler.initView(ViewHandler.java:458)
at com.sun.faces.application.view.MultiViewHandler.initView(MultiViewHandler.java:106)
at org.ajax4jsf.application.ViewHandlerWrapper.initView(ViewHandlerWrapper.java:128)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:109)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
which I admit isn't very illuminatory other than the first few lines of the stack trace are repeated so many times I had to change the console buffer on Eclipse. I'd be overflowing with gratitude if anyone has seen this before.
Mark