aspose file tools*
The moose likes Web Services and the fly likes Exception: java.net.ProtocolException: Server redirected too many times?? Please help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Exception: java.net.ProtocolException: Server redirected too many times?? Please help!" Watch "Exception: java.net.ProtocolException: Server redirected too many times?? Please help!" New topic
Author

Exception: java.net.ProtocolException: Server redirected too many times?? Please help!

Praveen Kumar Jayaram
Ranch Hand

Joined: Jul 14, 2008
Posts: 56
Hi All,

Am trying to call a .NET webservice hosted on Sharepoint server using a CXF client (Generated using SOAPUI tool automatically).
To access this webservice one needs to authenticate using NTLM....

Am using JCIFS and HTTPClient frameworks for providing NTLM authentication and JRE is 1.5.0_12.
When the webservice is invoked by this CXF client am getting ProxyException and it is as follows:

ERROR [DefaultQuartzScheduler_Worker-1] com.honeywell.mdb.MDBClient (writeLinearFiles:80) - Could not send Message.
ERROR [DefaultQuartzScheduler_Worker-1] com.honeywell.mdb.MDBClient (writeLinearFiles:81) - javax.xml.ws.WebServiceException: Could not send Message.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
at $Proxy39.getAnsysExportContents(Unknown Source)
at com.honeywell.mdb.client.MDBAnsysExportServiceSoap_MDBAnsysExportServiceSoap_Client.getData(MDBAnsysExportServiceSoap_MDBAnsysExportServiceSoap_Client.java:85)
at com.honeywell.mdb.MDBClient.getMDBData(MDBClient.java:154)
at com.honeywell.mdb.MDBClient.getLinearData(MDBClient.java:91)
at com.honeywell.mdb.MDBClient.writeLinearFiles(MDBClient.java:52)
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.springframework.util.MethodInvoker.invoke(MethodInvoker.java:275)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:272)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.net.ProtocolException: Server redirected too many times (20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1223)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1217)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:906)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2166)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2057)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1982)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:637)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:483)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:309)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:261)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
... 14 more
Caused by: java.net.ProtocolException: Server redirected too many times (20)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1178)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2081)
... 25 more


Here is the code:


Please someone help is fixing this issue.


Praveen
Praveen Kumar Jayaram
Ranch Hand

Joined: Jul 14, 2008
Posts: 56
Any clue for this issue?
Any issues in JRE 1.5.0_12 version???

Thanks in advance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
My first guess would be that you have somehow created an endless loop of redirects.

Bill
Praveen Kumar Jayaram
Ranch Hand

Joined: Jul 14, 2008
Posts: 56

How do you I find where thing are getting looped?
The program runs fine with JRE 1.6... When it is moved to JRE 1.5.0_12, faced so many jar dependencies.
After resolving all compile and run time dependencies I get the ProxyException when calling the .Net webservice

Any clues now?

Regards,
Praveen
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
The program runs fine with JRE 1.6


Just one of those tiny tiny details you neglected to mention in the original post.

The obvious advice - go back to JRE 1.6.

Praveen Kumar Jayaram
Ranch Hand

Joined: Jul 14, 2008
Posts: 56
Thanks for the suggestion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception: java.net.ProtocolException: Server redirected too many times?? Please help!