RFXCOM binding throws java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter

Hi,

I have an ubuntu 14.04 installation and have running Openhab 1.0 with rfxcom. However, when I try openhab 2.0, I am not able to connect at all to the usb device (/dev/ttyUSB0). The exception that is thrown indicates that some libraries are not found. I am not able to find the solution for this. From the code in the RFXComSerialConnect line 178, it seems to be that it is able to connect to the device and read some data, but not able to convert the data… Can somebody help me out with this?

openhab> Exception in thread “Thread-39” java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
at org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector$SerialReader.run(RFXComSerialConnector.java:178)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter cannot be found by org.openhab.binding.rfxcom_2.0.0.b1
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
… 1 more

This issue is a fallout of the move over to Karaf in OH2, the binding will need to be updated to work.

thanks for the quick reply. Not sure if you mean this, but I did update the binding in the .things file as below. I also installed libjaxb-api-java package. and passed the class path -> sudo ./start_debug.sh -cp /usr/share/java
If i change the name of the device to a non existing device, there is no such error and it complains at startup that the connection failed… with the settings below it doesn’t give a connection error… but the class not found error.

my .things config
Bridge rfxcom:bridge:usb0 [ serialPort="/dev/ttyUSB0" ] {
Thing temperature 12046 [deviceId=“12046”, subType=“TFA_TS34C__CRESTA”]
}

openhab2-addons/addons/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComSerialConnector.java

Sorry, I wasn’t clear enough. The RFXCOM addon needs a code change before it will work again.

ah, okay. now it is clear :wink: thanks

Will you create a PR for it?

If no one has submitted PRs by the time I set the new IDE later/tomorrow I will create PRs for the ones I find.

I just created the issue #611 for it.

I was quicker. Fixed it.

I noticed the OH2 Squeezebox binding also needs updating too. I didn’t get to try any others last night.

This is weird. I thought I had tested and fixed them all, but it seems that my commit got somehow lost :frowning:
Would be great if you could send PRs for all problems that you find - thanks!

thanks for the quick fix. Not sure though but it looked like the latest build (73) didn’t include the changes. after modifying the manifest myself, it works. thanks.
I think I see something else that goes wrong. It looks like that the auto detection of the usb devices fails. Manually adding the rfxcom binding works. I will check open PRs. If nothing shows up I will make a PR for it tomorrow. thanks

Try a build from today. I do not know, which change had triggered 73, maybe it did not yet include the fix - now it definitely should!