prunsrv.exe Service not starting up

╄→尐↘猪︶ㄣ 提交于 2019-12-03 11:27:29

one possible issue is using wrong prunsvr.exe. for 64 bit java install, use amd64/prunsvr.exe, for 32 bit java install, use /prunsvr.exe in commons-deamon-xxx-bin-windows.zip file.

This could be many things. First check the logs. The default is at...

%SystemRoot%\System32\LogFiles\Apache

From there you should be able to get a more specific error. E.g. Classpath, Java path, or some other option being invalid.

The reason for this error was that i did not rename prunsrv.exe to TestService.exe. Similarly Prunmgr.exe has to be TestServicew.exe.

Very important that these files are renamed.

If you're starting the service from the Service Manager and not the command line, you need to set the CLASSPATH, JAVA_OPTS etc in the registry. From here:

The basic Service definitions are maintained under the registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<ServiceName>

Additional parameters are stored in the registry at:

HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\ProcRun 2.0\<ServiceName>\Parameters

On 64-bit Windows procrun always uses 32-bit registry view for storing the configuration. This means that parameters will be stored inside:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\ProcRun 2.0\<ServiceName>

I was able to run the service on my local machine, but I got the same error on a VM running with Windows 2012R2.

The issue was caused by two reasons:

  1. reference to jvm.dll

On the VM I used a JDK installation instead of a simple JRE and the JAVA_HOME pointed to the JDK bin folder. I had to change the --Jvm parameter from "auto" to the actual jvm.dll file located in the JRE subfolder.

  1. amd64 version of prunsrv.exe

Allthough I changed the --Jvm setting, the service still showed the error during startup. I also had to use the amd64 version of prunsrv.exe to resolve the issue.

In case someone find it helpful. I had the same issue "The data area passed to a system call is too small". This is because program cannot find jvm.dll in StartMode=jvm.

Solution: all depends on your StartMode. 1) if "--StartMode" is jvm you have to specify "--jvm" parameter as path to jvm.dll 2) if "--StartMode" is java or exe set "--jvm" parameter as auto (your program will be launched as separate procces named java.exe)

I had the same issue in my laptop but it was working on others laptop which is having the same configution.

I have checked %SystemRoot%\System32\LogFiles\Apache\commons-daemon.log. I found the following error missing Image File,

Then I found that we need to put double quotes over all the parameters. On your example, If you try

pushd %CD%

Try this below.

"prunsrv.exe" //IS//%SERVICE_NAME% --Startup="%PR_STARTUP%" --Jvm="%PR_JVM%" --Classpath="%PR_CLASSPATH%" --StartMode="jvm" --StopMode="jvm" --StartClass="%PR_STARTCLASS%" --StartMethod="%PR_STARTMETHOD%" --StopClass="%PR_STOPCLASS%" --StopMethod="%PR_STOPMETHOD%"

SAMPLE EXAMPLE http://www.eclipse.org/jetty/documentation/current/startup-windows-service.html

Just compared this with a setup script of mine, the only immediate thing i see is that you should perhaps make your memory settings look like

REM JVM configuration
set PR_JVMMS=64m 
set PR_JVMMX=128m
set PR_JVMSS=128m

And by the way, JRE 1.6.0_04 is somewhat err outdated...

HTH Gyro

I had the same error but all I had to do is run the script as administrator (on windows server 2012)... Apparently the permission system on windows 2012 has changed: ex. on windows server 2008 this error did not occur (same script).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!