I have installed the MYTESTService on the server (windows 2008 64X) but when I start it, I got an error(Error 2: The system cannot find the file specified.)
The same programe runs well in my laptop (windows xp)
The log of server event is following:
-------------------------------------------------------------------------------
Log Name: System
Source: Service Control Manager
Date: 2010/9/20 16:43:23
Event ID: 7000
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Description:
The MYTESTService service failed to start due to the following error:
The system cannot find the file specified.
hello,
i suppose you have tried running your application using runConsole.bat also on win 2008.
could you please execute the service executable in a console:
that is:
- open the windows service gui
- right click on the service -> properties
- cut the string in the field path to exe
- paste it into a console
i suppose that you are having security issues. you could try setting the service user name and password to those of the console user.
another issue could be the working directory. did you set it in the configuration file ?
-- Ron
Ron,
Thank you for your reply.
It runs well using runConsole.bat, but the service still can not be started because the same error even though I set the account in the configuration file as following:
wrapper.app.account=xxxx
wrapper.app.password=****
The account's group is AdministratorGroup.
What security issues am I having?
I think it is not a security issue because that I can install and start the tomcat service .
My configuration is following:
#********************************************************************
# Java Executable Properties
#********************************************************************
# Java Application
wrapper.java.command=java
wrapper.java.initmemory=256
wrapper.java.maxmemory=512
#********************************************************************
# working directory
#********************************************************************
wrapper.working.dir=D:\serviceTest\bin
#********************************************************************
# Application Account
#********************************************************************
#wrapper.app.account=
#wrapper.app.password=
# Java Application main class
wrapper.java.app.mainclass=com.my.test.service.mainclass
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
# YAJSW: all libs required by YAJSW are in the manifest of the wrapper.jar -> only classpath of your application is required
wrapper.java.classpath.1=D:\serviceTest\bin\services\conf\lib\*.jar
wrapper.java.classpath.2=D:\serviceTest\bin\services\conf\lib\ibatis\*.jar
wrapper.java.classpath.3=D:\serviceTest\bin\services\conf\lib\boe\*.jar
# Log Level for console output. (See docs for log levels)
# YAJSW: currently not implemented -> can be implemented by configuration of java logging
wrapper.console.loglevel=INFO
wrapper.logfile=../logs/jetty-service.log
#********************************************************************
# Wrapper Windows Console Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=MYTESTService
# Name of the service
wrapper.ntservice.name=MYTESTService
# Display name of the service
wrapper.ntservice.displayname=MYTESTService
# Description of the service
wrapper.ntservice.description=MYTESTService
#********************************************************************
# Wrapper System Tray Properties
#********************************************************************
# enable system tray
wrapper.tray = true
# tray icon file to use
#wrapper.tray.icon=
#********************************************************************
# Exit Code Properties
# Restart on non zero exit code
#********************************************************************
wrapper.on_exit.0=SHUTDOWN
wrapper.on_exit.default=RESTART
#********************************************************************
# Trigger actions on console output
#********************************************************************
# On Exception show message in system tray
wrapper.filter.trigger.0=Exception
wrapper.filter.script.0=scripts/trayMessage.gv
wrapper.filter.script.0.args=Exception
#********************************************************************
# genConfig: Further generated Properties
#********************************************************************
placeHolderSoGenPropsComeHere=
Thanks.
-- Evan
Hello,
try setting
wrapper.ntservice.account
wrapper.ntservice.password
instead of wrapper.app.account...
pls also cut & paste the service exe path from the windows services gui.
-- ron
ps: the ntservice account can also be set with the windows services gui.
Hello Ron,
The service exe path is :
"java" "-classpath" "D:\serviceTest\bin\services\wrapper.jar" "-Xrs" "-Dwrapper.service=true" "-Dwrapper.working.dir=D:\serviceTest\bin\" "-Dwrapper.config=D:\serviceTest\bin\services\conf\wrapper.conf" "-Dwrapper.additional.1x=-Xrs" "org.rzo.yajsw.boot.WrapperServiceBooter"
and I have changed the ntserverice account with the windows service GUI, but I got the same error.
-- Evan
hello,
error 2 means that the file "java" cannot be found or that a dll used by java canot be found.
given that setting the service user did not help there is something else wrong.
did you install java or just copied the java installation to this machine ?
do you have a 64bit java or a 32bit or both on the machine ?
is java_home set as system environment variable ?
is path to java bin in the system environment varialbe path
try the following:
uninstall the service
change the configuration : wrapper.java = <full path to java exe>
install the service and try to start.
-- Ron
PS: i mean
wrapper.java.command = ...
not
wrapper.jara
Hi Ron,
Thank you very much.
I just set JRE_HOME in the batch file not in EVN. So I can run it by runConsole.bat but not for the service because the service can not find the java.exe file then I always get the Error(Error 2: The system cannot find the file specified.).
It runs well when I set the java path in the config file as you metioned as following:
wrapper.java.command = D:/serviceTest/jre/bin/java
Sorry, it is NOT a bug.
Thank you again.
--Evan
Hi Ron,
wrapper.java.command = D:/serviceTest/jre/bin/java
How to set a relative path?
I try to set the path as following:
wrapper.java.command = ../jre/bin/java
but it doesn't wok.
hello,
instead of setting a relative path, would something like:
wrapper.java.command=${java_nome}/bin/java
do ?
-- ron
Hi Ron,
Thank you for your help.
--Evan