Error connecting Java Edge SDK sample program to Thingworx server:
I am getting the error when I try to run the sample java program bundled in ThingWorx Java SDK.
11:25:46.456 [Client-EndpointMonitor-1] ERROR c.t.c.c.c.n.NettyClientConnectionFactory - Exception occurred while connecting to server
java.util.concurrent.TimeoutException: timeout waiting for websocket handshake to complete
at com.thingworx.communications.client.connection.netty.NettyClientConnectionFactory$HandshakeCompletionNotifier.await(NettyClientConnectionFactory.java:563) ~[thingworx-communications-client-6.0.0.189.jar:na]
at com.thingworx.communications.client.connection.netty.NettyClientConnectionFactory.createConnection(NettyClientConnectionFactory.java:309) ~[thingworx-communications-client-6.0.0.189.jar:na]
at com.thingworx.communications.client.endpoints.ClientCommunicationEndpoint.refillConnections(ClientCommunicationEndpoint.java:225) [thingworx-communications-client-6.0.0.189.jar:na]
at com.thingworx.communications.common.endpoints.monitor.ConnectivityMonitorTask.dutyCycleOn(ConnectivityMonitorTask.java:150) [thingworx-communications-client-6.0.0.189.jar:na]
at com.thingworx.communications.common.endpoints.monitor.ConnectivityMonitorTask.run(ConnectivityMonitorTask.java:264) [thingworx-communications-client-6.0.0.189.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_66]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_66]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_66]
11:25:46.456 [Client-EndpointMonitor-1] INFO c.t.c.c.c.n.NettyClientConnectionFactory - forcing underlying tcp channel closed [is open: false, is active: false]
11:25:46.457 [Client-EndpointMonitor-1] ERROR c.t.c.c.e.ClientCommunicationEndpoint - Refilling connections on [endpoint 0, uri: wss://localhost:80/Thingworx/WS] failed : timeout waiting for websocket handshake to complete
11:25:46.458 [Client-EndpointMonitor-1] ERROR c.t.c.c.e.ClientCommunicationEndpoint - Exception refilling connections was:
Connection setup information in the java client is as follows:
config.setUri("ws://localhost:80/Thingworx/WS");
I have tried importing a certificate in tomcat (tomcat listens on port 8443 after that) and changed the connection information as follows:
config.setUri("wss://localhost:8443/Thingworx/WS");
But that also gives me similar error.
Can some one please guide me how to fix this error?
