• Post Reply Bookmark Topic Watch Topic
  • New Topic

server redirected too many times error

 
Ritesh Agrawal
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a servlet compiled under JDK 1.4.running in the weblogic server 6.1. This servlet runs in the staging machine and performs following activities:
1. Receives request from browser
2. Creates an URL object for another servlet running on the production machine.
3. Creates a HttpURLConnection object using the above URL.
4. Opens an OutputStream to the HttpURLConnection object and writes a String object to it.

When I make a request from the browser to this servlet, I am getting the following RuntimeException:

Servlet failed with exception
java.net.ProtocolException: Server redirected too many times (5)

Has any one ever received such exception. Can any one please suggest me what could be the possible causes and probable solutions.

Any help in this matter would be highly appreciated.

Thanks
Ritesh
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From looking at the error message, I'm guessing that, somewhere in your code, a resource is either redirecting/forwarding to itself or you have two resources forwarding/redirecting to each other in a recursive manor.

Similar to a stack overflow/ recursion error in a plain old java app
 
Ritesh Agrawal
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben,

Thanks for the response. I am sure that its not the case what your are sugegesting. I have been trying to find similar issues with other people at other forums using Google. I see many people have faced this issue but I don't find any solution to it anywhere. Some have suggested using http.maxRedirect system property and set it to 20 or more. I am not sure whether that works, but I haven't tried doing that.

To be more clear, this code was working fine until a couple of days. We moved to a different hosting service provider and there is when this error started to crop up.

Thanks
ritesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!