openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

Openhab with OpenJ9 Java from AdoptOpenJDK?

Open fragger42 opened this issue 3 years ago • 3 comments

Is there any possibility to use Openhab3 with the OpenJ9 instead of Hotspot Java? OpenJ9 has some quite nice features and can startup a lot faster and use less RAM from my tests on an x64 plattform for other java applications. For aarch64, there is also an eary access version available on AdoptOpenJDK so it will also come to Raspberry world (at least the newer with 64bit support) soon.

The startup of Openhab 3 is no problem, everything in the log looks fine and also all bindings seem to work and in the event log I can see the values of my defined items changing. The only problem starts when you want to access the webinterface of Openhab. You only get a blank screen and the following messages in openhab.log:

2021-01-21 19:08:44.765 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://192.168.178.2:8080/rest/ui/tiles's Observer 
2021-01-21 19:08:44.862 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://192.168.178.2:8080/rest/events/states's Observer

Is it maybe only a problem with the special startup parameters of Openhab like "--add-exports=java.base/sun.net.www.protocol.http" which seem pretty Sun specific?

fragger42 avatar Jan 21 '21 18:01 fragger42

This is a wrong channel to address. You are free to (and responsible to) install whatever Java yourself.

Note OH3 requires Java 11. On Raspberries, use openHABian. It has menu options to install either Zulu 11 (default) or AdoptOpenJDK 11, 32 or 64 bit (note 64 bit may work but is neither supported nor recommended).

Please close this issue and turn to the forum if you still think you need to, thanks.

mstormi avatar Jan 22 '21 14:01 mstormi

@mstormi Why do you think so? I think it is a valid request and I'd like to see OpenJ9 support as well. @fragger42 figured out a bug that happens when OpenJ9 is used which might be fixed by a code change in openhab-core (or maybe openhab-distro), so I think it is fair to open the issue here.

kaikreuzer avatar Jan 22 '21 16:01 kaikreuzer

The only problem starts when you want to access the webinterface of Openhab.

Is this still an issue for you?

It shows the UI for me when using OH 3.1 with:

  • jdk-11.0.12+7_openj9-0.27.0 (Semeru Runtimes)
  • jdk-11.0.10+9_openj9-0.24.0 (AdoptOpenJDK)

wborn avatar Oct 13 '21 15:10 wborn