Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERR_TOO_MANY_REDIRECTS error u

Fact:

I am requesting root application on my browser http://localhost:8080/myapp and my browser throws this error: Error 310 (net::ERR_TOO_MANY_REDIRECTS): many redirects.

Environment:

I'm using Java 6, Glassfish 2.1, Struts2, Spring and Hibernate.

Check:

Then I look into web.xml and in welcome-list-files I have this:

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

So, let's check index.jsp and there is this redirection:

...
<head>
<meta http-equiv="refresh" content="0;url=<%=request.getContextPath()%>/portal/home.do">
...
<link rel="shortcut icon" href="<%=request.getContextPath()%>/img/icono.png" />
</head>
...

Then we can go to struts.xml and we can see this chunk:

...
<package name="portal-action" extends="portal-base" namespace="/portal">
    <action name="home" method="home" class="beginAction">
        <result type="tiles">begin.home</result>
    </action>
...

Let's check beginAction class:

...
public String home(){
    return SUCCESS;
}
...

And we can check tiles.xml:

...
<definition name="begin.welcome" extends=".baseHome">
    <put-attribute name="working.region" value="/jsp/common/welcome.jsp" />
</definition>
...

And finally we can view entire welcome.jsp file which only contains:

<%@ taglib prefix="s" uri="/struts-tags"%>
<br />

That's all!

Do you have some idea about this issue?

like image 394
Israel Avatar asked Sep 26 '11 04:09

Israel


1 Answers

Just to state the obvious, it looks like your app is caught in a redirect loop. Looking at your configuration, I have no idea what the issue could be. I would try opening up a network monitor like Fiddler, or the "Network" tab in Chrome's developer tools and look at the response headers to see where it is trying to redirect you to ... that might help reveal what is going wrong here.

like image 88
JasonStoltz Avatar answered Nov 10 '22 00:11

JasonStoltz