Zigbee gateway stuck in initializing

  • Platform information:
    • Hardware: i5/12GB/HDD
    • OS: Windows 10 64bit
    • Java Runtime Environment: 17.0.9 (Zulu17.46+19-CA)
    • openHAB version: 4.0.3
  • Issue of the topic: my USB Zigbee gateway (Ember Coordinator) work fine (thing online, ZigBee devices communicating) when run OpenHab from command line (start.bat). When run OpenHab as service (NSSM) USB ZigBee gateway it gets stuck in initializing state.

Did you resolve this? I am also having the same problem after I migrated to Win 11.

I fixed this by removing windows service and updating the openHab-wrapper.conf
by adding the below line

set.default.PATH=%PATH_WITH_JAVA% 

After that I then appended all of these entry’s on a new line as shown below. Note: All of them may not be needed “likely just the java.utils= unnamed” one to fix the error in the log that zigbee binding is failing with at startup when running as a service. However I added them all since I did not see any harm in it as they are all in the karaf.bat used when manual launch anyway.

set.default.JDK_JAVA_OPTIONS=--add-reads=java.xml=java.logging --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED --patch-module java.base=%KARAF_HOME%/lib/endorsed/org.apache.karaf.specs.locator-%KARAF_VERSION%.jar --patch-module java.xml=%KARAF_HOME%/lib/endorsed/org.apache.karaf.specs.java.xml-%KARAF_VERSION%.jar --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=java.base/sun.net.www.content.text=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED

then I reinstalled the service and zigbee worked fine
This is same issue that was discussed on this post.

This fixed both windows 10 OS running Openhab as a service and also windows 11 OS running Openhab as a servce.