Forums Register Login

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

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
 

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).
+Pie Number of slices to send: Send
This is standalone appllication.
Java version 1.4
+Pie Number of slices to send: Send
But the URL at qnecfplds01.internal.local isn't.
+Pie Number of slices to send: Send
What can be a solution for that.I am also facing same problem.
+Pie Number of slices to send: Send
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
***************

Then YOU must do the pig's work! Read this tiny ad. READ IT!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 11444 times.
Similar Threads
Proxy Authentication exception
Exception: Server redirected too many times (20)
Xml reading
accessing URL through java from behind a fire wall:
Proxy Authentication exception
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:57:04.