I have an issue with the cloud connector - last release where it is working with my installation is release #1607,
2019-06-14 08:08:07.941 [ERROR] [io.socket.thread.EventThread ] - Task threw exception
java.lang.NoClassDefFoundError: okhttp3/Call$Factory
at io.socket.client.Manager$1.run(Manager.java:277) ~[?:?]
at io.socket.thread.EventThread.exec(EventThread.java:55) ~[262:io.socket.engine.io-client:1.0.0]
at io.socket.client.Manager.open(Manager.java:266) ~[?:?]
at io.socket.client.Manager.open(Manager.java:256) ~[?:?]
at io.socket.client.Socket$3.run(Socket.java:142) ~[?:?]
at io.socket.thread.EventThread$2.run(EventThread.java:80) [262:io.socket.engine.io-client:1.0.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.ClassNotFoundException: okhttp3.Call$Factory cannot be found by io.socket.engine.io-client_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[?:?]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[?:?]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[?:?]
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
... 9 more
Going back to #1607 solves the problem. Is it just me or is anyone else having trouble - I did not find any relevant posts with cloud connector the last couple of days.
Currently on #1611.
Uninstalling the OpenHab Cloud Connector did not work.
Reinstalling OH did not work.
I keep getting:
2019-06-14 18:04:23.205 [ERROR] [io.socket.thread.EventThread ] - Task threw exception
java.lang.NoClassDefFoundError: okhttp3/Call$Factory
at io.socket.client.Manager$1.run(Manager.java:277) ~[?:?]
at io.socket.thread.EventThread.exec(EventThread.java:55) ~[217:io.socket.engine.io-client:1.0.0]
at io.socket.client.Manager.open(Manager.java:266) ~[?:?]
at io.socket.client.Manager.open(Manager.java:256) ~[?:?]
at io.socket.client.Socket$3.run(Socket.java:142) ~[?:?]
at io.socket.thread.EventThread$2.run(EventThread.java:80) [217:io.socket.engine.io-client:1.0.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.ClassNotFoundException: okhttp3.Call$Factory cannot be found by io.socket.engine.io-client_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484) ~[?:?]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395) ~[?:?]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387) ~[?:?]
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
... 9 more
Ok. I found the problem, still looking for a solution. Itās two-fold. The servicemix-dependencies are not installed because the wrapped other dependencies donāt declare them as required and the second problem is that the okhttp-servicemix imports javax.annotation.meta and the only bundle I found that is exporting that is the jsr305 servicemix but unfortunately that is also exporting javax.annotation which collides with the javax.annotation exported by the okhttp-servicemix.
Thanks for your fast help, it seems it isnāt a tipical āitās not a bug, itās a featureā like problem, I hope youāll find the solution soon.
Apache ServiceMix :: Bundles :: okhttp (241)
okhttp3/Call$Factory.class
openhab> bundle:status 241
Active
openhab> bundle:restart 227
openhab> Exception in thread "EventThread" java.lang.NoClassDefFoundError: okhttp3/Call$Factory
at io.socket.client.Manager$1.run(Manager.java:277)
at io.socket.thread.EventThread.exec(EventThread.java:55)
at io.socket.client.Manager.open(Manager.java:266)
at io.socket.client.Manager.open(Manager.java:256)
at io.socket.client.Socket$3.run(Socket.java:142)
at io.socket.thread.EventThread$2.run(EventThread.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: okhttp3.Call$Factory cannot be found by io.socket.engine.io-client_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 9 more
Can someone explain to me why this happens? @maggu2810 perhaps? I have no idea why the class is not found. Versions are ok AFAIK,
io.socket/engine.io-client/1.0.0 depends on com.squareup.okhttp3/okhttp/3.8.1 which is exactly the installed version.
Edit: With wrapped versions of the other two bundles it works. Iāll revert the change and re-add it when the osgiify-PR is merged.
They are imported. But maybe the problem is that the automatic wrapping done by karaf marks all imports as resolution:="optional" (which is not true for okhttp3). This bundle was installed before and already active when I installed the okhttp3-servicemix. I did not re-resolve the engine.io-client bundle, so maybe it did not pick up the available classes from that bundleā¦
My osgiified-bundles from my OSGiify-PR properly declare the dependency and therefore itās working. Another reason to get rid of the karaf-wrapping ASAP.
If it is done the way you describe you need to refresh the bundle(s).
It is also possible to use the Karaf wrapping but declare that no import should be optional (thatās just instructions for the wrap logic of Bnd ā yes that one is used in the background).
The wrapping changes have been reverted with PR #5743. Thereās now a 2.5.0-SNAPSHOT build #1617 containing these changes. So hopefully the Cloud Connector is working again.