OH3 : execute commandLine not working when OH started with wrapper as a service/ OK when started with console

Good evening all,
I hope you can support me in a little OH3 running issue, that only exists with starting OH3 as service using the wrapper. I hope the post is at the right place.

  • Platform information:

    • Hardware: HP Desktop
    • OS: Win 10 64bits
    • Java Runtime Environment: JDK 11.0.9
    • openHAB version: 3.0.0 stable release
  • Issue of the topic:

    • If I start OH3 from the “Start.bat” with karaf console, I do NOT have any issue (with Jdk 11), all working fine.
    • If I run OH3 now as a service using the wrapper, I do have the following illegal error at the start in the wrapper.log, and all rules using executeCommandLine fail (but all rest seems OK, not fully checked yet)

Wrapper.log
INFO | jvm 1 | 2021/01/08 17:30:28 | WARNING: An illegal reflective access operation has occurred

INFO | jvm 1 | 2021/01/08 17:30:28 | WARNING: Illegal reflective access by org.eclipse.osgi.storage.FrameworkExtensionInstaller (file:/C:/OpenHAB3/runtime/system/org/eclipse/platform/org.eclipse.osgi/3.12.100/org.eclipse.osgi-3.12.100.jar) to method java.net.URLClassLoader.addURL(java.net.URL)

INFO | jvm 1 | 2021/01/08 17:30:28 | WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.storage.FrameworkExtensionInstaller

INFO | jvm 1 | 2021/01/08 17:30:28 | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

INFO | jvm 1 | 2021/01/08 17:30:28 | WARNING: All illegal access operations will be denied in a future release

Openhab.log (rule):
2021-01-08 17:37:40.912 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Failed to execute commandLine '[C:/Users/SEBASTIEN/AppData/Local/Microsoft/WindowsApps/python.exe, c:/OpenHAB3/conf/scripts/shaddow.py, update]

2021-01-08 17:37:40.913 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Failed to execute commandLine '[C:/Users/SEBASTIEN/AppData/Local/Microsoft/WindowsApps/python.exe, c:/openhab3/conf/scripts/shaddow_png.py, update]'

So it seems something in the openHAB-wrapper.conf file it does not like.
Shall I create an issue in the GitHUB?
Or os this something more related to configuration?
Thanks for your advise

Hi all,
Seems that not so many are facing a similar issue.
Any suggestion on where to look at or what I could investigate?
Very surprising that it works with karaf.bat and not when using a service with wrapper, while using the same Java JDK.
Thanks

Hi all
Not so much success for this thread, I know there are a lot to do :frowning:.
I investigated a bit more, the “Illegal reflective access” in wrapper.log is not linked to this failure of execute command line. Still not sort it out.
So issue is clearly when launching OH3 with wrapper as service.
Could it be a JAVA version issue?
I don’t use the zulu one, but official from oracle.
Any advise from any of the Windows 10 Openhab 3 user?

I don’t know about the impact on command line executions, but as a new user I’ve had similar messages on the wrapper log. Thinking it’s me doing something daft I’ve done a complete re-install of Windows 10, fully updated to 20H2 19042.985. No other software added. I’ve followed (I hope) set-up to the letter:
Installed Java 11LTS from Azul (default location)
Added JAVA_HOME environment variable
Installed 3.0.2 directly from openhab (unzipped to C:/openHAB)
Standard start to open karaf console
Run feature and wrapper installs
Close openHAB, copy modified content into .conf file
Install service from .bat file in elevated cmd mode
No bindings added, nothing set up in openHAB at all

When running under the service, I get error messages in the wrapper.txt log file. If I stop the service and run openHAB from the start.bat file the karaf console shows no error messages, and the openhab.txt log file only carries a single WARN note of
[WARN ] [.transport.servlet.ServletController] - Can’t find the request for http://auto:8080/rest/events/states’s Observer

Content from wrapper log file:

STATUS | wrapper  | 2021/05/14 18:32:27 | --> Wrapper Started as Service
STATUS | wrapper  | 2021/05/14 18:32:27 | Launching a JVM...
INFO   | jvm 1    | 2021/05/14 18:32:28 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO   | jvm 1    | 2021/05/14 18:32:28 |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
INFO   | jvm 1    | 2021/05/14 18:32:28 | 
INFO   | jvm 1    | 2021/05/14 18:32:29 | WARNING: An illegal reflective access operation has occurred
INFO   | jvm 1    | 2021/05/14 18:32:29 | WARNING: Illegal reflective access by org.eclipse.osgi.storage.FrameworkExtensionInstaller (file:/C:/openHAB/runtime/system/org/eclipse/platform/org.eclipse.osgi/3.12.100/org.eclipse.osgi-3.12.100.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
INFO   | jvm 1    | 2021/05/14 18:32:29 | WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.storage.FrameworkExtensionInstaller
INFO   | jvm 1    | 2021/05/14 18:32:29 | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
INFO   | jvm 1    | 2021/05/14 18:32:29 | WARNING: All illegal access operations will be denied in a future release
INFO   | jvm 1    | 2021/05/14 18:32:43 | Warning: Nashorn engine is planned to be removed from a future JDK release
INFO   | jvm 1    | 2021/05/14 18:32:43 | Warning: Nashorn engine is planned to be removed from a future JDK release
INFO   | jvm 1    | 2021/05/14 19:42:02 | Warning: Nashorn engine is planned to be removed from a future JDK release
INFO   | jvm 1    | 2021/05/14 19:42:02 | Warning: Nashorn engine is planned to be removed from a future JDK release
STATUS | wrapper  | 2021/05/14 19:42:04 | <-- Wrapper Stopped

Al

Just looking at a few keywords in various places, but I wonder if the text shown for the wrapper installation on the Wiki is up to date? OH3 requires the installation of JAVA11, but the Java application section of the openHAB-wrapper.conf file has

wrapper.java.classpath.3=%KARAF_HOME%\lib\jdk9plus\*.jar

Should this reflect instead a later version of Java? Looking at a the Eclipse forums for a similar error message, the message seemed to relate to using a Java engine that was too new for the application. Is Karaf being set up in the wrapper to use JAVA9 (suitable for OH2?) while OH3 needs it to be set to JAVA11?

I’m purely guessing here, have never played with setting up services or JAVA, so would have no idea how to fix this even if its anywhere near the mark

For me, that’s only the folder name in which .jar are really stored when installing OH3 on W10 machine. So this should be OK.
By the way, in Openhab-service.bat, you can see that the correct java path is used.

C:\Program Files\Java\jdk-11.0.9

I really believe that when OH3 runs as service (using Openhab-service.bat), the way JAVA is started is not the same then when starting with start.bat file.

But had no time to investigate the differences, it works, so I accept the warning for the time being.
What is sure is that there are much more in karaf.bat / setenv.bat versus what we have in openHAB-wrapper.conf