Apache Commons Daemon service breaks JRE (and other strange things)

495 Views Asked by At

We have developed a jar that gets wrapped as a Windows service using Procrun, the Apache Commons Daemon component for windows services. Everything works well on my own computer and on a few other development machines, but when we installed it in a production environment (Windows Server 2008) we begun getting weird behaviours.

First, after starting and stopping the service, for some reason, Java stops working. Typing a classical "java -version" on any command prompt yields absolutely no output. Attempting to launch any Java applications has absolutely no effect. The only solution is to reinstall the JRE all over again. If you stop and start the service after reinstalling the JRE it gets broken all over again.

Another weird thing that's been happening. Sometimes, when using prunmgr to manage our service (after renaming it to our service's name, say "MYSERVICE"), it gives us a message saying that the service "gMYSERVICE" isn't installed. It seems to think, in some cases, that our service has a 'g' appended to it. Sometimes two extra hidden files, possibly copies of prunsrv and prunmgr exist, with a 'g' appended to them, as in gprunsrv.exe and gMYSERVICE.exe. Those files can't be seen using the system explorer, even with hidden files mode on, but can be detected by teamviewer.

0

There are 0 best solutions below