Hi:
I have created a very basic EJB + JSF application and tried to deploy it to Glassfish v2 (update 1) when I get the following exception
[#|2008-02-11T14:55:05.687+0530|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=20;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=2f2fff7e-05ef-4077-8eb9-89cfa056ad1c;|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
javax.servlet.ServletException: PWC1232: Exceeded maximum depth for nested request dispatches: 20
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:842)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
...
My [b]web.xml [/b]looks as follows:
[i]<?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>GreetingsWeb</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>
[/i]
[b]faces-config.xml[/b]
[i]<?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>
input</managed-bean-name>
<managed-bean-class>
vbv.greetings.web.Input</managed-bean-class>
<managed-bean-scope>
session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<display-name>
home</display-name>
<from-view-id>
/home.jsp</from-view-id>
<navigation-case>
<from-outcome>greeting</from-outcome>
<to-view-id>
/greeting.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>[/i]
[b]EJB 3.0:[/b]
[i]package vbv.greetings.domain;
import javax.ejb.Remote;
@Remote
public interface IGreetingsService {
public String printGreeting();
}
& implementation:
package vbv.greetings.domain;
import javax.ejb.Stateless;
@Stateless
public class GreetingsService implements IGreetingsService {
public String printGreeting() {
// TODO Auto-generated method stub
return "greeting";
}
}[/i]
[b]Managed Bean[/b]
[i]package vbv.greetings.web;
import javax.ejb.EJB;
import vbv.greetings.domain.IGreetingsService;
public class Input {
private String name;
@EJB
private IGreetingsService service;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}[/i]
[b]JSP Pages[/b]
[b]home.jsp[/b]
[i]<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:f="
http://java.sun.com/jsf/core"
xmlns:h="
http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form>
<h:outputLabel value="Name"></h:outputLabel>
<h:inputText value="#{input.name}"></h:inputText>
<h:commandButton value="Print Greeting" action="#{input.printGreeting}"></h:commandButton>
</h:form>
</f:view>
</body>
</html>[/i]
[b]greeting.jsp[/b]
[i]<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:f="
http://java.sun.com/jsf/core"
xmlns:h="
http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form>
<h:outputText value="Hello #{input.name}"></h:outputText>
</h:form>
</f:view>
</body>
</html>[/i]
Any ideas as to what could be the issue ?
[Message sent by forum member 'venkyvb' (venkyvb)]
http://forums.java.net/jive/thread.jspa?messageID=258301