Skip to main content
1-Visitor
February 1, 2017
Solved

Java SDK is not connecting to local host

  • February 1, 2017
  • 2 replies
  • 4557 views

Hi Team,

I have got the java SDK from thingworx market place and i am trying to connect a sample thing. But the thing is not connecting and i am getting the log results as follows,

Please have a look at the logs attached and let me know solution to get my sample thing connected to Thingworx remote thing. Thanks.

Best answer by rkandasamy

Hi Sushant,

Thanks for your prompt replies.

I could get my current java SDK connecting to Thingworx. The reason was that the identifier mentioned in the SDK code was not added in the Thingworx server side remote thing.

2 replies

5-Regular Member
February 1, 2017

Hi Rdhakrishnan, is this complete log? Have you created the corresponding RemoteThing in the ThingWorx platform? Do you see your Thing (initated from the JavaSDK) as unbound if you check on the Platform > Monitoring > Remote Things

5-Regular Member
February 1, 2017

Just to add to that,  your RemoteThing in ThingWorx platform should match to your thing created in Java SDK, which i think is called as "SteamSensorGateway"

1-Visitor
February 1, 2017

Hi Sushant Pandey,

Thanks for your prompt response. SteamSensorGateway is SDKGateWay type. Actual Thing is VendingMachine1.

I am also wondering why the connection is not established between remote things. In addition to what ever the logs i have attached, below lines are keep on repeating,

20:59:45.104 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 1198168038] PONG has been received

21:00:20.103 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 651137855] Client has been idle, sending websocket ping with timeout 10000 ...

21:00:20.103 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=9 length=0

21:00:20.104 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=10

21:00:20.104 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=0

21:00:30.106 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 216683491] PONG has been received

21:01:05.105 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 651137855] Client has been idle, sending websocket ping with timeout 10000 ...

21:01:05.105 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=9 length=0

21:01:05.105 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=10

21:01:05.106 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=0

21:01:15.106 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 1507608264] PONG has been received

21:01:50.107 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 651137855] Client has been idle, sending websocket ping with timeout 10000 ...

21:01:50.107 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=9 length=0

21:01:50.108 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=10

21:01:50.108 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=0

21:02:00.107 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 845641462] PONG has been received

I am not able to come to any reason for the same.

5-Regular Member
February 1, 2017

This appears to be regular chatter on the websocket could you please check the Monitoring >Remote Things on the platform? Is your thing named exactly the same i.e. VendingMachine1 on the platform?