Troubleshooting
This topic provides troubleshooting information for connections. Click a section title to display its content:
Connecting
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.
Getting the Metadata of a Thing
You can use the ConnectedThingClient.getThing(thingName).getMetadata to retrieve client metadata for a Thing. Client metadata is creonly only from annotations with the Java SDK If you do not have any annotations or if you never all initializeFromAnnotations() in your constructor, you cannot retrieve metadata with getMetadata.
For More Information