Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
HI All,
I installed on VM Machine (111.111.111.14) Windows 7 64bit a Thingworx 8.0.3.-b52 and I created a Thing 'TestRemoteThing' using ThinTemplate RemoteThing.
I created another VM Machine (111.111.111.11) Windows 7 64bit where I installed Eclipse and I imported a package Java SDK 221-Java-SDK-6-0-4-595.zip (dowbloaded from PTC Market place)
I'm using the documentation from http://support.ptc.com/help/thingworx_hc/thingworx_edge/index.html.
I Run SimpleClient.java using :
- config.setUri("wss://111.111.111.14:443/Thingworx/WS");
- config.setAppKey("1146b538-3ad5-4977-8679-3f6bf2b55081"); application-key generate on Thingworx
but the connection failed.
Is it necessary a setting on Thingworx platform ?
I run a test WebServices.html and it answer
WebSocket Test
ERROR: undefined
DISCONNECT
What is the next check I have to do?
Do I have to install any software on the PC on which Thingworx is installed?
Many Thanks
BR
Dimitri
Solved! Go to Solution.
Hi All,
I used the following step :
1) stop tomcat
2) create a new directory keystore on c:\<tomcat_pathname>
3) create a self-signed certificate with java keytool running the following command
c:\<path_java>\jre\bin\Keytool -genkey -alias tomcat -keyalg RSA -keystore c:\<tomcat-folder>\keystore\.keystore
using password "changeit"
4) add the follwing row in C:\<tomcat_pathname>\conf\server.xml
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="keystore/.keystore" type="RSA" />
</SSLHostConfig>
</Connector>
5) start Tomcat
6) using IE with url https:/7localhost:8443, click on "Continue to this website (not recmmended)
By
Dimitri
I create the keystore file into <pathname_tomcar>\kestore\.keystore using the command
c:\<path_java>\jre\bin\Keytool -genkey -alias tomcat -keyalg RSA -keystore <tomcat-folder>\keystore\.keystore
Hi @dbologna I would start checking details in following order
- Are all the pre-requisites met as described in the Setting Up to Run Sample Applications
- Can those two VMs interact with each other? e.g. is VM1 able to ping VM2 and vice versa , ensure connection is somehow not blocked over the network or
- To which user account does this app key belong to? I.e. does it have sufficient access rights assigned to it
- Start debugging your code from the Eclipse IDE together with logs on trace to try and get more specific error stack
If you are done with the pre-requisites I don't think there's any separate requirement to install any specific software on ThingWorx server
My answers (bold) at your/her questions ?
- Are all the pre-requisites met as described in the Setting Up to Run Sample Applications.
I’m not using Glade but I’m using Eclipse (https://developer.thingworx.com/resources/guides/thingworx-java-sdk-setup-guide)
- Can those two VMs interact with each other? e.g. is VM1 able to ping VM2 and vice versa , ensure connection is somehow not blocked over the network or
VM1 ping VM2 and vice versa . The firewall on both VM are disabled.
- To which user account does this app key belong to? I.e. does it have sufficient access rights assigned to it
The application key create in Thingworx Platform have ‘Administrator’ as ‘User Name Reference’.
- Start debugging your code from the Eclipse IDE together with logs on trace to try and get more specific error stack
If I’m using config.setUri(“ws://111.111.111.14:80/Thingworx/WS”); the connection works.
If I’m using config.setUri(“wss://111.111.111.14:8443/Thingworx/WS”); not work because the tomcat not support SSL/TLS protocol.
I have enabled this protocol by performing the following steps (using the support documentations) :
keytool -genkey -alias tomcat -keystore tomcat.keystore -keyalg RSA
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS"
enableLookups="false" keystoreFile="conf/tomcat.keystore" keystorePass=”changeit!" />
57 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-jsse-nio-8443"]
01-Mar-2018 22:16:01.770 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-8443]]
org.apache.catalina.LifecycleException: Protocol handler initialization failed
I’m using Tomcat 9.0.5 and java 1.8.0_144.
Every suggestion is well received.
BR
Dimitri
Mant thanks,
I found solution for the following version of Tomcat 8.5.23, 8.5.28 and 9.0.5.
BR
Dimitri
Hi All,
I used the following step :
1) stop tomcat
2) create a new directory keystore on c:\<tomcat_pathname>
3) create a self-signed certificate with java keytool running the following command
c:\<path_java>\jre\bin\Keytool -genkey -alias tomcat -keyalg RSA -keystore c:\<tomcat-folder>\keystore\.keystore
using password "changeit"
4) add the follwing row in C:\<tomcat_pathname>\conf\server.xml
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="keystore/.keystore" type="RSA" />
</SSLHostConfig>
</Connector>
5) start Tomcat
6) using IE with url https:/7localhost:8443, click on "Continue to this website (not recmmended)
By
Dimitri
I create the keystore file into <pathname_tomcar>\kestore\.keystore using the command
c:\<path_java>\jre\bin\Keytool -genkey -alias tomcat -keyalg RSA -keystore <tomcat-folder>\keystore\.keystore