Getting java.net.UnknownHostException while calling Microsoft sharepoint from http client

Hi Floks,

I am getting java.net.UnknownHostException while calling Microsoft sharepoint(knowledge management) portal REST url, actually when I try from google chrome browser, it is working fine, but when I try to invoke same URL by using pub.client:http service, it is throwing below exception, it is REST webservice url, am passing my windows server credentials in http client, but no use, sam exception is throwing, Could you please help me for below error, how to resolve it…

com.wm.app.b2b.server.ServiceException: java.net.UnknownHostException: sumxg594-del4
at pub.clientimpl.http(clientimpl.java:1254)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:619)
at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:443)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:648)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:39)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:49)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:243)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:171)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:303)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:34)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:375)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:547)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:386)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:238)
at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:225)
at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:247)
at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:520)
at com.wm.lang.flow.FlowState.step(FlowState.java:389)
at com.wm.lang.flow.FlowState.invoke(FlowState.java:360)
at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:1080)
at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:648)
at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:39)
at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:49)
at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:243)
at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:49)
at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:171)
at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:303)
at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:34)
at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:375)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:547)
at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:386)
at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:238)
at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:119)
at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:164)
at com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:175)
at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:384)
at com.wm.util.pool.PooledThread.run(PooledThread.java:127)
at java.lang.Thread.run(Thread.java:795)
Caused by: java.net.UnknownHostException: sumxg594-del4
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:208)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.net.Socket.connect(Socket.java:642)
at com.wm.net.socket.TCPSocketFactory.createSocket(TCPSocketFactory.java:88)
at com.wm.net.socket.TCPSocketFactory.createSocket(TCPSocketFactory.java:62)
at com.wm.net.socket.pool.SocketPool.getSocketWrapper(SocketPool.java:217)
at com.wm.net.socket.pool.SocketPoolManager._getSocketWrapper(SocketPoolManager.java:128)
at com.wm.net.socket.pool.SocketPoolManager.getSocketWrapper(SocketPoolManager.java:110)
at com.wm.net.socket.pool.SocketPoolManager.getSocketWrapper(SocketPoolManager.java:103)
at com.wm.net.NetURLConnection.getSocket(NetURLConnection.java:1073)
at com.wm.net.NetURLConnection.openDirectConnection(NetURLConnection.java:1050)
at com.wm.net.NetURLConnection.connect(NetURLConnection.java:235)
at com.wm.net.NetURLConnection._getInputStream(NetURLConnection.java:455)
at com.wm.net.NetURLConnection.getInputStream(NetURLConnection.java:373)
at com.wm.net.HttpContext.getFinalInputStream(HttpContext.java:758)
at com.wm.net.HttpContext.getInputStream(HttpContext.java:348)
at com.wm.net.HttpContext.getInputStream(HttpContext.java:320)
at com.wm.net.HttpContext.get(HttpContext.java:362)
at com.wm.net.HttpContext.get(HttpContext.java:378)
at pub.clientimpl.http(clientimpl.java:1050)
… 41 more

when I tested host (sumxg594-del4) from command prompt, it is responding, but when I try same host along with port ( sumxg594-del4:99 )from http client service, I am getting above error.

my url got GET webservice like : http://sumxg594-del4:99/sites/KLMpcIntegration/_api/web/lists(guid’cb0145c5-4581-4d56-a8b6-8ada8a29ec7a’)

Thanks,
Varun

As a security concern, do not post client hostnames or IP on the forums.

There are several reasons for this error, did you check to replace the hostname with ip address (try nslookup HOSTNAME).

Check DNS/server configuration and make sure there is no network glitch (firewall block) involve network team if there is some. Hope, you have tried a telnet or ping from the IS machine.

Try doing a test from Postman or Soap UI and see the results.

Hi Mahesh,

Thanks for your suggestion, but whatever I have provided Host and port number are manipulated, that is reference values.

Thanks,
Varun

That’s perfect. Any clues on your issue?