0

My project is using seam 2.2.2 Final, and the application server is Jboss 7.1. After a long deployment process, finally I can deploy it successfully. But when I attempt to open it in the browser, I get error like this:

"This webpage has a redirect loop

The webpage at "http://localhost:8080/integration/debug.seam?cid=2" has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer." .

How can I solve this problem?

This is my 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>integration</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>*.seam</url-pattern>
  </servlet-mapping>
  <context-param>
    <param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
    <param-value>Mojarra-1.2</param-value>
  </context-param>
  <context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>blueSky</param-value>
  </context-param>
  <listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
  </listener>
  <filter>
    <filter-name>Seam Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>Seam Filter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <servlet>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <url-pattern>/seam/resource/*</url-pattern>
  </servlet-mapping>
  <context-param>
    <param-name>facelets.DEVELOPMENT</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
  </context-param>
  <security-constraint>
    <display-name>Restrict raw XHTML Documents</display-name>
    <web-resource-collection>
      <web-resource-name>XHTML</web-resource-name>
      <url-pattern>*.xhtml</url-pattern>
    </web-resource-collection>
    <auth-constraint/>
  </security-constraint>
</web-app>

This is my persistence.xml. I think configuration of persistence.xml is correct.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
             version="1.0">

   <persistence-unit name="integration" transaction-type="JTA">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>java:jboss/integrationDSJNDI</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="update"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.format_sql" value="true"/>
         <property name="jboss.entity.manager.factory.jndi.name" value="java:/integrationEntityManagerFactory"/>
      </properties>
   </persistence-unit>

</persistence>

Jar list

antlr-2.7.6.jar
antlr-runtime-3.1.1.jar
commons-beanutils-1.7.0.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
drools-api-5.0.1.jar
drools-core-5.0.1.jar
gwt-servlet-2.3.0.jar
hibernate-core-3.3.0.SP1.jar
hibernate-validator-3.1.0.GA.jar
drools-compiler-5.0.1.jar
itext-2.1.2.jar
itext-rtf-2.1.2.jar
jboss-el-1.0_02.CR5.jar
jboss-seam-2.2.1.Final.jar
jboss-seam-debug-2.2.1.Final.jar
jboss-seam-ioc-2.2.1.Final.jar
jboss-seam-jul-2.2.1.Final.jar
jboss-seam-mail-2.2.1.Final.jar
jboss-seam-pdf-2.2.1.Final.jar
jboss-seam-remoting-2.2.1.Final.jar
jboss-seam-ui-2.2.1.Final.jar
jbpm-jpdl-3.2.2.jar
json-20080701.jar
jta-1.1.jar
mvel2-2.0.10.jar
richfaces-api-3.3.3.Final.jar
richfaces-impl-3.3.3.Final.jar
richfaces-ui-3.3.3.Final.jar
xml-apis-1.0.b2.jar
xstream-1.3.1.jar
Pınar Göçebe
  • 101
  • 2
  • 12
  • Hi Pinar! Welcome to StackOverflow! Can you provide your configuration for that URL, such as what's in your web.xml and other configuration? This error message is helpful, but to solve the problem, we'll probably also need to see the configuration. Good luck! :) – jamesmortensen May 28 '12 at 07:51
  • Thanks for reply, I added configuration files.May seam version incompatibility cause this problem? because in parent project pom.xml seam version is 2.2.1.Final but my seam runtime is 2.2.2.Final.Also there isn't any error because of this. – Pınar Göçebe May 28 '12 at 08:09
  • This is a pretty common issue on any server really, whenever a url or resource is accidentally configured to call itself again. What about your logging level? Do you have a logging.properties or log4j or some place to increase the logging level? The frameworks typically log things at a lower level than your app does, so it's helpful to set the logging to ALL or DEBUG so you can see what the server is doing. – jamesmortensen May 28 '12 at 08:22
  • I configured logging.properties file and all logs in trace level but there isn't any error.Deployment has been completed successfully and there isn't any new log after deployment. – Pınar Göçebe May 28 '12 at 08:47
  • My suggestion is to go back to the configuration you had before the problem started to see if you can narrow down the problem yourself. You mentioned you thought seam was the problem, so try to see if you can find evidence of that. If you can at least say "My problem is in X" in your question and have some more info on that, then I think it can help you find an answer on StackOverflow :) – jamesmortensen May 28 '12 at 09:04
  • This problem caused by .jar files duplication or was not found, but I did't gen any class not found error. I added jar list here. – Pınar Göçebe May 30 '12 at 08:39
  • Just in case someone is working on a seam ear project, this has to placed on the pom of the MAIN project, also dont use the one recomended by 1.1.15.B1, it doesn't work! – Camilo Casadiego Sep 29 '12 at 17:59

2 Answers2

0

This problem caused by lack of jsf-facelet dependency. to solved that adding the following code to your pom.xml

 <dependency>
    <groupId>com.sun.facelets</groupId>
    <artifactId>jsf-facelets</artifactId>
    <version>1.1.15</version>
</dependency>
Pınar Göçebe
  • 101
  • 2
  • 12
0

Use solution 1 https://community.jboss.org/thread/206184

I resolved this issue copying the debug.xhtml from jboss-seam-debug.jar to root web src path.

Use solution 2 https://issues.jboss.org/browse/JBSEAM-4864

moving of META-INF/debug.xhtml to META-INF/resources/debug.xhtml should help to solve the exception. Fixed it in jboss-seam-debug.jar 2.3.0