openhab / openhab-syno-spk

openHAB Synology SPK Install Package
Eclipse Public License 2.0
161 stars 42 forks source link

Startup error on DS214+ (Karaf) #52

Closed fivetide closed 7 years ago

fivetide commented 7 years ago

I am trying to run OpenHAB2 from the Syno-package (2.1.0.001-SNAPSHOT-DSM6 currently, but the same issue for other 2.* packages exists) on my DS214. I followed the guide on (http://docs.openhab.org/installation/synology.html), then set the whole userdata folder read and writeable.

2017-01-29 12:03:42.787 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.ArrayIndexOutOfBoundsException: 0
    at sun.nio.cs.UTF_8$Decoder.decode(UTF_8.java:441)
    at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:153)
    at java.lang.StringCoding.decode(StringCoding.java:193)
    at java.lang.String.<init>(String.java:426)
    at java.lang.String.<init>(String.java:491)
    at sun.security.x509.AVA.toRFC2253CanonicalString(AVA.java:909)
    at sun.security.x509.RDN.toRFC2253StringInternal(RDN.java:443)
    at sun.security.x509.RDN.toRFC2253String(RDN.java:423)
    at sun.security.x509.X500Name.getRFC2253CanonicalName(X500Name.java:729)
    at sun.security.x509.X500Name.equals(X500Name.java:415)
    at sun.security.pkcs.SignerInfo.getCertificateChain(SignerInfo.java:274)
    at sun.security.pkcs.SignerInfo.getTimestamp(SignerInfo.java:557)
    at sun.security.util.SignatureFileVerifier.getSigners(SignatureFileVerifier.java:559)
    at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:300)
    at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:268)
    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 sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:162)
    at java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:238)
    at org.apache.karaf.main.Main.loadFrameworkFactory(Main.java:425)
    at org.apache.karaf.main.Main.launch(Main.java:252)
    at org.apache.karaf.main.Main.main(Main.java:177)
cat /proc/cpuinfo 
Processor   : Marvell PJ4Bv7 Processor rev 2 (v7l)

java -version
java version "1.8.0_121"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_121-b13, headless)
Java HotSpot(TM) Embedded Client VM (build 25.121-b13, mixed mode)
auconsil commented 7 years ago

I have exactly the same problem on a DS 414. Same Java version, I tried to install 2.1.0.001-SNAPSHOT-DSM6 and 2.0.0.001-SNAPSHOT-DSM6. When trying to start manually (./start.sh) I get:

Launching the openHAB runtime...
Unable to update instance pid: /volume1/@appstore/openHAB2/runtime/instances/instance.properties (Permission denied)
/volume1/@appstore/openHAB2/userdata/logs/openhab.log (Permission denied)
Unable to update instance pid: /volume1/@appstore/openHAB2/runtime/instances/instance.properties (Permission denied)

When I try sudo ./start.sh I get

Launching the openHAB runtime...
0

Nevertheless the OH2 does not start (same error as mentioned by @fivetide). Ports 5555, 8080, 8443 are not in use.

cniweb commented 7 years ago

I see Permission denied... OK, I'm building a new package

fivetide commented 7 years ago

Since this does not seem to be exclusive to the synology-package, or even openHAB, i posted an issue to apache's issues tracker (KARAF-4977). Should i maybe post this to the openHAB main project too?

dfrap commented 7 years ago

I now have openHAB-2.0.0.001-DSM6-syno-noarch-0.001 running on my DS414 which has the same armadaxp chip set as the DS214 used by fivetide. I too got the karaf error until I switched Java to a hard float version. As of DSM6, Synology switched the required Java version from soft float for armadaxp & armada370. Once I changed to hard float, the karaf errors ceased.

N.B. No other version of openHAB for Synology would work for me. Your results may vary.

agsochi commented 7 years ago

@dfrap can you please point me how to switch Java to hard float version?

dfrap commented 7 years ago

See my description at: https://community.openhab.org/t/synology-diskstation/1446/211?u=dfrap

cniweb commented 7 years ago

Update to jdk-8u121-linux-arm32: https://pcloadletter.co.uk/2011/08/23/java-package-for-synology/

dfrap commented 7 years ago

Unfortunately I find the pcloadletter application will only load the soft float version ejdk-8u121-linux-arm-sflt.tar.gz on Synology that required hard float to work. I have given the author feedback and hope he will be able to confirm my report and update his application. Until it is updated, my previous link provides 2 different ways to install hard float on armadaxp and armada370 that require hard float.

cniweb commented 7 years ago

Is it still relevant? The issue will be closed?

dfrap commented 7 years ago

This issue is still relevant. Those with Synology Armada chip sets at DSM 6 will install a version of Java that will not work if they follow the install directions. So if it is proper for a github issue to reference misleading install documentation rather than errors in the code, the issue is not fixed.

cniweb commented 7 years ago

OK. How should we solve the problem in your opinion?

dfrap commented 7 years ago

My opinion is that the install directions should be updated. Here is my proposed text:

The easiest way to install Java is to install the Synology Java8 package from Package Center. After installation, OpenJDK will be used by default and must be upgraded. To upload Oracle JDK to Java8, click the Install Java / Upgrade Java button and then follow the onscreen instructions. The filename and format of the uploaded file will be checked before installation.

Armada 370/XP systems running DSM 6 require hard float ABI rather than the soft float used on DSM 5. If there is not a Java8 package in the Package Center, your machine may not be supported by the Synology package. https://www.synology.com/en-us/dsm/packages/Java8

The best option for older unsupported Synology models such as PowerPC and ARMv5 is to include the PC-Loadletter Repo. Download Java8 SE (Java Cryptography Extension if required) and put them in the public folder of your NAS. Then start the installation of Java8 SE. Note that it may be necessary to rename the downloaded file to match the name the Loadletter utility expects which may be an older version than what is currently available.

[optional] The Java8 PowerPC versions are available from http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/javaseembedded8u6-2406243.html

cniweb commented 7 years ago

@dfrap A new PR that contains your suggestion I have created!

SchoppAx commented 7 years ago

I'm using openHAB2 with my DS214+ (Armada XP) by only installing the syno JAVA8 package 8.0.121-003.

cniweb commented 7 years ago

@dfrap The openHAB Doc is now up to date :+1: : http://docs.openhab.org/installation/synology.html Can we now close this issue?

dfrap commented 7 years ago

Very well edited and helpful addition. But there are now 2 paragraphs that claim to be the easiest! Please remove the redundant paragraph about PC-Loadletter that is above the added text: "The easiest way to install Java is to include the PC-Loadletter Repo. Download Java8 SE (latest ARMv6) (Java Cryptography Extension if required) and put them in the public folder of your NAS. Then start the installation of Java8 SE."

dfrap commented 7 years ago

I don't understand what ARJava SEM means. I also suggest changing ARJava SEM to ARMv5.

PC-Loadletter Repo should be a hyperlink to http://packages.pcloadletter.co.uk/ as it is in the original paragraph.