Why do I get HTTPRetryException when using a SOAPConnection?

Solution Verified - Updated -

Issue

When I create a SOAPConnection calling a web service like this:

SOAPConnectionFactory soapConnectionFactory =  SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnectionFactory.createConnection();
URL endpoint = new URL("http://jboss.com");
SOAPMessage response = connection.call(message, endpoint);

On calling the SOAPConnection.call(SOAPMessage, URL) method the following exception is thrown

2011-04-19 10:04:10,738 DEBUG [org.jboss.remoting.transport.http.HTTPClientInvoker] Error invoking http client invoker.
java.net.HttpRetryException: cannot retry due to redirection, in streaming mode
     at sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:1695)
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1106)
     at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
     at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:281)
     at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:136)
     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
     at org.jboss.remoting.Client.invoke(Client.java:1634)
     at org.jboss.remoting.Client.invoke(Client.java:548)
     at org.jboss.ws.core.client.RemotingConnectionImpl.invoke(RemotingConnectionImpl.java:183)
     at org.jboss.ws.core.client.SOAPRemotingConnection.invoke(SOAPRemotingConnection.java:77)
     at org.jboss.ws.core.soap.SOAPConnectionImpl.callInternal(SOAPConnectionImpl.java:106)
     at org.jboss.ws.core.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:66)
     at com.companyname.client.PreLitigationProcessorBean.sendPreLitigationDetails(PreLitigationProcessorBean.java:110)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:94)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
     at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:795)
     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
     at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In