- Platform information:
- Hardware: Intel 64bit
- OS: Debian in official openhab docker container: openhab/openhab
- Java Runtime Environment: 1.8.0.144 (??? not sure)
- openHAB version: 2.1
- Issue of the topic: I successfully tested the KM200 binding with the wetware/openhab docker image that uses openJDK Java 1.8.0.45. As this image is not current and not maintained and has customized path for the openhab directories I want to switch to the official openhab/openhab docker image. But when I start this image and mount my config files to it it receive an error in the log that indicates that I am missing the Java8 unlimited JCE Policy support as explained in this thread:
openHAB Community: KM200 Binding with Buderus Add-ons Bindings
2017-10-30 22:54:07.169 [INFO ] [.binding.km200.internal.KM200Binding] - Update KM200 Binding configuration, it takes a minute....
2017-10-30 22:54:07.178 [INFO ] [.binding.km200.internal.KM200Binding] - Starting communication test..
2017-10-30 22:54:07.446 [INFO ] [.binding.km200.internal.KM200Binding] - Received data..
2017-10-30 22:54:07.460 [ERROR] [hab.binding.km200.internal.KM200Comm] - Exception on encoding: {}
java.security.InvalidKeyException: Illegal key size or default parameters
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026)[:1.8.0_144]
at javax.crypto.Cipher.implInit(Cipher.java:801)[:1.8.0_144]
at javax.crypto.Cipher.chooseProvider(Cipher.java:864)[:1.8.0_144]
at javax.crypto.Cipher.init(Cipher.java:1249)[:1.8.0_144]
at javax.crypto.Cipher.init(Cipher.java:1186)[:1.8.0_144]
at org.openhab.binding.km200.internal.KM200Comm.decodeMessage(KM200Comm.java:260)[183:org.openhab.binding.km200:1.10.0]
at org.openhab.binding.km200.internal.KM200Binding.updated(KM200Binding.java:161)[183:org.openhab.binding.km200:1.10.0]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_144]
2017-10-30 22:54:07.466 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=292, bundle=183/mvn:org.openhab.binding/org.openhab.binding.km200/1.10.0]: Unexpected problem updating configuration org.openhab.km200
java.lang.RuntimeException: Decoding of the KM200 message is not possible!
at org.openhab.binding.km200.internal.KM200Binding.updated(KM200Binding.java:163)[183:org.openhab.binding.km200:1.10.0]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1461)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1417)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)[3:org.apache.felix.configadmin:1.8.12]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)[3:org.apache.felix.configadmin:1.8.12]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_144]
I did some research on the web and found that this error is most commonly related to the missing Java JCE extension. The solution is to download the package of the missing JCE jar files and copy them into the $JAVA_HOME/jre/lib/security
folder. The two files are called local_policy.jar
and US_export_policy.jar
. I checked the files are available in my docker image:
root@openhab-openhab220:/usr/lib/java-8/jre/lib/security# ls -l
total 236
-rw-rw-r-- 1 31450 31450 1273 Jul 26 14:24 blacklisted.certs
-rw-rw-r-- 1 31450 31450 186962 Jul 26 14:24 cacerts
-rw-rw-r-- 1 31450 31450 2466 Jul 26 14:24 java.policy
-rw-rw-r-- 1 31450 31450 34688 Jul 26 14:24 java.security
-rw-rw-r-- 1 31450 31450 1040 Jul 26 14:24 local_policy.jar
-rw-rw-r-- 1 31450 31450 620 Jul 26 14:24 US_export_policy.jar
root@openhab-openhab220:/usr/lib/java-8/jre/lib/security#
Hence I am now lost what the solution of this problem can be if it is not the missing JCE?
Any support is appreciated how to debug this as this is a little tricky to solve in a docker environment
Thank you!
Justus