ThingWorx Edge Java SDK > Troubleshooting Connections
Troubleshooting Connections
As a general rule, when you cannot connect, make sure all the hardware (machines and cables, if applicable) is properly in place. Then, check the logging level for your client application. If not already set to TRACE, set the log level to TRACE, and re-run the application. Search the logs for messages that may or do pertain to the issue.
If the SDK cannot connect to the ThingWorx platform via websockets, verify the following conditions:
Verify that the port is supplied in the URI, even if it is a default port for ws or wss. For example, the following URI will not connect: ws://host/ThingWorx/WS. Change this URI to be: ws://host:80/ThingWorx/WS.
Verify that an anti-virus program is not running and blocking websocket communication.
Verify that a firewall is not blocking the port.
Verify that the following subsystems are started on the ThingWorx platform: WS Communications Subsystem and WS Execution Processing Subsystem.
Reconnecting After a Network Disruption
Network conditions may introduce disruptions between the remote asset and the ThingWorx platform. To help mitigate this, the remote asset will reestablish its connection with the ThingWorx platform after a number of timeouts are encountered. To configure this number, invoke the ClientConfigurator.setTimeoutCountReconnectionThreshold or process a configuration file with ClientConfigurator that defines directive, timeoutCountReconnectionThreshold. The default value is 5 timeouts before the connection is reestablished. Do not set the number of timeouts to a value lower than 1.
Intercepting a Bind Failure
When an explicit binding fails (ConnectedThingClient::bindThing), an exception is thrown. When the Client-EndpointMonitor tries to re-bind after an unexpected disconnection and it fails, no exception is thrown. It is possible to intercept the fact that the bind failed from client code. The ConnectedThingClient.addChangeListener should allow you to add a callback for a possible ENDPOINT_CLOSED event.