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

Java SDK - Tunneling Remote Desktop

A_Macierzynski
14-Alexandrite

Java SDK - Tunneling Remote Desktop

Hello,

 

I am trying to set up tunneling in my Java App for Remote Desktop purposes.

 

Background:

  • Java SDK 6.1
    • Netty 4.1.21 ?
  • ThingWorx 8.0/8.1
  • UltraVNC

 

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:

1.PNG

2.PNG3.PNG

 

The Error which I am receiving, while trying to download wsadpater.jsp file:

5.PNG

 

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

5 REPLIES 5

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)

cdovholuk
6-Contributor
(To:cdovholuk)

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)

Top Tags