Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hello,
I am trying to set up tunneling in my Java App for Remote Desktop purposes.
Background:
Java App Configuration:
twxClientConfigurator.setUri(AppProperties.getAppProperties().getProperty("thingworx.uri"));
twxClientConfigurator.setAppKey(AppProperties.getAppProperties().getProperty("thingworx.appKey"));
twxClientConfigurator.ignoreSSLErrors(true);
twxClientConfigurator.tunnelsEnabled(true);
On the ThingWorx side everything is configured as it should be:
The Error which I am receiving, while trying to download wsadpater.jsp file:
An the ThingWorx logs:
Remote access attempt failed for tunnel name vnc on remote thing Remote access attempt failed for tunnel name vnc on remote thing mything. mything does not support tunneling.
It is very urgent. Hope someone can help me.
Solved! Go to Solution.
I am ashamed about it, but I found the source:
Instead of this:
this.createTWXClientConfig();
thingClient = new ThingClient(this.twxClientConfigurator);
I was doing this:
thingClient = new ThingClient(this.twxClientConfigurator);
this.createTWXClientConfig();
Now the fun part:
In createTWXClientConfig() method I was setting up URI & appKey. In both cases I was able to connect to the Platform without any issues, but tunneling was not working in 2nd case...
Now everything is ok.
Thanks,
Adam
I feel like this is something "simple" such as the mashup is misconfigured. I will search our internal tracker and see if something simple comes up. Double chceck that you have the mashup configured correctly and that the thing has the tunnel configured etc. I'll follow-up in a bit (if nobody else does)
One more place to check is in %userprofile%\ThingworxRemoteAccess\thingworx_tunneler.log (assuming windows, $HOME if not). is there anything helpful in there?
Hi Clint,
Thanks for response. What's funny I created Unit test with very simple use case:
final String ThingName = "TunnelThing2";
ClientConfigurator config = new ClientConfigurator();
config.setUri("ws://localhost:8080/Thingworx/WS");
config.setAppKey("7edabf28-8ed6-4f99-9326-bb04b04c9dd7");
config.ignoreSSLErrors(true);
config.tunnelsEnabled(true);
try {ConnectedThingClient client = new ConnectedThingClient(config);
VirtualThing myThing = new VirtualThing(ThingName, "Tunnel Example", client);
client.bindThing(myThing);
client.start();
while (!client.isShutdown()) {Thread.sleep(5000);
}} catch (Exception e) {
e.printStackTrace();
}
This app is working perfectly as an Unit Test in the same application. Will try to add it to the Jar and test it as well.
Mashup is working fine for this asset from Unit Test.
Probably there is an issue with thread's or something like that. Will check it one more time.
Thanks,
Adam
I am ashamed about it, but I found the source:
Instead of this:
this.createTWXClientConfig();
thingClient = new ThingClient(this.twxClientConfigurator);
I was doing this:
thingClient = new ThingClient(this.twxClientConfigurator);
this.createTWXClientConfig();
Now the fun part:
In createTWXClientConfig() method I was setting up URI & appKey. In both cases I was able to connect to the Platform without any issues, but tunneling was not working in 2nd case...
Now everything is ok.
Thanks,
Adam
So - you're all set then right? I had a feeling it was something simple... I'll pass along how helpful our logging and errors were (and by that I mean we should strive to improve them)