Skip to main content
1-Visitor
April 25, 2019
Solved

Azure IoT Hub Connector - Thingworx 8.4 - Connection Error

  • April 25, 2019
  • 2 replies
  • 7289 views

Hi All

 

I am having an issue connecting to the Azure IoT Hub from ThingWorx 8.4.

- The Connector and Thingworx are on the same server

- The attached azure-iot.conf file was configured using direction from PTC Using this link 

 

When run the azure-iot.bat file from cmd i get the following error. Any help with this issue is much appreciated! Thanks!

 

14:06:16.812 [NettyClient-NIO-5] ERROR c.t.s.i.t.netty.NettyBytesChannel - Error while establishing websocket connection on channel com.thingworx.sdk.impl.transport.netty.NettyBytesChannel$2@6069b8ae.
java.net.ConnectException: Connection refused: no further information: localhost/127.0.0.1:8080
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:224)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:289)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Unknown Source)

 

 

 

Best answer by AnnaAn
Hi Harry, Please do it again in your test environment with following steps: 1.Change "HTTPRequestHeaderMaxLength": 5000 , in ThingworxPlatform/platform-settings.json (by default it is set to 2000) check from http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FGetting_Started%2FInstallingandUpgrading%2FInstallation%2Fplatform_settings_json_configuration_details.html (sorry hyperlink to a text is not working on my side now so copying the total link) regarding how to set the HTTPRequestHeaderMaxLength parameter 2.Change Validator.HTTPHeaderValue=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ % \u00A1-\uFFFF'"]*$ in ThingworxStorage/esapi/validation.properties 3.After the changes, restart Tomcat server (choose the time for restarting when users will not be impacted) Hope this helps, Br, Anna

2 replies

14-Alexandrite
April 26, 2019

Hello,

 There are three possibilities I could imagine to cause this issue:

1. Not setting correct Connection server system variables.

Look here to know how to set it properly

2. Configure wrong AppKey or ThingWorx url in transport.websockets in your connector conf file. Please check again to make sure it's accessing the correct port;

3. if still not work for 1,2, try to use 127.0.0.1 instead of hostname, maybe there is some hostname resolving issue when accessing from same machine, but I'm not sure about this.

 

There is an article mentioning similar issue for your reference.

Hope it helps,

 

Thanks,

 

Br,

Anna

hgrewal1-VisitorAuthor
1-Visitor
April 22, 2019
Hi Anna,
I double checked the recommendations you shared and everything looks good to me. Please refer the attached files that you requested.
FYI- if I disable ssl and try to connect to things using ws://localhost:8080 or 127.0.0.1 the cxserver log starts growing like crazy, many gb's in couple mins.
Appreciate you taking the time to help me out.

Thanks
Harry

5-Regular Member
October 10, 2019

Hello @hgrewal ,

I'm having exactly same error. I changed my "HTTPRequestHeaderMaxLength": 5000. Still not working.

How did you solve your problem?

 

thanks!!