- Platform information:
- Hardware: VMware ESXi VM on Dell Poweredge
- OS:Ubuntu 16.11LTS
- Java Runtime Environment: Java™ SE Runtime Environment (build 1.8.0_77-b03)
- openHAB version: 2.3 (upgraded from 2.0 using upgrade script. 2.0 was a complete standalone and not a repository type installation)
Hi…
I seem to have the exact problem as here:
https://community.openhab.org/t/solved-openhab-2-3-and-systemd-error-executing-command-java-lang-nullpointerexception/45585/5
2.0 worked pretty flawlessly. Upgraded to 2.3 with the upgrade script, and when starting OpenHAB manually with start.sh, all is well! It ran for 3 days not a problem. I try to use the same openhab.service file that I used with 2.0, and the exact problem as in the link above happens.
->sudo systemctl start openhab
->sudo systemctl status openhab - all seems ok for a minute, light is green, logs start to generate, and startup rules complete. Then it looks like someone hit CONTROL+D in the console as it starts shutting down with no indication as to why in the logs.
->sudo systemctl status openhab - now shows white lite with:
Active: inactive (dead) since …
Last line is a clue:
Jun 22 18:25:41 serverL1 start.sh[23547]: openhab> Error executing command: java.lang.NullPointerException
At one point I was seeing:
Jun 22 18:01:33 serverL1 systemd[1]: [/lib/systemd/system/openhab.service:13] Executable path is not absolute, ignoring: kill
But this seemed to go away.
I have a service file that calls start.sh directly, and its worked since 1.7.
[Unit]
Description=Starts and stops the openHAB Home Automation Bus
Documentation=http://www.openhab.org
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
Environment=OPENHAB_STARTMODE=daemon
GuessMainPID=yes
User=jim
ExecStart=/opt/OpenHAB2/start.sh
ExecStop=kill -SIGINT $MAINPID
Restart=on-failure
WorkingDirectory=/opt/OpenHAB2
[Install]
WantedBy=multi-user.target
As you can see it runs as user jim, and I did RWE recursive permissions on the whole OH directory, so I don’t see how it could be a user/permission issue since that has all been the same since way back in 1.7.
I’ve been through these threads:
https://github.com/openhab/openhab-linuxpkg/issues/70
and commented out:
karaf.shell.init.script = ${karaf.etc}/shell.init.script
from this thread:
https://community.openhab.org/t/initialization-problem-with-openhab-2-2-build-1017-on-windows-10/33407/21
And nothing seemed to have an effect on it.
It boggles the mind how it can run perfect from start.sh as user jim, and not the service file which calls the same thing! The extra line you see in my service file setting the environment was not there before, I added that because someone said it fixed theirs, and left it so you can see it didnt work for me.
Any ideas or a hint where else I can check to get more info on the problem?
Best regards,
Jim