Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #474660] |
Sun, 01 July 2007 12:37  |
Eclipse User |
|
|
|
Hello,
I'm using eclipse 3.3 with wtp 2.0 to create some simple jsf-pages.
The project simply consists of login.jsp and welcome.jsp following the JSF
tutorial here on eclipse.org.
I've added the web.xml and faces-config.xml generated for my JBOSS 4.2
installation below.
When I deploy the application and request the login.jsp from my browser
(firefox) then JBOSS gets in an infinite loop. The server.log shows these
entries:
2007-07-01 18:05:30,859 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localho st].[/JBossTestWeb].[Faces
Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.StackOverflowError
at
javax.servlet.http.HttpServletRequestWrapper.getSession(Http ServletRequestWrapper.java:216)
at
org.apache.catalina.core.ApplicationHttpRequest.getSession(A pplicationHttpRequest.java:545)
at
javax.servlet.http.HttpServletRequestWrapper.getSession(Http ServletRequestWrapper.java:216)
at
org.apache.catalina.core.ApplicationHttpRequest.getSession(A pplicationHttpRequest.java:545)
... The two last lines repeating itself.
What have I done wrong?
With kind regards
Florian Reiser
http://www.ra-bc.de
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>JBossTestWeb</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class >
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
</web-app>
faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<managed-bean>
<managed-bean-name>
loginBean</managed-bean-name>
<managed-bean-class>
com.tutorial.LoginBean</managed-bean-class>
<managed-bean-scope>
session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<display-name>
login</display-name>
<from-view-id>
/login.jsp</from-view-id>
<navigation-case>
<from-outcome>
login</from-outcome>
<to-view-id>
/welcome.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<validator>
<display-name>
Validate Password</display-name>
<validator-id>
com.tutorial.ValidatePassword</validator-id>
<validator-class>
com.tutorial.ValidatePassword</validator-class>
</validator>
</faces-config>
|
|
|
|
|
|
|
Re: Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #613080 is a reply to message #474660] |
Mon, 02 July 2007 05:11  |
Eclipse User |
|
|
|
Hello,
I've found my error.
The infinite recursion happened because of my Faces servlet-mapping to
*.jsp
When changing it to *.jsf, everything worked fine.
There should be some comment, that you have to create the jsf-pages as
*.jsp-files and access them via the *.jsf-mapping.
My mistake was to believe that the files have to have the same extension
as the mapping suggests.
With kind regards
Florian Reiser
http://www.ra-bc.de
|
|
|
Re: Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #613081 is a reply to message #474830] |
Tue, 03 July 2007 17:10  |
Eclipse User |
|
|
|
This is a case of several configurations creating a condition where an
infinite loop is entered (as you have discovered). By default, when
extension mapping is used, FacesServlet looks for a corresponding resource
with a ".jsp" extension. But this can be configured differently by using a
context-param. Also, by default, a JSP engine will have the ".jsp"
extension configured such that before the resource is returned to the
client, servlet-mappings will be consulted to see if the resource needs to
be passed to any servlet. This too can be configured in at least some JSP
engines. The JSF Tooling can't inspect the runtime engine to determine its
configuration to see if this condition will definitely occur (although
it's likely to occur unless defaults are changed).
This is more of a general servlet engine configuration and JSF web
application configuration issue than it is a specific JSF Tooling issue.
That said, it's not a highly-improbable condition to encounter, so if
you'd like to make an enhancement request for JSF Tooling, please log an
issue in Bugzilla
( https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Java%20S erver%20Faces).
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04098 seconds