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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Can not run sample Thingworx java sdk code

ptc-6737818
9-Granite

Can not run sample Thingworx java sdk code

I am trying to run code provide from https://developer.thingworx.com/en/resources/guides/thingworx-java-sdk-tutorial

 

put threads are executing repeatedly, no error occures.

I have not provided  Thingworx username and password in my code. I had only set appKey , which i created from Thingworx composer Application key.

 

 

After executing i get Logs as shown in file.

6 REPLIES 6
posipova
20-Turquoise
(To:ptc-6737818)

Have you checked the connection from the composer/platform side? It seems like it's connecting with no issues. You may look in your application log too to see if there is anything unusual in there (from the monitoring tab in your Composer).

shindemayur
13-Aquamarine
(To:posipova)

Thank you  posipova,

 

Yes I looked into the application log , I found their a warning as:

 

Server WebSocket closed unexpectedly, unregistering from Server Endpoint [ws session id: 8, endpoint id: 9, endpoint name: null] An existing connection was forcibly closed by the remote host

 

******************Also, 

Do I need to provide my Thingworx username and  Password in code or some other file for authentication?

 

posipova
20-Turquoise
(To:shindemayur)

Based on the logs you provided, it actually seems like it's working. Have you checked the connection whether it's set to true? Your sdk log shows pong being received which means it's connected.

slangley
23-Emerald II
(To:posipova)

Hi @shindemayur.

 

If the previous post by @posipova helped you to solve your issue, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

shindemayur
13-Aquamarine
(To:slangley)

Thanks for the reminder @slangley ,

but I am able to find Accept solution option on the page.

slangley
23-Emerald II
(To:shindemayur)

Hi @shindemayur.

 

You are most likely not logged in:

 

PreLogin.PNG

 

Following login you should see the option to select the appropriate solution.  Just remember to scroll to the appropriate response before clicking the Accept as Solution button:

 

PostLogin.PNGRegards.

 

--Sharon

Top Tags