Resolution: Description:
============
When the "Accept Redirects" property is checked on the Configuration tab of the Send HTTP Request activity and the method used is “POST” the following error is reported:
----------------------------------------------------------------
java.lang.IllegalArgumentException: Entity enclosing requests cannot be redirected without user intervention
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:221)
at com.tibco.plugin.share.http.client.HttpClientUtilities.a(HttpClientUtilities.java:718)
at com.tibco.plugin.share.http.client.HttpClientUtilities.createHttpRequestFromTransportMessage(HttpClientUtilities.java:458)
at com.tibco.plugin.share.http.client.JakartaHttpTransportDriver.sendMessage(JakartaHttpTransportDriver.java:99)
at com.tibco.plugin.http.client.HttpRequestActivity.processRequest(HttpRequestActivity.java:136)
at com.tibco.plugin.http.client.HttpRequestActivity.eval(HttpRequestActivity.java:94)
at com.tibco.pe.plugin.Activity.eval(Activity.java:209)
at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:540)
at com.tibco.pe.core.Job.a(Job.java:712)
at com.tibco.pe.core.Job.k(Job.java:501)
at com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)
at com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200
------------------------------------------------------
Environment
===========
ALL
Symptoms:
========
The error:
--------------------
java.lang.IllegalArgumentException: Entity enclosing requests cannot be redirected without user intervention
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:221)
at com.tibco.plugin.share.http.client.HttpClientUtilities.a(HttpClientUtilities.java:718)
at com.tibco.plugin.share.http.client.HttpClientUtilities.createHttpRequestFromTransportMessage(HttpClientUtilities.java:458)
at com.tibco.plugin.share.http.client.JakartaHttpTransportDriver.sendMessage(JakartaHttpTransportDriver.java:99)
at com.tibco.plugin.http.client.HttpRequestActivity.processRequest(HttpRequestActivity.java:136)
at com.tibco.plugin.http.client.HttpRequestActivity.eval(HttpRequestActivity.java:94)
at com.tibco.pe.plugin.Activity.eval(Activity.java:209)
at com.tibco.pe.core.TaskImpl.eval(TaskImpl.java:540)
at com.tibco.pe.core.Job.a(Job.java:712)
at com.tibco.pe.core.Job.k(Job.java:501)
at com.tibco.pe.core.JobDispatcher$JobCourier.a(JobDispatcher.java:249)
at com.tibco.pe.core.JobDispatcher$JobCourier.run(JobDispatcher.java:200
-----------------------
Cause:
=====
Some changes has been made in the Jakarta httpclient library between version 2.0.2 and 3.0.1. The changes were due to a restriction placed on automatic redirection by clients as defined in RFC 2616. RFC 2616 sections 10.3.2, 10.3.3 and 10.3.8 state, "If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued". Unless using the GET or HEAD method in the HTTP Requestor, do not use "Accept Redirects" as BW is an automated client and cannot interact with a user.
Resolution:
=======
Use GET or HEAD method when the “Accept Redirect” property is used.
References:
=======
http://jakarta.apache.org/httpcomponents/httpclient-3.x/redirects.html