Hi Team,
We are using YAJSW to make our java application AS a service. We majorly use YAJSW for Windows 10 (64 bit) and it is working perfectly for most of the system but with some windows system we are getting issue when we do a System restart. So, when we restart the windows System then sometimes the service is not started and as per windows event log, we see the below error and also attached the screen shot.
Error - A service failed to start due to following the error - A service did not respond to the start or control request in timely manner. A timeout was reached (30000 MS) while waiting for service to
connect.
Please help me to resolve this issue. I am waiting for your humble response.
Current System - Windows 10 with Java Version : 1.8.0_382 (Amazon)
Wrapper Configuration -
WARNING - Do not modify any of the properties when an application
using this configuration file has been installed as a service or daemon.
Please uninstall the service before modifying this file. The
service must then be reinstalled.
**********
Java Executable Properties
**********
Java Application
wrapper.java.command=java
or define conditions for YAJSW searching for a JVM
currently only valid for windows
wrapper.java.command.minVersion=1.5
wrapper.java.command.maxVersion=1.6
wrapper.java.command.jreOnly=true
wrapper.java.command.jdkOnly=true
wrapper.java.command.preferJre=true
wrapper.java.command.preferJdk=true
wrapper.java.command.javaw=true
copy java.exe to <tmp>/java_<customprocname>_nnnn.exe</customprocname></tmp>
wrapper.java.customProcName=
**********
working directory
**********
wrapper.working.dir=${ipc_home}
Java Main class.
YAJSW: default is "org.rzo.yajsw.app.WrapperJVMMain"
DO NOT SET THIS PROPERTY UNLESS YOU HAVE YOUR OWN IMPLEMENTATION
wrapper.java.mainclass=
**********
tmp folder
yajsw creates temporary files named in_.. out_.. err_.. jna..
per default these are placed in jna.tmpdir.
jna.tmpdir is set in setenv batch file to <yajsw>/tmp</yajsw>
**********
wrapper.tmp.path = ${jna_tmpdir}
**********
Application main class or native executable
One of the following properties MUST be defined
**********
Java Application main class
wrapper.java.app.mainclass=
or jar file
wrapper.java.app.jar=
or groovy script file
wrapper.groovy=
or a native executable
wrapper.image=
**********
Application process cpu priority and affinity
**********
Process priority: LOW, BELOW_NORMAL, NORMAL, ABOVE_NORMAL, HIGH
wrapper.priority
CPU affinity of the process. this is a bit-array representing the cpus
wrapper.affinity=
**********
Application Account
Equivalent to Posix sudo or windows runas
Note Posix:
<group>\<user> (note: use \ in configuration file).</user></group>
**********
wrapper.app.account=
wrapper.app.password=
**********
Java/Groovy Application Properties
**********
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=
Java Library Path
YAJSW: required dll are encapsulated in jar files -> only library path of your application required
wrapper.java.library.path.1=../lib
Java Additional Parameters
wrapper.java.additional.1=
Initial Java Heap Size (in MB)
alternative for wrapper.java.additional.<n>=-Xms</n>
wrapper.java.initmemory=3
% of total RAM
wrapper.java.initmemory.relative=10
Maximum Java Heap Size (in MB)
alternative for wrapper.java.additional.<n>=-Xmx</n>
wrapper.java.maxmemory=64
% of total RAM
wrapper.java.maxmemory.relative=30
JSW requires that main class is set as app.parameter property
YAJSW: to specify the main class please use wrapper.java.app.mainclass=
**********
Application environment properties.
**********
Adds an environment to the application
wrapper.app.env.<key>=<value></value></key>
**********
Wrapper Logging Properties
**********
Log Level for console output. (See docs for log levels)
wrapper.console.loglevel=INFO
Log file to use for wrapper output logging.
wrapper.logfile=${wrapper_home}/log/wrapper.log
Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=STATUS
wrapper.app.status.log.lines=0
Maximum size that the log file will be allowed to grow to before
the log is rolled. Size is specified in bytes. The default value
of 0, disables log rolling by size. May abbreviate with the 'k' (kB) or
'm' (mB) suffix. For example: 10m = 10 megabytes.
If wrapper.logfile does not contain the string ROLLNUM it will be automatically added as suffix of the file name
wrapper.logfile.maxsize=10m
Maximum number of rolled log files which will be allowed before old
files are deleted. The default value of 0 implies no limit.
wrapper.logfile.maxfiles=10
Controls the roll mode of the log file
possible values: DATE, WRAPPER, JVM
If DATE is set wrapper.logfile should contain the string YYYYMMDD
If DATE is set and wrapper.logfile.maxsize is set the log file will be rolled by size and date
If DATE is set and wrapper.logfile.maxfiles older files rolled by size or date are deleted
wrapper.logfile.rollmode=DATE
Title to use when running as a console
wrapper.console.title=IPS
**********
Wrapper Windows Service and Posix Daemon Properties
**********
Name of the service
wrapper.ntservice.name=IPS
Display name of the service
wrapper.ntservice.displayname=IPS
Description of the service
wrapper.ntservice.description=IPS
Mode in which the service is installed. AUTO_START or DEMAND_START
wrapper service user. only for windows. on *nix system this is root.
see also wrapper.app.account
wrapper.ntservice.account=
wrapper.ntservice.password=
**********
Wrapper Posix Daemon Properties
**********
Directory in which to create and execute daemon init scripts. Default: /etc/init.d
wrapper.daemon.dir =
Directory where to store the wrapper pid file. Default: /var/run
wrapper.daemon.pid.dir =
wrapper.pidfile=${ipc_home}/service.pid
wrapper.ntservice.starttype=DELAYED_AUTO_START
**********
Exit Code Properties
Restart on non zero exit code
**********
wrapper.on_exit.0=SHUTDOWN
wrapper.on_exit.1=SHUTDOWN
wrapper.on_exit.default=RESTART
**********
genConfig: further Properties generated by genConfig
**********
placeHolderSoGenPropsComeHere=
wrapper.java.app.jar = ipc3-web.jar
wrapper.java.command = javaw
wrapper.app.parameter.1 = server-host=127.0.0.1
wrapper.app.parameter.2 = server-port=8080
wrapper.app.parameter.3 = device-port=18080
wrapper.app.parameter.4 = proxy=test.proxy.com:8080
wrapper.java.additional.1 = -Dloader.path=lib/
wrapper.java.additional.2 = -Djava.library.path=lib/
wrapper.app.pre.script=${ipc_home}/RemoveFiles.bat
wrapper.restart.reload_configuration=TRUE
Please let me know if any more details or information required.
Thank You
Vishal Gupta
I just added the Wrapper conf file again as in ticket it is not showing correctly.
hello,
i assume, that this only happens when the computer boots. that nothing is written to the yajsw log file. that everything is fine if the server is already up.
in most cases this indicates that the service is started before the boot is complete. in your case you are using an env var as working dir. this env var may not be available if the service is started too early.
try setting:
or the following:
or:
or:
pls refer to the yajsw docs for details.
-- Ron
Hi @rzorzorzo
Thank you so much for your prompt response and help.
I assume, that this only happens when the computer boots -- Yes
I am adding more details Like we are getting event ID 7000 and 7009 in this issue case.
7009 - A Timeout was Reached (30000 milliseconds) while waiting for the IPS service to connect.
7000 - The service did not respond to the start or control request in a timely fashion.
I attached herewith the windows event screen shot image for the same when this issue happened.
We tried wrapper.ntservice.starttype=DELAYED_AUTO_START but still getting the same issue when the computer boots.
Also, I have tried the wrapper.startup.timeout=300 but still getting the same issue.
As per your response -
Is this something you are trying to say ----
wrapper.ntservice.failure_actions.actions = RESTART
wrapper.ntservice.failure_actions.actions_delay=60000
And for below setting - "Netman" or "LanmanServer" should I use the same value, or I need to change it to something other?
wrapper.ntservice.dependency.1=Netman
or:
wrapper.ntservice.dependency.1=LanmanServer
Thanks, and waiting for your humble response.
Thanks,
Vishal Gupta
yes, to all your questions.
you may also try to set
wrapper.java.command to the full path of the java exe
and
wrapper.working.dir to the full path of the work dir.
remeber to deinstall the service before making any configuration changes.
-- Ron