cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Azure IoT hub connector not working

Alex23
12-Amethyst

Azure IoT hub connector not working

Hi,

 

I am trying to link my IoT Hub with Thingworx so I followed this, bu when I try to launch the connection server I have the following error :

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/C:/Thingworx-Azure-IoT-Hub-Connector-2.0.0.141/connector/lib/guice-4.1.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
09:31:51.209 [main] INFO  i.n.util.internal.PlatformDependent - Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system unstability.
09:31:51.270 [main] INFO  c.t.f.i.AbstractManyPlatformWebSocketFabric - Many Platform WebSocket Fabric enabled without service discovery: endpoints=[ws://localhost:8080/Thingworx/WS]
09:31:51.285 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-1 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it
09:31:51.286 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-2 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it
09:31:51.286 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-3 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it
09:31:51.286 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-4 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it
09:31:51.286 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Subchannel ws://localhost:8080/Thingworx/WS-5 in channel ws://localhost:8080/Thingworx/WS was no longer valid - unregistering it
09:31:51.286 [main] INFO  c.t.s.i.transport.MuxingBytesChannel - Needed to reconnect subchannels on client endpoint [id: ws://localhost:8080/Thingworx/WS] : [active: 0, max: 5]
09:31:51.349 [main] INFO  c.t.connectionserver.PlatformImpl - Starting ConnectionServer: UUID=###############, Platform protocol=V1, Platform transport=WEBSOCKETS
09:31:51.349 [main] INFO  c.t.connectionserver.PlatformImpl - Waiting for connection to platform...
09:31:52.396 [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@5267b220.
java.net.ConnectException: Connection refused: no further information: localhost/127.0.0.1:8080
        at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at java.base/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.base/java.lang.Thread.run(Unknown Source)

I set the variable with the following line :

set AZURE_IOT_OPTS=-Dconfig.file=C:\Thingworx-Azure-IoT-Hub-Connector-2.0.0.141\connector\conf\azure-iot.conf -Dlogback.configurationFile=C:\Thingworx-Azure-IoT-Connector-2.0.0.141\connector\conf\logback.xml

I had no error when I set the variable....

 

 

Thank you

2 REPLIES 2
cdovholuk
12-Amethyst
(To:Alex23)

When there are spaces in the environment variable you must add quotes around the parameter.

Add a quote after the = sign, and one more at the end of the line.

Hi @Alex23,

 

Please check the port of on which your ThingWorx Platform is running. You need to put the same port in azure-iot.conf file under the tag :

 

platforms = "ws://localhost:80/Thingworx/WS"

 

Thanks,

Himanshu

Announcements


Top Tags