anom217
anom217

Reputation: 223

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've 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.

Upvotes: 16

Views: 46115

Answers (10)

Color
Color

Reputation: 21

Path to Java virtual machine need to be set. One way is to run Tomcat preferences app (tomcatw.exe). And set Java virtual machine.

enter image description here

Second way is to edit config: C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5\bin\service.bat

rem Try to use the server jvm set "JVM=%JRE_HOME%\bin\server\jvm.dll"

Upvotes: 1

ashish jhaveri
ashish jhaveri

Reputation: 69

Locate Tomcat8w.exe in tomcat installation folder and double click on it. change Java virtual machine path in that dialogue box.

this generally happens when you specified JVM path from JRE folder and java is being updated by patches automatically.

Upvotes: 0

Atafar
Atafar

Reputation: 717

I had a similar issue with Tomcat 9 and Java 11 which turned out to be a missing DLL dependency. The issue:

[2020-10-05 17:40:21] [info]  [ 3528] Apache Commons Daemon procrun (1.2.2.0 64-bit) started.
[2020-10-05 17:40:21] [info]  [ 3528] Running Service 'Tomcat9'...
[2020-10-05 17:40:21] [info]  [ 5772] Starting service...
[2020-10-05 17:40:21] [error] [ 5772] The specified procedure could not be found.
[2020-10-05 17:40:21] [error] [ 5772] Failed creating Java 'C:\Program Files\jre11-x64\bin\server\jvm.dll'.
[2020-10-05 17:40:21] [error] [ 5772] The specified procedure could not be found.
[2020-10-05 17:40:21] [error] [ 5772] ServiceStart returned 1.
[2020-10-05 17:40:21] [error] [ 5772] The specified procedure could not be found.
[2020-10-05 17:40:21] [info]  [ 3528] Run service finished.
[2020-10-05 17:40:21] [info]  [ 3528] Apache Commons Daemon procrun finished.

This is on a x64 Win 7 machine. I used the dependency walker on the jvm.dll. Turns out vcruntime140.dll was missing on my machine. So I installed the MS VC runtime 2015 from the MS site.

Note that Java 11 does not have a separate JRE anymore. And this is what you get if you install from a .zip file instead of an installer: missing dependencies.

After installing the missing VC runtime, Tomcat 9 worked.

Upvotes: 0

user13453853
user13453853

Reputation: 1

check the path in tomcat configuration.it might be wrong in your server

Upvotes: 0

Vipul
Vipul

Reputation: 11

In my case I was using OpenJDK with tomcat9 and saw similar error message, so I changed the Properties of tomcat9w to start as "Local system account" and that also fixed the jvm.dll issue of " Failed to create .... with access denied" for me.

Upvotes: 1

Sid
Sid

Reputation: 11

I had this issue trying to start Apache TC as a service. Fixed it by running TomCatW.exe //MS//, then configuring that from system tray by disabling the Java VM default setting and pointing it to my JRE\Server folder for my 64 bit installation.

Upvotes: 1

Sonali
Sonali

Reputation: 21

This issue usually occurred when we used 64 bit jre with 32 bit ApacheDS. I tried below solution and It worked for me.

  1. Install jre-8u91-windows-i586.exe. It will gets installed on C:\Program Files (x86).
  2. Copy msvcr100.dll and msvcr120.dll files from C:\Program Files (x86)\Java\jre1.8.0_91\bin to C:\Program Files (x86)\apacheds-1.5.0\bin .
  3. Set JAVA_HOME and PATH environment variables:

    JAVA_HOME - C:\Program Files (x86)\Java\jre1.8.0_91

    PATH - C:\Program Files (x86)\Java\jre1.8.0_91\bin.

  4. Go to Java tab in ApacheDS, Uncheck use default checkbox and set JVM to C:\Program Files (x86)\Java\jre1.8.0_91\bin\client\jvm.dll

  5. Start the service.

Upvotes: 2

Metin Toyran
Metin Toyran

Reputation: 81

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.

Upvotes: 8

Nath
Nath

Reputation: 6864

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

Upvotes: 19

anom217
anom217

Reputation: 223

Fixed the issue. The 32-bit version of the JRE must be installed since it looks for that registry info. I had the 64-bit version.

Upvotes: 4

Related Questions