Menu

Windows Service not restarting with timer

Help
Graphfoto
2014-02-28
2014-03-09
  • Graphfoto

    Graphfoto - 2014-02-28

    I am running 11.11 on Windows 2008 R2, apart from the default-config I only configured the following:

    wrapper.on_exit.default=RESTART
    wrapper.jvm_exit.timeout=20
    wrapper.timer.cron.RESTART=0 0 0 * * ?

    (also tried with wrapper.timer.cron.RESTART= * 0 * ?)

    Service installation was fine, it starts properly when I manually start the service. My goal is to restart the service at midnight, however it only stops, log is:

    INFO|wrapper|Service yajsw|14-02-27 23:59:57|received service control 4
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|stop from Thread DefaultQuartzScheduler_Worker-1 reason: TIMER
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|set state RUNNING->STATE_USER_STOP
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|stopping process with pid/timeout 7128 50000
    INFO|7128/0|Service yajsw|14-02-28 00:00:00|Controller State: LOGGED_ON -> USER_STOP
    INFO|7128/0|Service yajsw|14-02-28 00:00:00|controller sending a stop command
    INFO|7128/0|Service yajsw|14-02-28 00:00:00|Controller State: USER_STOP -> WAITING_CLOSED
    INFO|7128/0|Service yajsw|14-02-28 00:00:00|session closed -> waiting
    INFO|7128/0|Service yajsw|14-02-28 00:00:00|wrapper manager received stop command
    INFO|7128/0|Service yajsw|14-02-28 00:00:00|session closed
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|waitFor 50000
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|GetExitCodeProcess returned 259
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|getExitCode -2 process> INFO==null=false
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|is running: true 7128 -2
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|1waitFor
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|2waitFor
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|WaitForSingleObject -
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|WaitForSingleObject terminated PID: 7128
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|GetExitCodeProcess returned 259
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|getExitCode -2 process> INFO==null=false
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|is running: true 7128 -2
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|WaitForSingleObject +
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|WaitForSingleObject -
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|WaitForSingleObject terminated PID: 7128
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|GetExitCodeProcess returned 0
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|getExitCode 0 process> INFO==null=false
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|is running: false 7128 0
    INFO|7128/0|Service yajsw|14-02-28 00:00:00|process terminated
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|getExitCode 0 process> INFO==null=false
    INFO|7128/0|Service yajsw|14-02-28 00:00:00|Controller State: WAITING_CLOSED -> PROCESS_KILLED
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|giving up after 0 retries
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|stop from Thread yajsw.controller-2 reason: USER
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|process not in state RUNNING -> Delaying stop
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|GetExitCodeProcess returned 0
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|getExitCode 0 process> INFO==null=false
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|is running: false 7128 0
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|getExitCode 0 process> INFO==null=false
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|is running: false 7128 0
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|getExitCode 0 process> INFO==null=false
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|is running: false 7128 0
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|getExitCode 0 process> INFO==null=false
    INFO|wrapper|Service yajsw|14-02-28 00:00:00|is running: false 7128 0
    INFO|7128/0|Service yajsw|14-02-28 00:00:01|gobler terminated OUTPUT 7128
    INFO|7128/0|Service yajsw|14-02-28 00:00:01|gobler terminated ERROR 7128
    INFO|wrapper|Service yajsw|14-02-28 00:00:01|process handles destroyed -1
    INFO|wrapper|Service yajsw|14-02-28 00:00:01|getExitCode 0 process> INFO==null=true
    INFO|wrapper|Service yajsw|14-02-28 00:00:01|process exit code: 0
    INFO|wrapper|Service yajsw|14-02-28 00:00:01|set state STATE_USER_STOP->IDLE
    INFO|wrapper|Service yajsw|14-02-28 00:00:01|getExitCode 0 process> INFO==null=true
    INFO|wrapper|Service yajsw|14-02-28 00:00:01|shutdown wrapper due to exit code rule
    INFO|wrapper|Service yajsw|14-02-28 00:00:01|stop from Thread yajsw.controller-2 reason: WRAPPER SHUTDOWN
    INFO|wrapper|Service yajsw|14-02-28 00:00:01|set state IDLE->STATE_SHUTDOWN
    INFO|wrapper|Service yajsw|14-02-28 00:00:06|start from Thread DefaultQuartzScheduler_Worker-1
    INFO|wrapper|Service yajsw|14-02-28 00:00:06|Process not IDLE -> Delaying start request

    and after that nothing until I start the service manually.

    Windows eventlog-> System also has an entry:

    The XXX service terminated unexpectedly. It has done this 1 time(s).

    Is the event-message supposed to come up?
    And does the wrapped jar need to fulfil any requirements for the wrapper to properly close it?

    thanks for any help

    g

     
  • abest.tandemradiology

    I can't help you with the cron setting, but I can confirm the wrapped app doesn't have to do anything for the wrapper to shutdown without error. It basically just kills the process. You can subscribe to a callback in the wrapper app to try to shutdown your wrapped app gracefully, but the wrapper itself doesn't really care.

     
  • rzo

    rzo - 2014-03-02

    hello,

    could you pls attach your configuration file.
    i think that the problem is with:

    shutdown wrapper due to exit code rule

    @abest.tandemradiology:

    It basically just kills the process.

    this is not quite correct.
    yajsw implements a 2 phase kill: first send a WM_CLOSE to all windows. For a java application this is similar to cntrl-c in the console window. This will cause the invocation of the java shutdown hooks, which should enable the java application to shutdown cleanly. Then wait for the application to terminate. If the application does not terminate within the given timeout, it is killed using TerminateProcess.

    therefore shutdown hooks are the way to go. They are independent of the wrapper.

    another way to go may be:
    leave the configuration as is, eg stop the service at 00:00 and let windows restart the service.
    for this add the following to the configuration:

    wrapper.ntservice.failure_actions.actions = RESTART
    wrapper.ntservice.failure_actions.actions_delay=10000

    reinstall the service.

    -- Ron

     
  • Graphfoto

    Graphfoto - 2014-03-03

    Thank you very much for the support! I will try your recommended switches and report back.

    Meanwhile, this is my full config:

    # 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
    #wrapper.java.customProcName=

    #********************************************************************
    # working directory
    #********************************************************************
    wrapper.working.dir=D:\XXX\

    # 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
    #********************************************************************
    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).
    # If no group is configured default group of the user is used
    #********************************************************************
    #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
    #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
    #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>

    #********************************************************************
    # Wrapper Logging Properties
    #********************************************************************
    # Format of output for the console. (See docs for formats)
    # wrapper.console.format=PM

    # 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

    # Format of output for the log file. (See docs for formats)
    #wrapper.logfile.format=LPTM

    # Log Level for log file output. (See docs for log levels)
    #wrapper.logfile.loglevel=INFO

    # 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

    #********************************************************************
    # Application Console Properties
    #********************************************************************
    # Indicate if console of the application is visible.
    #wrapper.console.visible=false

    # Title to use when running as a console
    wrapper.console.title=XXX_yajsw

    #********************************************************************
    # Wrapper Windows Service and Posix Daemon Properties
    #********************************************************************
    # Name of the service
    wrapper.ntservice.name=Sycor Email Processing

    # Display name of the service
    wrapper.ntservice.displayname=Sycor Email Processing

    # Description of the service
    wrapper.ntservice.description=Email-Processing for USD

    # Service dependencies. Add dependencies as needed starting from 1
    # wrapper.ntservice.dependency.1=

    # Mode in which the service is installed. AUTO_START or DEMAND_START
    wrapper.ntservice.starttype=AUTO_START

    # Allow the service to interact with the desktop.
    # wrapper.ntservice.interactive=false

    # 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 =

    # Directory in which to create K... and S... links.
    # Default: <wrapper.daemon.dir>/rcX.d
    # For Ubuntu set to /etc/rcX.d
    # The following grooy script should set it correctly for most distros
    wrapper.daemon.run_level_dir=${if (new File('\/etc\/rc0.d').exists()) return '\/etc\/rcX.d' else return '\/etc\/init.d\/rcX.d'}

    # Setting the runlevels and priorities for automatic startup and stop of the daemon.
    # Similar syntax as the update_rc.d command
    # Default: equivalent to default of update_rc.d
    #wrapper.daemon.update_rc = start 20 2 3 4 . start 30 5 . stop 80 0 1 6

    #********************************************************************
    # Wrapper System Tray Properties
    #********************************************************************
    # enable system tray
    wrapper.tray = true

    # TCP/IP port. If none is defined multicast discovery is used to find the port
    # Set the port in case multicast is not possible.
    wrapper.tray.port = 15002

    # icon file to use, per default a console icon is used
    #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

    #********************************************************************
    # Wrapper JMX
    #
    # connect using for example jconsole per remote access using the url
    #
    # service:jmx:rmi:///jndi/rmi://localhost:1099/server
    #
    # eventl. change port and server name
    #********************************************************************
    # Enable wrapper JMX
    #wrapper.jmx = true

    # JMX RMI port. default is 1099
    #wrapper.jmx.rmi.port =

    # JMX RMI credentials
    # mandatory if accessing from remote server
    #wrapper.jmx.rmi.user =
    #wrapper.jmx.rmi.password =

    #********************************************************************
    # Wrapper timeouts
    #********************************************************************
    # Number of seconds to allow between the time that the Wrapper starts the application
    # and the application logon to the wrapper.
    # Default: 30 seconds
    #wrapper.startup.timeout =

    # Number of seconds to allow between the time that the Wrapper asks the application to shutdown and the time that the JVM shuts down.
    # Default: 30 seconds
    #wrapper.shutdown.timeout =

    # Number of seconds the wrapper waits for a ping message from the java application.
    # If no heart beat is received within a timeout the wrapper assumes that the application
    # is non responsive and will restart it.
    # Default: 30 seconds
    #wrapper.ping.timeout =

    #********************************************************************
    # genConfig: further Properties generated by genConfig
    #********************************************************************
    placeHolderSoGenPropsComeHere=
    wrapper.java.app.jar = XXX.jar
    wrapper.java.command = java

    #********************************************************************
    # self-defined Properties
    #********************************************************************
    #debugging of yajsw-wrapper
    wrapper.debug=true

    # restart on failure
    wrapper.on_exit.default=RESTART

    # set different timeout for shutdown
    wrapper.jvm_exit.timeout=20

    # daily restart at midnight
    wrapper.timer.cron.RESTART=* * 0 * * ?

     

    Last edit: Graphfoto 2014-03-03
  • Graphfoto

    Graphfoto - 2014-03-03

    By the way, I think the described shutdown-mechanism of the wrapped application would be a good addition for the documentation (could be that I missed it, though). And even more the mentioning of adding shutdown-hooks for better cleanup (closing DB-connections etc.).

     
  • Graphfoto

    Graphfoto - 2014-03-05

    Thank you very much for your help, these lines

    wrapper.ntservice.failure_actions.actions = RESTART
    wrapper.ntservice.failure_actions.actions_delay=10000

    did the trick, service starts now properly at midnight. Windos-System-Eventlog still contains an entry

    The XXX service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 10000 milliseconds: Restart the service.

    Is my understanding wrong or should the semantics of a timer-scheduled restart be more graceful in terms of telling windows that "it's not unexpected"? I would have thought that the service should not restart, just the wrapper.

    For sake of completeness the wrapper.log:

    INFO|wrapper|Service yajsw|14-03-04 23:59:50|received service control 4
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|stop from Thread DefaultQuartzScheduler_Worker-1 reason: TIMER
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|set state RUNNING->STATE_USER_STOP
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|stopping process with pid/timeout 7280 50000
    INFO|7280/0|Service yajsw|14-03-05 00:00:00|Controller State: LOGGED_ON -> USER_STOP
    INFO|7280/0|Service yajsw|14-03-05 00:00:00|controller sending a stop command
    INFO|7280/0|Service yajsw|14-03-05 00:00:00|Controller State: USER_STOP -> WAITING_CLOSED
    INFO|7280/0|Service yajsw|14-03-05 00:00:00|session closed -> waiting
    INFO|7280/0|Service yajsw|14-03-05 00:00:00|wrapper manager received stop command
    INFO|7280/0|Service yajsw|14-03-05 00:00:00|session closed
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|waitFor 50000
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|GetExitCodeProcess returned 259
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|getExitCode -2 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|is running: true 7280 -2
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|1waitFor
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|2waitFor
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|WaitForSingleObject -
    INFO|wrapper|Service yajsw|14-03-05 00:00:00|WaitForSingleObject terminated PID: 7280
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|GetExitCodeProcess returned 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|getExitCode 0 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|is running: false 7280 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|getExitCode 0 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|is running: false 7280 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|getExitCode 0 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|is running: false 7280 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|getExitCode 0 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|is running: false 7280 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|GetExitCodeProcess returned 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|getExitCode 0 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|is running: false -1 0
    INFO|7280/0|Service yajsw|14-03-05 00:00:01|process terminated
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|getExitCode 0 processINFO==null=false
    INFO|7280/0|Service yajsw|14-03-05 00:00:01|Controller State: WAITING_CLOSED -> PROCESS_KILLED
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|giving up after 0 retries
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|stop from Thread yajsw.controller-2 reason: USER
    INFO|wrapper|Service yajsw|14-03-05 00:00:01|process not in state RUNNING -> Delaying stop
    INFO|7280/0|Service yajsw|14-03-05 00:00:02|gobler terminated OUTPUT 7280
    INFO|7280/0|Service yajsw|14-03-05 00:00:02|gobler terminated ERROR 7280
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|process handles destroyed -1
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|getExitCode 0 processINFO==null=true
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|process exit code: 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|set state STATE_USER_STOP->IDLE
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|getExitCode 0 processINFO==null=true
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|shutdown wrapper due to exit code rule
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|stop from Thread yajsw.controller-2 reason: WRAPPER SHUTDOWN
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|set state IDLE->STATE_SHUTDOWN
    INFO|wrapper|Service yajsw|14-03-05 00:00:02|received service control 4
    INFO|wrapper|Service yajsw|14-03-05 00:00:07|start from Thread DefaultQuartzScheduler_Worker-1
    INFO|wrapper|Service yajsw|14-03-05 00:00:07|Process not IDLE -> Delaying start request
    WARNING|wrapper|Service yajsw|14-03-05 00:00:23|YAJSW: yajsw-stable-11.11
    WARNING|wrapper|Service yajsw|14-03-05 00:00:23|OS : Windows Server 2008 R2/6.1/amd64
    WARNING|wrapper|Service yajsw|14-03-05 00:00:23|JVM : Oracle Corporation/1.7.0_40/C:\Program Files\Java\jre7/64
    INFO|wrapper|Service yajsw|14-03-05 00:00:23|ahessian jmx service bound to port 15002
    WARNING|wrapper|Service yajsw|14-03-05 00:00:24|[id: 0x30815381, /127.0.0.1:55618 => /127.0.0.1:15002] connected
    INFO|wrapper|Service yajsw|14-03-05 00:00:24|Win service: before service init
    INFO|wrapper|Service yajsw|14-03-05 00:00:24|start from Thread pool-1-thread-1
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|set state IDLE->STARTING
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|starting Process
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|starting controller
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|binding to port 15003
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|Controller State: UNKNOWN -> WAITING
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|+ ServiceMain callback
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|binding successfull
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|controller started
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|reporting status 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|reporting status 0
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|onstart
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|working dir D:\XXX
    INFO|wrapper|Service yajsw|14-03-05 00:00:25|create script: scripts/trayMessage.gv
    INFO|wrapper|Service yajsw|14-03-05 00:00:26|received service control 4
    INFO|wrapper|Service yajsw|14-03-05 00:00:26|received service control 4
    INFO|wrapper|Service yajsw|14-03-05 00:00:27|found script scripts/trayMessage.gv
    INFO|wrapper|Service yajsw|14-03-05 00:00:27|create script: scripts/sendMail.gv
    INFO|wrapper|Service yajsw|14-03-05 00:00:28|found script scripts/sendMail.gv
    INFO|wrapper|Service yajsw|14-03-05 00:00:28|spawning wrapped process
    INFO|wrapper|Service yajsw|14-03-05 00:00:28|is running: false pid=(-1<=0)
    INFO|wrapper|Service yajsw|14-03-05 00:00:28|exec: java.exe -classpath D:\yajsw-stable-11.11\wrapperApp.jar;D:\XXX\XXX.jar;D:\XXX -Xrs -Dwrapper.service=true -Dwrapper.console.visible=false -Dwrapper_home=D:\yajsw-stable-11.11\bat\/.. -Djna_tmpdir=D:\yajsw-stable-11.11\bat..\tmp -Dwrapper.port=15003 -Dwrapper.key=5415061596461907100 -Dwrapper.teeName=5415061596461907100$1393974022985 -Dwrapper.tmp.path=D:\yajsw-stable-11.11\bat..\tmp -Djna_tmpdir=D:\yajsw-stable-11.11\bat..\tmp -Dwrapper.additional.1x=-Xrs -Dwrapper.working.dir=D:\XXX -Dwrapper.config=D:\yajsw-stable-11.11\conf\wrapper.conf org.rzo.yajsw.app.WrapperJVMMain
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|started process with pid 7052
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|set state STARTING->RUNNING
    INFO|7052/0|Service yajsw|14-03-05 00:00:29|waiting for termination of process
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|GetExitCodeProcess returned 259
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|getExitCode -2 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|is running: true 7052 -2
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|waitFor -1
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|GetExitCodeProcess returned 259
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|getExitCode -2 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|is running: true 7052 -2
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|1waitFor
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|2waitFor
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|GetExitCodeProcess returned 259
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|getExitCode -2 processINFO==null=false
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|is running: true 7052 -2
    INFO|wrapper|Service yajsw|14-03-05 00:00:29|WaitForSingleObject +
    INFO|7052/0|Service yajsw|14-03-05 00:00:32|[INFO] StandardFileSystemManager - Using "C:\Windows\TEMP\vfs_cache" as temporary files store.
    INFO|7052/0|Service yajsw|14-03-05 00:00:32|APP working dir=D:\XXX
    INFO|7052/0|Service yajsw|14-03-05 00:00:32|APP java version=1.7.0_40
    INFO|7052/0|Service yajsw|14-03-05 00:00:32|APP class path=D:\yajsw-stable-11.11\wrapperApp.jar;D:\XXX\XXX.jar;D:\XXX
    INFO|7052/0|Service yajsw|14-03-05 00:00:32|Application args: no args
    INFO|7052/0|Service yajsw|14-03-05 00:00:32|mainClass/jar/script: /XXX.jar/null
    INFO|7052/0|Service yajsw|14-03-05 00:00:32|external stop false
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|args:
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|terminated WrapperManager.init()
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|!! WARNING !! Windows JDK7 should set -Djava.net.preferIPv4Stack=true (see java bug 7179799 )
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|connecting to port 15003
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|Starting XXX
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|Controller State: WAITING -> ESTABLISHED
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|Controller State: ESTABLISHED -> LOGGED_ON
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|Correct key
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|XXX says: Configuration file 'XXX.conf' has been read successfully.
    INFO|7052/0|Service yajsw|14-03-05 00:00:33|WrapperManager: channel connected, sending key
    INFO|wrapper|Service yajsw|14-03-05 00:00:38|received service control 4

     
  • rzo

    rzo - 2014-03-09

    hello,

    the suggestion above is a workaround.
    i now had time to look into this and what is still missing in the configuration is:

    wrapper.control=APPLICATION

    This will avoid the wrapper of shutting down when the application terminates. The default is TIGHT, which is the behavior of JSW.

    Pls also set:

    `#wrapper.on_exit.0=SHUTDOWN´
    wrapper.on_exit.default=RESTART

    that is do not shutdown the wrapper when the application exists with 0.

    With these settings the service (eg the wrapper process) will not stop. however your application will be restarted and therefore no error should appear in the windows event log.

    you can leave failure_actions, thus the service will start whenever the wrapper crashes.

    -- Ron

     

    Last edit: rzo 2014-03-09

Log in to post a comment.