Skip to main content
1-Visitor
January 24, 2022
Question

Azure IoT Hub Connector 4.2 failed to start

I'm trying to run Azure IoT Hub Connector via windows cmd and got this error in step 10 from the guide in ptc support. I am using java version 1.8.0_161 and ThingWorx 9.2.

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Module
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.google.inject.Module
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more

Thanks in advance.

5 replies

1-Visitor
January 24, 2022

I got it working by reinstalling the connector, but now I got error on cxserver.log:


ERROR c.t.s.i.transport.MuxingBytesChannel - Error refilling connections on [channel: null, endpoint ws://localhost:8080/Thingworx/WS, uri: ws://localhost:8080/Thingworx/WS] failed : java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;

searching shows because of the java version, but I try jdk 8 (1.8u161), 11.0 and 15.0.1 still the same error. Any suggestions?

Translate
24-Ruby IV
January 24, 2022

 Hi,

 

Take a look at this discussion - "Getting java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory exception": https://stackoverflow.com/questions/1551697/getting-java-lang-classnotfoundexception-org-apache-commons-logging-logfactory 

Translate
1-Visitor
January 24, 2022

thanks for the reply

I got it working by reinstalling, but now I got error on cxserver.log:


ERROR c.t.s.i.transport.MuxingBytesChannel - Error refilling connections on [channel: null, endpoint ws://localhost:8080/Thingworx/WS, uri: ws://localhost:8080/Thingworx/WS] failed : java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;

the IoT Hub Connector still runs in cmd despite the error, but IoT_Hub.Thing on ThingWorx is still disconnected.

Translate
24-Ruby IV
January 24, 2022

Several articles with a similar error:

Translate