Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » Infinite recursion when deploying jsf-project to JBOSS 4.2
Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #474660] Sun, 01 July 2007 16:37 Go to next message
Florian Reiser is currently offline Florian Reiser
Messages: 25
Registered: July 2009
Junior Member
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 #474830 is a reply to message #474660] Mon, 02 July 2007 09:11 Go to previous messageGo to next message
Florian Reiser is currently offline Florian Reiser
Messages: 25
Registered: July 2009
Junior Member
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 #474831 is a reply to message #474830] Tue, 03 July 2007 21:10 Go to previous messageGo to next message
Ian Trimble is currently offline Ian Trimble
Messages: 137
Registered: July 2009
Senior Member
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).
Re: Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #474833 is a reply to message #474831] Thu, 05 July 2007 09:23 Go to previous messageGo to next message
Florian Reiser is currently offline Florian Reiser
Messages: 25
Registered: July 2009
Junior Member
Hello Ian,

I don't think that is an issue severe enough to write an issue request.
It would only be kind to explain this to newcomers in the tutorial.
Would you mind to include the content of your post in the tutorial?

With kind regards
Florian Reiser
http://www.ra-bc.de
Re: Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #474834 is a reply to message #474833] Thu, 05 July 2007 18:19 Go to previous message
Ian Trimble is currently offline Ian Trimble
Messages: 137
Registered: July 2009
Senior Member
I have logged as an enhancement request against JSF Tools documentation
component (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195567). It
doesn't have to be a serious issue to log an entry in Bugzilla, we also
use it so as not to lose track of such enhancement requests. Thanks for
your observations and input.

- Ian
Re: Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #613080 is a reply to message #474660] Mon, 02 July 2007 09:11 Go to previous message
Florian Reiser is currently offline Florian Reiser
Messages: 25
Registered: July 2009
Junior Member
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 21:10 Go to previous message
Ian Trimble is currently offline Ian Trimble
Messages: 137
Registered: July 2009
Senior Member
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).
Re: Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #613082 is a reply to message #474831] Thu, 05 July 2007 09:23 Go to previous message
Florian Reiser is currently offline Florian Reiser
Messages: 25
Registered: July 2009
Junior Member
Hello Ian,

I don't think that is an issue severe enough to write an issue request.
It would only be kind to explain this to newcomers in the tutorial.
Would you mind to include the content of your post in the tutorial?

With kind regards
Florian Reiser
http://www.ra-bc.de
Re: Infinite recursion when deploying jsf-project to JBOSS 4.2 [message #613083 is a reply to message #474833] Thu, 05 July 2007 18:19 Go to previous message
Ian Trimble is currently offline Ian Trimble
Messages: 137
Registered: July 2009
Senior Member
I have logged as an enhancement request against JSF Tools documentation
component (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195567). It
doesn't have to be a serious issue to log an entry in Bugzilla, we also
use it so as not to lose track of such enhancement requests. Thanks for
your observations and input.

- Ian
Previous Topic:Infinite recursion when deploying jsf-project to JBOSS 4.2
Next Topic:JSFLibraries and PluginProvidedJsfLibraries
Goto Forum:
  


Current Time: Thu Sep 18 05:57:26 GMT 2014

Powered by FUDForum. Page generated in 1.23610 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software