• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is standalone appllication.
Java version 1.4
 
Marshal
Posts: 22450
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But the URL at qnecfplds01.internal.local isn't.
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What can be a solution for that.I am also facing same problem.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
***************

reply
    Bookmark Topic Watch Topic
  • New Topic