Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception: java.net.ProtocolException: Server redirected too many times (20)  RSS feed

 
Sreeharinaidu Yendluri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am able to get the data from all urls related to DEV, QA except for Pre QA url . Below exception is coming for PRE QA url (http://qnecfplds01.internal.local:81/eBusiness/EDS/Pages/dump_file.asp?CONVNAME=CONVNAME.PDF&PRINTSTREAM_CONFIG=DOCUMERGE&PRINTSTREAM_TO_IMAGE_PDF=0&REQTYPE=dmg_RenderDoc&CABINET=ARC&DOC_MAJORVERSION=1&DOC_MINORVERSION=0&DOC_ID=327806).

Could you please suggest me on that.
Exception is java.net.ProtocolException: Server redirected too many times (20)

Following is Code Snippet
URL docuPresentmentEndPoint = null;
URLConnection printUrlConnection = null;

try {
docuPresentmentEndPoint = new URL(url);
printUrlConnection = docuPresentmentEndPoint.openConnection();
// Let the run-time system (RTS) know that we want input.
printUrlConnection.setDoInput(true);
// Let the RTS know that we want to do output.
printUrlConnection.setDoOutput(true);
BufferedReader br = new BufferedReader(new InputStreamReader(printUrlConnection.getInputStream()));
}

Thanks,
Sreehari
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sreeharinaidu Yendluri wrote:
Could you please suggest me on that.
Exception is java.net.ProtocolException: Server redirected too many times (20)


This is usually caused by configuring a servlet to redirect to a servlet which redirects and so on (the URL version of an infinite loop).
 
Sreeharinaidu Yendluri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is standalone appllication.
Java version 1.4
 
Rob Spoor
Sheriff
Posts: 21090
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But the URL at qnecfplds01.internal.local isn't.
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What can be a solution for that.I am also facing same problem.
 
Rakson Jojjo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of URLConnection, try using below class. It resolved my similar issue with URLConnection code deployed inside WAS and invoked as WebService.


******************
org.apache.commons.httpclient.util
Class HttpURLConnection
java.lang.Object
java.net.URLConnection
java.net.HttpURLConnection
org.apache.commons.httpclient.util.HttpURLConnection
***************

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