cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Java SDK is not connecting to local host

rkandasamy
1-Newbie

Java SDK is not connecting to local host

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

11 REPLIES 11
supandey
19-Tanzanite
(To:rkandasamy)

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

supandey
19-Tanzanite
(To:rkandasamy)

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"

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.

supandey
19-Tanzanite
(To:rkandasamy)

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?

Yes, in Monitoring -> Remote Things -> shows VendingMachine1 on the platform.

supandey
19-Tanzanite
(To:rkandasamy)

I may have misunderstood your question, but from above description you have connection to your Thing, have you created a Thing with same name in thr platform? If yes you could check the property isConnected for that thing whether its True/False, you can also confirm with the lastConnected property for that thing.

Or am i missing something?

Yes, For me the thing is not getting not connected. I could not find out from the logs also.

supandey
19-Tanzanite
(To:rkandasamy)

Can you please paste the screenshot of Properties screen from the VendingMachine1 Thing from the platform? As you have mentioned you do see the incoming connection in Monitoring > Remote Thing, this would mean you do have a connection.

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.

supandey
19-Tanzanite
(To:rkandasamy)

Glad it worked out!

nbansal
12-Amethyst
(To:rkandasamy)

Hello Rdhakrishnan Kandasamy, Please mark this answer of yours as correct, so that it is helpful for others! Thanks.

Top Tags