Skip to main content
17-Peridot
June 17, 2021
Question

Java Edge SDK cannot connect to ThingWorx Server, error 302

  • June 17, 2021
  • 2 replies
  • 921 views

Hi, 

The Java edge SDK raise 302 error code when connecting to ThingWorx server,   the IP address and appKey is correct .   The server has a customized Authenticator enabled , but sending post request via Postman to the server works.   Why the java sdk can not connect to the server ?    

 

ThingWorx version: 9.1.0

edge SDK: 7.0

JDK :  11

 

seanccc_0-1623917804622.png

 

seanccc_1-1623918072478.png

 

Regards,

Sean

 

2 replies

15-Moonstone
June 17, 2021

@seanccc : Instead of ip can you try with the domain name of your server in the uri. Ex:"ws://pp-20050704237k.portal.ptc.io:8080/Thingworx/WS"? Also, is SSL enabled for your thingworx server? If yes, in that case connection uri in sdk should use wss instead of ws. 

Community Manager
July 1, 2021

Hi @seanccc.

 

Were you able to make any progress on your issue?  Did you test using the domain name?  The IP address seen in the pic you provided indicates you are trying to connect internally, but I assume that is not the case.  Please make sure to use the public IP address if communicating outside your network.

 

Also, is it possible that you have SSL enabled in your java SDK?  From the url in the log snippet, we can see that SSL is not enabled on the ThingWorx side.  If you have it enabled on the sending side, that could be the cause of the issue.

 

Regards.

 

--Sharon