HttpMethodBase.checkValidRedirect() throws exception in HTTP if the redirect points to a different protocol, server or port.
The source code says redirects "to a different protocol, host or port are checked for validity", but since it considers all redirects to a different protocol, host or port invalid, it always throws HttpException. The source also has this helpful comment "//LOG the error and let the client handle the redirect" :)
So... could you trap the HttpException and handle the redirect?
Debug info follows...
-------------------------------------------------------------------------------------------------------
[DEBUG] HttpMethodBase - Redirect requested to location 'http://portal1.oru.edu:7777/pls/portal/url/page/dynportal/dynmainpage?siteid=29&pageid=746'
[WARN] HttpMethodBase - Error getting URI host <org.apache.commons.httpclient.HttpException: Redirect from host comarts.oru.edu to portal1.oru.edu is not supported>org.apache.commons.httpclient.HttpException: Redirect from host comarts.oru.edu to portal1.oru.edu is not supported
at org.apache.commons.httpclient.HttpMethodBase.checkValidRedirect(HttpMethodBase.java:1243)
at org.apache.commons.httpclient.HttpMethodBase.processRedirectResponse(HttpMethodBase.java:1191)
at org.apache.commons.httpclient.HttpMethodBase.isRetryNeeded(HttpMethodBase.java:977)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1095)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:675)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
at org.hyperic.hq.plugin.netservices.HTTPCollector.collect(HTTPCollector.java:296)
at org.hyperic.hq.product.Collector.run(Collector.java:477)
at org.hyperic.hq.product.Collector.check(Collector.java:575)
at org.hyperic.hq.product.Collector.check(Collector.java:609)
at org.hyperic.hq.product.CollectorThread.run(CollectorThread.java:89)
at java.lang.Thread.run(Unknown Source)
[WARN] HttpMethodBase - Invalid Redirect URI from: http://comarts.oru.edu:80/ to: http://portal1.oru.edu:7777/pls/portal/url/page/dynportal/dynmainpage?siteid=29&pageid=746
The source code says redirects "to a different protocol, host or port are checked for validity", but since it considers all redirects to a different protocol, host or port invalid, it always throws HttpException. The source also has this helpful comment "//LOG the error and let the client handle the redirect" :)
So... could you trap the HttpException and handle the redirect?
Debug info follows...
-------------------------------------------------------------------------------------------------------
[DEBUG] HttpMethodBase - Redirect requested to location 'http://portal1.oru.edu:7777/pls/portal/url/page/dynportal/dynmainpage?siteid=29&pageid=746'
[WARN] HttpMethodBase - Error getting URI host <org.apache.commons.httpclient.HttpException: Redirect from host comarts.oru.edu to portal1.oru.edu is not supported>org.apache.commons.httpclient.HttpException: Redirect from host comarts.oru.edu to portal1.oru.edu is not supported
at org.apache.commons.httpclient.HttpMethodBase.checkValidRedirect(HttpMethodBase.java:1243)
at org.apache.commons.httpclient.HttpMethodBase.processRedirectResponse(HttpMethodBase.java:1191)
at org.apache.commons.httpclient.HttpMethodBase.isRetryNeeded(HttpMethodBase.java:977)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1095)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:675)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
at org.hyperic.hq.plugin.netservices.HTTPCollector.collect(HTTPCollector.java:296)
at org.hyperic.hq.product.Collector.run(Collector.java:477)
at org.hyperic.hq.product.Collector.check(Collector.java:575)
at org.hyperic.hq.product.Collector.check(Collector.java:609)
at org.hyperic.hq.product.CollectorThread.run(CollectorThread.java:89)
at java.lang.Thread.run(Unknown Source)
[WARN] HttpMethodBase - Invalid Redirect URI from: http://comarts.oru.edu:80/ to: http://portal1.oru.edu:7777/pls/portal/url/page/dynportal/dynmainpage?siteid=29&pageid=746