[SOLVED] Server crashed after starting (on Synology DSM 6.0)

When I run server it crushed with exception:

Exception in thread "main" java.lang.ExceptionInInitializerError at javax.crypto.JceSecurityManager.<clinit>(JceSecurityManager.java:65) at javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587) at javax.crypto.Cipher.getMaxAllowedKeyLength(Cipher.java:2611) at sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:548) at sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:527) at sun.security.ssl.CipherSuite.isAvailable(CipherSuite.java:194) at sun.security.ssl.SSLContextImpl.getApplicableCipherSuiteList(SSLContextImpl.java:346) at sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.java:297) at sun.security.ssl.SSLEngineImpl.init(SSLEngineImpl.java:402) at sun.security.ssl.SSLEngineImpl.<init>(SSLEngineImpl.java:349) at sun.security.ssl.SSLContextImpl.engineCreateSSLEngine(SSLContextImpl.java:201) at javax.net.ssl.SSLContext.createSSLEngine(SSLContext.java:329) at io.netty.handler.ssl.JdkSslContext.<clinit>(JdkSslContext.java:73) at io.netty.handler.ssl.SslContext.newServerContextInternal(SslContext.java:405) at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:391) at cc.blynk.utils.SslUtil.build(SslUtil.java:79) at cc.blynk.utils.SslUtil.initSslContext(SslUtil.java:65) at cc.blynk.server.hardware.ssl.HardwareSSLServer.<init>(HardwareSSLServer.java:35) at cc.blynk.server.launcher.ServerLauncher.start(ServerLauncher.java:66) at cc.blynk.server.launcher.ServerLauncher.main(ServerLauncher.java:58) Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism at javax.crypto.JceSecurity.<clinit>(JceSecurity.java:89) ... 20 more Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284) at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238) at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316) at java.util.jar.JarVerifier.update(JarVerifier.java:228) at java.util.jar.JarFile.initializeVerifier(JarFile.java:383) at java.util.jar.JarFile.getInputStream(JarFile.java:450) at javax.crypto.JceSecurity.loadPolicies(JceSecurity.java:301) at javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:263) at javax.crypto.JceSecurity.access$000(JceSecurity.java:48) at javax.crypto.JceSecurity$1.run(JceSecurity.java:81) at java.security.AccessController.doPrivileged(Native Method) at javax.crypto.JceSecurity.<clinit>(JceSecurity.java:78) ... 20 more

I have no java experience, maybe someone can help?

server-0.16.4.jar
java -version
java version “1.8.0_101”
Java™ SE Embedded Runtime Environment (build 1.8.0_101-b13, headless)
Java HotSpot™ Embedded Client VM (build 25.101-b13, mixed mode)

Hello. Did you build jar file by yourself?

No, I didn’t. Download from git https://github.com/blynkkk/blynk-server/releases/download/v0.16.4/server-0.16.4.jar

I have the same error on server-0.15.2 and server-0.16.1. I am using synology (DSM 6.0.1-7393), before update (NAS firmware) I ran the server without problem.

Updated java to latest version:
java -version
java version “1.8.0_101”
Java™ SE Embedded Runtime Environment (build 1.8.0_101-b13, headless)
Java HotSpot™ Embedded Client VM (build 25.101-b13, mixed mode)
but it didn’t help…

On my mac everything works fine.

Could you please try this build and tell me if it works for you? https://github.com/blynkkk/blynk-server/releases/download/v0.16.4/server-0.17.0-SNAPSHOT.jar

$ java -jar server-0.17.0-SNAPSHOT.jar &
[1] 4721
adm@nas:~$
adm@nas:~$ Exception in thread “main” java.lang.ExceptionInInitializerError
at javax.crypto.JceSecurityManager.(JceSecurityManager.java:65)
at javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587)
at javax.crypto.Cipher.getMaxAllowedKeyLength(Cipher.java:2611)
at sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:548)
at sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:527)
at sun.security.ssl.CipherSuite.isAvailable(CipherSuite.java:194)
at sun.security.ssl.SSLContextImpl.getApplicableCipherSuiteList(SSLContextImpl.java:346)
at sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.java:297)
at sun.security.ssl.SSLEngineImpl.init(SSLEngineImpl.java:402)
at sun.security.ssl.SSLEngineImpl.(SSLEngineImpl.java:349)
at sun.security.ssl.SSLContextImpl.engineCreateSSLEngine(SSLContextImpl.java:201)
at javax.net.ssl.SSLContext.createSSLEngine(SSLContext.java:329)
at io.netty.handler.ssl.JdkSslContext.(JdkSslContext.java:73)
at io.netty.handler.ssl.SslContext.newServerContextInternal(SslContext.java:405)
at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:391)
at cc.blynk.utils.SslUtil.build(SslUtil.java:79)
at cc.blynk.utils.SslUtil.initSslContext(SslUtil.java:65)
at cc.blynk.server.hardware.ssl.HardwareSSLServer.(HardwareSSLServer.java:35)
at cc.blynk.server.launcher.ServerLauncher.start(ServerLauncher.java:66)
at cc.blynk.server.launcher.ServerLauncher.main(ServerLauncher.java:58)
Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism
at javax.crypto.JceSecurity.(JceSecurity.java:89)
… 20 more
Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316)
at java.util.jar.JarVerifier.update(JarVerifier.java:228)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
at java.util.jar.JarFile.getInputStream(JarFile.java:450)
at javax.crypto.JceSecurity.loadPolicies(JceSecurity.java:301)
at javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:263)
at javax.crypto.JceSecurity.access$000(JceSecurity.java:48)
at javax.crypto.JceSecurity$1.run(JceSecurity.java:81)
at java.security.AccessController.doPrivileged(Native Method)
at javax.crypto.JceSecurity.(JceSecurity.java:78)
… 20 more

[1]+ Done(1) java -jar server-0.17.0-SNAPSHOT.jar

I spend some time in order to find solution, but to be honest I have no idea why it is not working in your envirnoment. We have > 1000 installations of Blynk server and you are the only person with this issue. My recommendation for now would be to use another system/pc or you may try to resolve issue by yourself. Code is open-source. Sorry for inconveniences.

OK, thank you I will try to fix it.

1 Like

SOLVED!

Install OpenJDK instead of Oracle Java™ and everything works fine. Strange situation because I’m running server on Ubuntu and all is OK on Oracle Java…

OpenJDK
java -version
openjdk version “1.8.0_60”
OpenJDK Runtime Environment (IcedTea 3.0.0pre06) (linux-gnu build 1.8.0_60-b24)
OpenJDK Zero VM (build 25.60-b23, interpreted mode)

2 Likes

Heh. Glad you did it. Yeap, really strange, especially build is same for many users.