0

I try to get JSF running with JBoss (5.1) but I have two problems. Either I get a class not found exception for the FaceletViewHandler which is configured in the faces-config.xml, or I get an infinit number of StackOverflowError.

The error:

00:48:30,767 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.StackOverflowError
....
at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:279)
...

I assume that it has something to do with my web.xml configuration or my faces-config.xml

the web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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-app_2_5.xsd">
    <display-name>test1</display-name>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.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>*.xhtml</url-pattern>
    </servlet-mapping>
</web-app>

I found a 'solution' which said that the url patter should be different from the default suffix - it did not help

the faces-config.xml:

<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="1.2" 
    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">
  <application>
        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
    </application>
</faces-config>

in the POM.XML

....
    <dependency>
      <groupId>com.sun.facelets</groupId>
      <artifactId>jsf-facelets</artifactId>
      <version>1.1.15</version>
    </dependency>
....

What is wrong?

Greetings D3

Piotr Kochański
  • 21,862
  • 7
  • 70
  • 77
ABX
  • 1,173
  • 2
  • 22
  • 39

2 Answers2

1

StackOverflowError tells us that threads does not have enough memory available on stack. Maybe you shloud increase stack available for a thread using -Xss JVM option (for instance -Xss256k or even more).

You should set it in run.conf.bat or run.conf.sh, depending on your operation system.

You can also try to save server resources by setting javax.faces.STATE_SAVING_METHOD from "server" to "client".

Piotr Kochański
  • 21,862
  • 7
  • 70
  • 77
  • I totally agree in general but I get an infinit number of StackOverFlowError, the configuration seems to cause something like a infinitive loop, hence increasing the memory would not help. – ABX Mar 17 '13 at 18:57
0

I found the solution - well at least a workaround. I changed back from JDK7 to JDK6, now everything works.

I think that it is required to setup the project again and examine the versions of all included libraries very carefull.

ABX
  • 1,173
  • 2
  • 22
  • 39