Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache commons daemon "Failed creating Java" error

I'm trying to start a Windows service using the Apache commons daemon. It works on Windows XP, but I'm trying to run it on Windows 7 x64. It fails to start and I get the following error in the logs:

[2010-12-13 17:21:19] [info] Commons Daemon procrun (1.0.3.0) started [2010-12-13 17:21:19] [info] Running 'NodeService' Service... [2010-12-13 17:21:19] [info] Starting service... [2010-12-13 17:21:19] [error] Failed creating java [2010-12-13 17:21:19] [error] ServiceStart returned 1 [2010-12-13 17:21:19] [info] Run service finished. [2010-12-13 17:21:19] [info] Commons Daemon procrun finished

I set the JAVA_HOME and added the java bin to PATH, just to be sure. I'm not sure why it's not starting, or if it has to do with the x64 operating system. It was designed for a 32-bit system originally.

like image 828
anom217 Avatar asked Dec 13 '10 22:12

anom217


2 Answers

Just come across the same issue. You can resolve this by changing the JVM path to point to the x64 version as it uses the x32 by default

  • In windows right click the application from the system tray and select configure

  • Click Java tab

  • Set the Java Virtual Machine to/ or use the select path button:

    C:\Program Files\Java\jdk1.7.0_21\jre\bin\server\jvm.dll

like image 104
Nath Avatar answered Oct 20 '22 14:10

Nath


You can download the commons-deamon-1.0.15-bin-windows binaries, and you can see the folder hierarchy as follows;

  • List item
  • amd64
  • ia64
  • prunsrv.exe
  • prunmgr.exe

On my 64bit machine, i faced the same problem with prunsrv.exe. After some research(apache's website), the solution is using the correct version of prunsrv.exe under the amd64 for 64bit machines. Using amd64/prunsrv.exe worked for me.

like image 23
Metin Toyran Avatar answered Oct 20 '22 14:10

Metin Toyran