HiveMQ

HiveMQ as Windows Service

Hi there,

HiveMQ runs perfectly on windows when started by a user, but I can’t get it to run as a service.

Some details on the environment: I’m using Windows 10 Pro (version 1803) and the openjdk version 12.0.1. If any other details are relevant, please let me know.

I’ve unzipped hivemq-ce-2019.1 onto a folder, and within that folder the windows-service (as stated in the official docs), then when I run as admin installService.bat, I get the following output:

  HiveMQ Windows Service Install

"java" -Xmx30m -Djna_tmpdir="C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\/../tmp" -Djava.net.preferIPv4Stack=true -jar "C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\/../wrapper.jar" -i "C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\/../conf/wrapper.conf"
YAJSW: yajsw-stable-12.12
OS   : Windows 10/10.0/amd64
JVM  : Oracle Corporation/12.0.1/c:\dev\tools\jdk-12.0.1/64
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/dev/tests/hivemq-ce-2019.1/windows-service/./lib/extended/groovy/groovy-all-2.4.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Nov. 13, 2019 1:56:13 NACHM. org.apache.commons.vfs2.VfsLog info
INFO: Using "C:\Users\bgu\AppData\Local\Temp\vfs_cache" as temporary files store.
************* INSTALLING HiveMQ ***********************

service cmd: java.exe -classpath C:\dev\tests\hivemq-ce-2019.1\windows-service\wrapper.jar -Xrs -Dwrapper.service=true -Dwrapper.working.dir=C:\dev\tests\hivemq-ce-2019.1\bin -Djna_tmpdir=C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\/../tmp -Dwrapper_home=C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\/.. -Dwrapper.config=C:\dev\tests\hivemq-ce-2019.1\windows-service\conf\wrapper.conf -Dwrapper.additional.1x=-Xrs -Djna_tmpdir=C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\..\tmp org.rzo.yajsw.boot.WrapperServiceBooter
Service HiveMQ installed

Then, after rebooting, I expect the HiveMQ service to be up and running, but it’s not When I run the command by hand on the console (as admin again), I get this message:

# java.exe -classpath C:\dev\tests\hivemq-ce-2019.1\windows-service\wrapper.jar -Xrs -Dwrapper.service=true -Dwrapper.working.dir=C:\dev\tests\hivemq-ce-2019.1\bin -Djna_tmpdir=C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\/../tmp -Dwrapper_home=C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\/.. -Dwrapper.config=C:\dev\tests\hivemq-ce-2019.1\windows-service\conf\wrapper.conf -Dwrapper.additional.1x=-Xrs -Djna_tmpdir=C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\..\tmp org.rzo.yajsw.boot.WrapperServiceBooter
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/dev/tests/hivemq-ce-2019.1/windows-service/./lib/extended/groovy/groovy-all-2.4.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Nov. 13, 2019 2:29:57 NACHM. org.apache.commons.vfs2.VfsLog info
INFO: Using "C:\Users\bgu\AppData\Local\Temp\vfs_cache" as temporary files store.
java.io.FileNotFoundException: C:\dev\tests\hivemq-ce-2019.1\windows-service\bat\..\log\wrapper.log.lck (Zugriff verweigert)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:292)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:124)
        at org.rzo.yajsw.log.MyFileHandler.initOutputFiles(MyFileHandler.java:267)
        at org.rzo.yajsw.log.MyFileHandler.init(MyFileHandler.java:190)
        at org.rzo.yajsw.log.MyFileHandler.<init>(MyFileHandler.java:789)
        at org.rzo.yajsw.log.MyFileHandler.<init>(MyFileHandler.java:806)
        at org.rzo.yajsw.wrapper.AbstractWrappedProcess.getFileHandler(AbstractWrappedProcess.java:1628)
        at org.rzo.yajsw.wrapper.AbstractWrappedProcess.getWrapperLogger(AbstractWrappedProcess.java:2794)
        at org.rzo.yajsw.wrapper.AbstractWrappedProcess.getInternalWrapperLogger(AbstractWrappedProcess.java:2804)
        at org.rzo.yajsw.wrapper.AbstractWrappedProcess.init(AbstractWrappedProcess.java:279)
        at org.rzo.yajsw.wrapper.WrappedJavaProcess.init(WrappedJavaProcess.java:77)
        at org.rzo.yajsw.app.WrapperMainServiceWin.main(WrapperMainServiceWin.java:148)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.rzo.yajsw.boot.WrapperServiceBooter.main(WrapperServiceBooter.java:46)
WARNING|wrapper|Service HiveMQ|19-11-13 14:29:57|YAJSW: yajsw-stable-12.12
WARNING|wrapper|Service HiveMQ|19-11-13 14:29:57|OS   : Windows 10/10.0/amd64
WARNING|wrapper|Service HiveMQ|19-11-13 14:29:57|JVM  : Oracle Corporation/12.0.1/c:\dev\tools\jdk-12.0.1/64
INFO|wrapper|Service HiveMQ|19-11-13 14:29:58|start delay: 0 

“Zugriff verweigert” means access denied, but I guess you won’t have a problem with that :slight_smile:. Apparently the Java process cannot access the file “…\log\wrapper.log.lck”, which may be caused by the fact that it’s actually a folder. If I rename that folder and create an empty file with the name “wrapper.log.lck”, I get the following behaviour:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/dev/tests/hivemq-ce-2019.1/windows-service/./lib/extended/groovy/groovy-all-2.4.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Nov. 13, 2019 2:33:46 NACHM. org.apache.commons.vfs2.VfsLog info
INFO: Using "C:\Users\bgu\AppData\Local\Temp\vfs_cache" as temporary files store.
WARNING|wrapper|Service HiveMQ|19-11-13 14:33:46|YAJSW: yajsw-stable-12.12
WARNING|wrapper|Service HiveMQ|19-11-13 14:33:46|OS   : Windows 10/10.0/amd64
WARNING|wrapper|Service HiveMQ|19-11-13 14:33:46|JVM  : Oracle Corporation/12.0.1/c:\dev\tools\jdk-12.0.1/64
INFO|wrapper|Service HiveMQ|19-11-13 14:33:46|start delay: 0

Which looks better, but still, nothing is running. And this is where I’m stuck. Any ideas? thank you very much.

Hi bgu,

I could reproduce your described behaviour. I created a GitHub issue and an internal ticket. I will update the thread if the cause has been solved.

Thanks for letting us know.

Kind regards,
Michael

1 Like

Thanks a lot. I subscribed the issue on Github as well.