Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Installing Boot Features / Caused by: org.osgi.framework.BundleException: Exception in org.openhab.io.jetty.certificate.internal.CertificateGenerator.start() of bundle org.openhab.io.jetty.certificate. #61

Closed
carpenike opened this issue Jan 12, 2016 · 6 comments

Comments

@carpenike
Copy link

Hey All,

Fresh install off of the openhab-distro cloudbees site this morning. Also wiped all the previous configs, etc (rm -rf /opt/openhab).

Running on CentOS 7.

[_openhab@ha ~]$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

[_openhab@ha ~]$ java -version
openjdk version "1.8.0_65"
OpenJDK Runtime Environment (build 1.8.0_65-b17)
OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)
09:18:24.447 [INFO ] [.openhab.core.internal.CoreActivator] - openHAB runtime has been started (v2.0.0, build 201601110205).
09:18:55.477 [ERROR] [ternal.service.BootFeaturesInstaller] - Error installing boot features
org.apache.karaf.features.internal.util.MultiException: Error restarting bundles
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:844)[9:org.apache.karaf.features.core:4.0.3]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1079)[9:org.apache.karaf.features.core:4.0.3]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:975)[9:org.apache.karaf.features.core:4.0.3]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_91]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_91]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_91]
        at java.lang.Thread.run(Thread.java:745)[:1.7.0_91]
Caused by: org.osgi.framework.BundleException: Exception in org.openhab.io.jetty.certificate.internal.CertificateGenerator.start() of bundle org.openhab.io.jetty.certificate.
        at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.container.Module.doStart(Module.java:571)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:412)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1189)[9:org.apache.karaf.features.core:4.0.3]
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:836)[9:org.apache.karaf.features.core:4.0.3]
        ... 6 more
Caused by: org.bouncycastle.operator.RuntimeOperatorException: exception obtaining signature: Could not sign data
        at org.bouncycastle.operator.jcajce.JcaContentSignerBuilder$1.getSignature(Unknown Source)
        at org.bouncycastle.cert.CertUtils.generateSig(Unknown Source)[133:org.openhab.io.jetty.certificate:2.0.0.201601110205]
        at org.bouncycastle.cert.CertUtils.generateFullCert(Unknown Source)[133:org.openhab.io.jetty.certificate:2.0.0.201601110205]
        at org.bouncycastle.cert.X509v3CertificateBuilder.build(Unknown Source)[133:org.openhab.io.jetty.certificate:2.0.0.201601110205]
        at org.openhab.io.jetty.certificate.internal.CertificateGenerator.generateCertificate(CertificateGenerator.java:185)[133:org.openhab.io.jetty.certificate:2.0.0.201601110205]
        at org.openhab.io.jetty.certificate.internal.CertificateGenerator.start(CertificateGenerator.java:84)[133:org.openhab.io.jetty.certificate:2.0.0.201601110205]
        at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_91]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
        ... 15 more
Caused by: java.security.SignatureException: Could not sign data
        at sun.security.ec.ECDSASignature.engineSign(ECDSASignature.java:297)[sunec.jar:1.7.0_91]
        at java.security.Signature$Delegate.engineSign(Signature.java:1205)[:1.7.0_91]
        at java.security.Signature.sign(Signature.java:578)[:1.7.0_91]
        at org.bouncycastle.operator.jcajce.JcaContentSignerBuilder$SignatureOutputStream.getSignature(Unknown Source)[133:org.openhab.io.jetty.certificate:2.0.0.201601110205]
        ... 25 more
Caused by: java.security.KeyException
        at sun.security.ec.ECDSASignature.signDigest(Native Method)[sunec.jar:1.7.0_91]
        at sun.security.ec.ECDSASignature.engineSign(ECDSASignature.java:293)[sunec.jar:1.7.0_91]
        ... 28 more
@dvanherbergen
Copy link
Contributor

When openHAB starts, it tries to generate a new certificate to be used for https. This generation is done through the bouncycastle library. I'm not sure why it is failing, maybe this is because you are using the openJDK in stead of Oracle JDK.

As a workaround, you can manually add a certificate to the keystore (userdata/etc/keystore) or replace the keystore with the one from here:
https://github.com/openhab/openhab-distro/tree/master/launch/home/etc. That one already contains a certificate.

@kaikreuzer
Copy link
Member

Is the root cause not available in the log? That's a pity.
Besides OpenJDK, the reason could be some other pre-requisite. Maybe it requires libbcprov-java like in http://stackoverflow.com/a/4743435?

@carpenike
Copy link
Author

Thanks. I'll install Oracle's JDK and retry.

1.8 should work fine though, right?

@kaikreuzer
Copy link
Member

1.8 should work fine though, right?

Yes!

@carpenike
Copy link
Author

Oracle's JDK works much better! Only error on first start that I get is now:

13:08:19.149 [ERROR] [.wemo.discovery.WemoDiscoveryService] - Could not send Wemo device discovery
java.net.BindException: Cannot assign requested address
        at java.net.PlainDatagramSocketImpl.bind0(Native Method)[:1.8.0_65]
        at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:94)[:1.8.0_65]
        at java.net.DatagramSocket.bind(DatagramSocket.java:392)[:1.8.0_65]
        at org.eclipse.smarthome.binding.wemo.discovery.WemoDiscoveryService.sendWemoDiscoveryMessage(WemoDiscoveryService.java:152)[145:org.eclipse.smarthome.binding.wemo:0.8.0.201601082233]
        at org.eclipse.smarthome.binding.wemo.discovery.WemoDiscoveryService.discoverWemo(WemoDiscoveryService.java:120)[145:org.eclipse.smarthome.binding.wemo:0.8.0.201601082233]
        at org.eclipse.smarthome.binding.wemo.discovery.WemoDiscoveryService.access$0(WemoDiscoveryService.java:118)[145:org.eclipse.smarthome.binding.wemo:0.8.0.201601082233]
        at org.eclipse.smarthome.binding.wemo.discovery.WemoDiscoveryService$1.run(WemoDiscoveryService.java:79)[145:org.eclipse.smarthome.binding.wemo:0.8.0.201601082233]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_65]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_65]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]

@kaikreuzer
Copy link
Member

Could you please report this at https://github.com/eclipse/smarthome/issues? (this is where the WeMo binding is maintained)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants