Openhab Cloud Connector not working anymore after snapshot 1607

Unfortunately, todayā€™s 2.5.0~S1616-1 did not fix this issue :(.
Is there any way to report this topic to the developers, as an issue?

Maybe itā€™s caused by PR #5701 @J-N-K?

Iā€˜ll have a look

1 Like

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.

2 Likes

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.

Really strange. I just tried to reproduce the problem with an empty karaf container and there it works.

So we better stay with #1607 @J-N-K ?


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.

Have a look at the package imports. Are you sure the package containing the class is imported?

Archiver-Version: Plexus Archiver
Bnd-LastModified: 1560785409670
Build-Jdk: 1.8.0_92
Built-By: NaoyukiKanezawa
Bundle-ManifestVersion: 2
Bundle-Name: Engine.IO Client
Bundle-SymbolicName: io.socket.engine.io-client
Bundle-Version: 1.0.0
Created-By: 1.8.0_201 (Oracle Corporation)
Export-Package: io.socket.emitter,io.socket.engineio.client;uses:="io.so
 cket.emitter,io.socket.engineio.parser,io.socket.utf8,okhttp3",io.socke
 t.engineio.client.transports;uses:="io.socket.emitter,io.socket.enginei
 o.client,io.socket.engineio.parser,io.socket.utf8,okhttp3",io.socket.en
 gineio.parser;uses:="io.socket.utf8",io.socket.global,io.socket.parseqs
 ,io.socket.thread,io.socket.utf8,io.socket.yeast
Generated-By-Ops4j-Pax-From: wrap:file:/var/lib/openhab2/tmp/mvn/io/sock
 et/engine.io-client/1.0.0/engine.io-client-1.0.0.jar$Bundle-Name=Engine
 .IO%20Client&Bundle-SymbolicName=io.socket.engine.io-client&Bundle-Vers
 ion=1.0.0
Import-Package: okhttp3;resolution:=optional,okio;resolution:=optional,o
 rg.json;resolution:=optional
Originally-Created-By: Apache Maven 3.5.0
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"
Tool: Bnd-2.3.0.201405100607

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).

1 Like

Hello,
Can you let us know when the new image is available for download.

i spend a lot of time getting openhab to work with the cloud connector just to find out it was broken 2 days ago.

i am running it on a synology docker image so i do not see an easy way to roll back to the image version 2 days ago(1607)

thanks

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. :slight_smile:

1 Like

thanks. online now

now i only need to make my devices visible.
tagging part still unclear

1 Like

Thanks a lot! #1617 solves the problem!

1 Like

It appears to be fixed but after a while I get:

2019-06-20 15:01:28.802 [INFO ] [io.openhabcloud.internal.CloudClient] - Disconnected from the openHAB Cloud service (UUID = 7736390c-52ac-4e90-828e-xxxxxxxx, base URL = http://localhost:8080)

So I can unfortunately not confirm that this issue is closed.

There seems to be an issue with the Cloud now :crying_cat_face:

See:

Correct, doesnā€™t work with #1607 either.

I think this is a different problem.

Running 2.5.0.M2 I tried to setup Myopenhab. Installed the add-on, registered successfully, and Myopenhab is online. However when trying to open my dashboard I get Error 504 Gateway time-out.
The openhab.log shows an error:

2019-08-30 21:39:36.293 [ERROR] [io.socket.thread.EventThread        ] - Task threw exception
java.lang.ClassCastException: org.json.JSONObject cannot be cast to org.json.JSONObject
        at org.openhab.io.openhabcloud.internal.CloudClient$6.call(CloudClient.java:215) ~[?:?]
        at io.socket.emitter.Emitter.emit(Emitter.java:117) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.client.Socket.onevent(Socket.java:338) ~[?:?]
        at io.socket.client.Socket.onpacket(Socket.java:289) ~[?:?]
        at io.socket.client.Socket.access$100(Socket.java:24) ~[?:?]
        at io.socket.client.Socket$2$2.call(Socket.java:120) ~[?:?]
        at io.socket.emitter.Emitter.emit(Emitter.java:117) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.client.Manager.ondecoded(Manager.java:427) ~[?:?]
        at io.socket.client.Manager.access$1600(Manager.java:30) ~[?:?]
        at io.socket.client.Manager$7.call(Manager.java:403) ~[?:?]
        at io.socket.parser.IOParser$Decoder.add(IOParser.java:105) ~[?:?]
        at io.socket.client.Manager.ondata(Manager.java:419) ~[?:?]
        at io.socket.client.Manager.access$1000(Manager.java:30) ~[?:?]
        at io.socket.client.Manager$2.call(Manager.java:370) ~[?:?]
        at io.socket.emitter.Emitter.emit(Emitter.java:117) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.engineio.client.Socket.onPacket(Socket.java:551) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.engineio.client.Socket.access$1000(Socket.java:36) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.engineio.client.Socket$5.call(Socket.java:335) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.emitter.Emitter.emit(Emitter.java:117) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.engineio.client.Transport.onPacket(Transport.java:126) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.engineio.client.Transport.onData(Transport.java:118) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.engineio.client.transports.WebSocket.access$100(WebSocket.java:24) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.engineio.client.transports.WebSocket$1$2.run(WebSocket.java:71) ~[256:io.socket.engine.io-client:1.0.0]
        at io.socket.thread.EventThread$2.run(EventThread.java:80) [256: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) [?:?]

Is Myopenhab down or am I doing something wrong?