jQuery in Action, 2nd edition*
The moose likes Sockets and Internet Protocols and the fly likes java.net.SocketException: Unknown proxy type : HTTP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "java.net.SocketException: Unknown proxy type : HTTP" Watch "java.net.SocketException: Unknown proxy type : HTTP" New topic

java.net.SocketException: Unknown proxy type : HTTP

Nikh Sadd

Joined: May 05, 2012
Posts: 9

We are need to access out application based on Java webstart and JNLP via a proxy server as it is hosted in a third party environment. When we use direct connection then it works fine but we specify the proxy server then we get below error:

Could not access HTTP invoker remote service at [http://host:7001/...service ]; nested exception is java.net.SocketException: Unknown proxy type: HTTP

Caused by: java.net.SocketException: Unknown proxy type : HTTP
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1321)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor.executePostMethod(CommonsHttpInvokerRequestExecutor.java:196)
at org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor.doExecuteRequest(CommonsHttpInvokerRequestExecutor.java:130)
- at org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor.executeRequest(AbstractHttpInvokerRequestExecutor.java:136)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:192)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.executeRequest(HttpInvokerClientInterceptor.java:174)
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:142)
... 10 more

We found that there is a bug in java http://bugs.sun.com/view_bug.do?bug_id=6370908 according to which there is no support for HTTP proxy type in SocksSocketImpl class. We even check the source code also and find the same.

Please provide me some pointers on what can be the possible workaround for this. Is there any other alternate configuration or approach. We are using HTTP Spring framework.

Thanks in advance for your help.

I agree. Here's the link: http://aspose.com/file-tools
subject: java.net.SocketException: Unknown proxy type : HTTP
Similar Threads
Integration testing with Maven and HTTP Client - connection refused
"Connection timed out" with HttpClient.
Unable to sendViaPost to url
Wasce error - Server IBM WASCE v2.1 Server at localhost failed to start.
can't run rampart client