Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Startup failed: Timed out waiting for signal

Help
Alan Prado
2010-06-30
2012-12-11
  • Alan Prado
    Alan Prado
    2010-06-30

    Hello,

    I made some tests, but I couldnt figure out how to configure my app.

    s, Alan

    <log>
    STATUS | wrapper  | 2010/06/30 17:18:57 | -> Wrapper Started as Console
    STATUS | wrapper  | 2010/06/30 17:18:57 | Java Service Wrapper Community Edition 32-bit 3.4.1
    STATUS | wrapper  | 2010/06/30 17:18:57 |   Copyright (C) 1999-2010 Tanuki Software, Ltd.  All Rights Reserved.
    STATUS | wrapper  | 2010/06/30 17:18:57 |     http://wrapper.tanukisoftware.org
    STATUS | wrapper  | 2010/06/30 17:18:57 |
    STATUS | wrapper  | 2010/06/30 17:18:57 | Launching a JVM…
    INFO   | jvm 1    | 2010/06/30 17:18:58 | WrapperManager: Initializing…
    INFO   | jvm 1    | 2010/06/30 17:18:58 | 9
    INFO   | jvm 1    | 2010/06/30 17:18:58 | 17
    INFO   | jvm 1    | 2010/06/30 17:18:59 | 5
    INFO   | jvm 1    | 2010/06/30 17:18:59 | 9
    INFO   | jvm 1    | 2010/06/30 17:19:00 | 6
    INFO   | jvm 1    | 2010/06/30 17:19:00 | 11
    INFO   | jvm 1    | 2010/06/30 17:19:01 | 3
    INFO   | jvm 1    | 2010/06/30 17:19:01 | 5
    INFO   | jvm 1    | 2010/06/30 17:19:02 | 8
    INFO   | jvm 1    | 2010/06/30 17:19:02 | 15
    INFO   | jvm 1    | 2010/06/30 17:19:03 | 0
    INFO   | jvm 1    | 2010/06/30 17:19:03 | -1
    INFO   | jvm 1    | 2010/06/30 17:19:04 | 6
    INFO   | jvm 1    | 2010/06/30 17:19:04 | 11
    INFO   | jvm 1    | 2010/06/30 17:19:05 | 0
    INFO   | jvm 1    | 2010/06/30 17:19:05 | -1
    INFO   | jvm 1    | 2010/06/30 17:19:06 | 7
    INFO   | jvm 1    | 2010/06/30 17:19:06 | 13
    INFO   | jvm 1    | 2010/06/30 17:19:07 | 7
    INFO   | jvm 1    | 2010/06/30 17:19:07 | 13
    INFO   | jvm 1    | 2010/06/30 17:19:08 | 8
    INFO   | jvm 1    | 2010/06/30 17:19:08 | 15
    INFO   | jvm 1    | 2010/06/30 17:19:09 | 9
    INFO   | jvm 1    | 2010/06/30 17:19:09 | 17
    INFO   | jvm 1    | 2010/06/30 17:19:10 | 0
    INFO   | jvm 1    | 2010/06/30 17:19:10 | -1
    INFO   | jvm 1    | 2010/06/30 17:19:11 | 2
    INFO   | jvm 1    | 2010/06/30 17:19:11 | 3
    INFO   | jvm 1    | 2010/06/30 17:19:12 | 8
    INFO   | jvm 1    | 2010/06/30 17:19:12 | 15
    INFO   | jvm 1    | 2010/06/30 17:19:13 | 9
    INFO   | jvm 1    | 2010/06/30 17:19:13 | 17
    INFO   | jvm 1    | 2010/06/30 17:19:14 | 9
    INFO   | jvm 1    | 2010/06/30 17:19:14 | 17
    INFO   | jvm 1    | 2010/06/30 17:19:15 | 6
    INFO   | jvm 1    | 2010/06/30 17:19:15 | 11
    INFO   | jvm 1    | 2010/06/30 17:19:16 | 7
    INFO   | jvm 1    | 2010/06/30 17:19:16 | 13
    INFO   | jvm 1    | 2010/06/30 17:19:17 | 8
    INFO   | jvm 1    | 2010/06/30 17:19:17 | 15
    INFO   | jvm 1    | 2010/06/30 17:19:18 | 9
    INFO   | jvm 1    | 2010/06/30 17:19:18 | 17
    INFO   | jvm 1    | 2010/06/30 17:19:19 | 8
    INFO   | jvm 1    | 2010/06/30 17:19:19 | 15
    INFO   | jvm 1    | 2010/06/30 17:19:20 | 7
    INFO   | jvm 1    | 2010/06/30 17:19:20 | 13
    INFO   | jvm 1    | 2010/06/30 17:19:21 | 9
    INFO   | jvm 1    | 2010/06/30 17:19:21 | 17
    INFO   | jvm 1    | 2010/06/30 17:19:22 | 3
    INFO   | jvm 1    | 2010/06/30 17:19:22 | 5
    INFO   | jvm 1    | 2010/06/30 17:19:23 | 4
    INFO   | jvm 1    | 2010/06/30 17:19:23 | 7
    INFO   | jvm 1    | 2010/06/30 17:19:24 | 3
    INFO   | jvm 1    | 2010/06/30 17:19:24 | 5
    INFO   | jvm 1    | 2010/06/30 17:19:25 | 9
    INFO   | jvm 1    | 2010/06/30 17:19:25 | 17
    INFO   | jvm 1    | 2010/06/30 17:19:26 | 9
    INFO   | jvm 1    | 2010/06/30 17:19:26 | 17
    INFO   | jvm 1    | 2010/06/30 17:19:27 | 2
    INFO   | jvm 1    | 2010/06/30 17:19:27 | 3
    ERROR  | wrapper  | 2010/06/30 17:19:27 | Startup failed: Timed out waiting for signal from JVM.
    ERROR  | wrapper  | 2010/06/30 17:19:27 | JVM did not exit on request, terminated
    STATUS | wrapper  | 2010/06/30 17:19:29 | CTRL-C trapped.  Shutting down.
    STATUS | wrapper  | 2010/06/30 17:19:29 | <- Wrapper Stopped
    </log>

    <wrapper.conf>
    #********************************************************************
    # Wrapper License Properties (Ignored by Community Edition)
    #********************************************************************
    # Professional and Standard Editions of the Wrapper require a valid
    #  License Key to start.  Licenses can be purchased or a trial license
    #  requested on the following pages:
    # http://wrapper.tanukisoftware.org/purchase
    # http://wrapper.tanukisoftware.org/trial

    # Include file problems can be debugged by removing the first '#'
    #  from the following line:
    ##include.debug

    # The Wrapper will look for either of the following optional files for a
    #  valid License Key.  License Key properties can optionally be included
    #  directly in this configuration file.
    #include ../conf/wrapper-license.conf
    #include ../conf/wrapper-license-%WRAPPER_HOST_NAME%.conf

    # The following property will output information about which License Key(s)
    #  are being found, and can aid in resolving any licensing problems.
    wrapper.license.debug=TRUE

    #********************************************************************
    # Wrapper Java Properties
    #********************************************************************
    # Java Application
    wrapper.java.command=java

    # Tell the Wrapper to log the full generated Java command line.
    #wrapper.java.command.loglevel=INFO

    # Java Main class.  This class must implement the WrapperListener interface
    #  or guarantee that the WrapperManager class is initialized.  Helper
    #  classes are provided to do this for you.  See the Integration section
    #  of the documentation for details.
    wrapper.java.mainclass=com.test.test1.Main

    # Java Classpath (include wrapper.jar)  Add class path elements as
    #  needed starting from 1
    wrapper.java.classpath.1=../lib/testservice.jar
    wrapper.java.classpath.2=../lib/wrapper.jar

    # Java Library Path (location of Wrapper.DLL or libwrapper.so)
    wrapper.java.library.path.1=../lib

    # Java Bits.  On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
    wrapper.java.additional.auto_bits=TRUE

    # Java Additional Parameters
    #wrapper.java.additional.1=

    # Initial Java Heap Size (in MB)
    #wrapper.java.initmemory=3

    # Maximum Java Heap Size (in MB)
    #wrapper.java.maxmemory=64

    # Application parameters.  Add parameters as needed starting from 1
    #wrapper.app.parameter.1=

    #********************************************************************
    # Wrapper Logging Properties
    #********************************************************************
    # Enables Debug output from the Wrapper.
    # wrapper.debug=TRUE

    # 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=../logs/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.  May abbreviate with the 'k' (kb) or
    #  'm' (mb) suffix.  For example: 10m = 10 megabytes.
    wrapper.logfile.maxsize=0

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

    # Log Level for sys/event log output.  (See docs for log levels)
    wrapper.syslog.loglevel=NONE

    #********************************************************************
    # Wrapper General Properties
    #********************************************************************
    # Allow for the use of non-contiguous numbered properties
    wrapper.ignore_sequence_gaps=TRUE

    # Title to use when running as a console
    wrapper.console.title=Test Wrapper Sample Application

    #********************************************************************
    # Wrapper JVM Checks
    #********************************************************************
    # Detect DeadLocked Threads in the JVM. (Requires Standard Edition)
    wrapper.check.deadlock=TRUE
    wrapper.check.deadlock.interval=60
    wrapper.check.deadlock.action=RESTART
    wrapper.check.deadlock.output=FULL

    # Out Of Memory detection.
    wrapper.filter.trigger.1000=java.lang.OutOfMemoryError
    wrapper.filter.action.1000=RESTART
    wrapper.filter.message.1000=The JVM has run out of memory.

    #********************************************************************
    # Wrapper Email Notifications. (Requires Professional Edition)
    #********************************************************************
    # Common Event Email settings.
    #wrapper.event.default.email.debug=TRUE
    #wrapper.event.default.email.smtp.host=<SMTP_Host>
    #wrapper.event.default.email.smtp.port=25
    #wrapper.event.default.email.subject= Event Notification
    #wrapper.event.default.email.sender=<Sender email>
    #wrapper.event.default.email.recipient=<Recipient email>

    # Configure the log attached to event emails.
    #wrapper.event.default.email.attach_log=TRUE
    #wrapper.event.default.email.maillog.lines=50
    #wrapper.event.default.email.maillog.format=LPTM
    #wrapper.event.default.email.maillog.loglevel=INFO

    # Enable specific event emails.
    #wrapper.event.wrapper_start.email=TRUE
    #wrapper.event.jvm_prelaunch.email=TRUE
    #wrapper.event.jvm_start.email=TRUE
    #wrapper.event.jvm_started.email=TRUE
    #wrapper.event.jvm_stop.email=TRUE
    #wrapper.event.jvm_stopped.email=TRUE
    #wrapper.event.jvm_restart.email=TRUE
    #wrapper.event.jvm_failed_invocation.email=TRUE
    #wrapper.event.jvm_max_failed_invocations.email=TRUE
    #wrapper.event.jvm_kill.email=TRUE
    #wrapper.event.jvm_killed.email=TRUE
    #wrapper.event.jvm_unexpected_exit.email=TRUE
    #wrapper.event.wrapper_stop.email=TRUE

    # Specify custom mail content
    wrapper.event.jvm_restart.email.body=The JVM was restarted.\n\nPlease check on its status.\n

    #********************************************************************
    # Wrapper Windows NT/2000/XP Service Properties
    #********************************************************************
    # WARNING - Do not modify any of these properties when an application
    #  using this configuration file has been installed as a service.
    #  Please uninstall the service before modifying this section.  The
    #  service can then be reinstalled.

    # Name of the service
    wrapper.name=testwrapper

    # Display name of the service
    wrapper.displayname=Test Wrapper Sample Application

    # Description of the service
    wrapper.description=Test Wrapper Sample Application Description

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

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

    # Allow the service to interact with the desktop.
    wrapper.ntservice.interactive=false
    </wrapper.conf>

    <code>
    <class Main>
    package com.test.test1;

    import org.tanukisoftware.wrapper.WrapperListener;
    import org.tanukisoftware.wrapper.WrapperManager;

    public class Main implements WrapperListener{
    private static Calc calc;
    public Main() {
    }

    public static void main(String args) throws InterruptedException {
    WrapperManager.start(new Main(), args);
    }

    @Override
    public void controlEvent(int event) {
    if ( ( event == WrapperManager.WRAPPER_CTRL_LOGOFF_EVENT )
                && ( WrapperManager.isLaunchedAsService() || WrapperManager.isIgnoreUserLogoffs() ) )
            {
                // Ignore
            }
            else
            {
            calc.setRunning(false);
                WrapperManager.stop( 0 );
                // Will not get here.
            }
    }

    @Override
    public Integer start(String arg0) {
    try {
    calc = new Calc();
    calc.setRunning(true);
    System.out.println("Start:");
    calc.init();
    return 0;
    } catch (InterruptedException e) {
    e.printStackTrace();
    return 1;
    }

    }

    @Override
    public int stop(int event) {
    calc.setRunning(false);
    System.out.println("Stop:");
    WrapperManager.stop(0);
    return event;
    }

    }
    </class Main>
    <class Calc>
    package com.test.test1;

    public class Calc {
    private boolean running;

    public Calc(){

    }

    public int soma(int a, int b){
    return a+b;
    }
    public int sub(int a, int b){
    return a-b;
    }
    public int mul(int a, int b){
    return a*b;
    }
    public int div(int a, int b){
    return a/b;
    }

    public void setRunning(boolean running) {
    this.running = running;
    }

    public void init() throws InterruptedException {
    // int cont=0;
    while(running) {

    // if(cont>20) running = false;
    //
    // cont++;
    int i = (int) (Math.random()*10);
    System.out.println(i);
    System.out.println(new Calc().soma(i,i-1));
    Thread.sleep(1000);
    }
    }
    }

    </class Calc>
    </code>

     
  • Alan,

    your start method doesn't seem to return. However a start method is supposed to return immediately after a class has started.

    the wrapper is waiting 30 seconds for your application to start up. (default value of wrapper.startup.timeout)
    http://wrapper.tanukisoftware.org/doc/english/prop-startup-timeout.html

    Please try slightly changing your code to:

    public static void main(String[] args) throws InterruptedException
     {
     WrapperManager.start(new Main(), args); 
    calc.init(); 
    }
    

    and remove the calc.init() from your start method.

    Cheers,
    christian

     
  • Alan Prado
    Alan Prado
    2010-07-03

    Hey Cristian,

    First of all thanks for your response,
    I had changing my code for your suggestion, but looks like calc.init() was unreachable, because wrapper class started and then stopped without init Calc.

    Based on what you said about start method, I've decided to implements runnable Interface at Calc class. Then, Calc Thread wil be schedule by jvm and, and return of start method will be reachable. But my class stopped some seconds before its started.

    Any more ideas?

    If you have some example of a basic aplication, can you post here?

    STATUS | wrapper  | 2010/07/03 12:53:52 | -> Wrapper Started as Console
    STATUS | wrapper  | 2010/07/03 12:53:52 | Java Service Wrapper Community Edition 32-bit 3.4.1
    STATUS | wrapper  | 2010/07/03 12:53:52 |   Copyright (C) 1999-2010 Tanuki Software, Ltd.  All Rights Reserved.
    STATUS | wrapper  | 2010/07/03 12:53:52 |     http://wrapper.tanukisoftware.org
    STATUS | wrapper  | 2010/07/03 12:53:52 |
    STATUS | wrapper  | 2010/07/03 12:53:52 | Launching a JVM…
    INFO   | jvm 1    | 2010/07/03 12:53:53 | Start
    INFO   | jvm 1    | 2010/07/03 12:53:53 | WrapperManager: Initializing…
    INFO   | jvm 1    | 2010/07/03 12:53:53 | Stop
    INFO   | jvm 1    | 2010/07/03 12:53:53 | 9
    INFO   | jvm 1    | 2010/07/03 12:53:53 | 1
    INFO   | jvm 1    | 2010/07/03 12:53:53 | 20
    INFO   | jvm 1    | 2010/07/03 12:53:53 | 1
    INFO   | jvm 1    | 2010/07/03 12:53:54 | 7
    INFO   | jvm 1    | 2010/07/03 12:53:54 | 1
    INFO   | jvm 1    | 2010/07/03 12:53:54 | 12
    INFO   | jvm 1    | 2010/07/03 12:53:54 | 1
    STATUS | wrapper  | 2010/07/03 12:53:55 | <- Wrapper Stopped

    package com.test.test1;
    import org.tanukisoftware.wrapper.WrapperListener;
    import org.tanukisoftware.wrapper.WrapperManager;
    public class Main implements WrapperListener{
        private static Calc calc;
    
        public Main() {
        }
    
        private void init(){
            calc = new Calc();
            calc.setRunning(true);
            new Thread(calc).start();
        }
        public static void main(String[] args) throws InterruptedException {
            Main main = new Main();
            WrapperManager.start(main, args);
        }
        @Override
        public void controlEvent(int event) {
            if ( ( event == WrapperManager.WRAPPER_CTRL_LOGOFF_EVENT )
                    && ( WrapperManager.isLaunchedAsService() || WrapperManager.isIgnoreUserLogoffs() ) )
                {
                    // Ignore
                }
                else
                {
                    calc.setRunning(false);
                    WrapperManager.stop( 0 );
                    // Will not get here.
                }   
        }
        @Override
        public Integer start(String[] arg0) {
            init();
            return 1;
        }
        @Override
        public int stop(int event) {
            calc.setRunning(false);
            WrapperManager.stop(0);
            return event;
        }
    
    }
    package com.test.test1;
    public class Calc implements Runnable{
        private boolean running;
    
        public Calc(){
        }
        public int sum(int a, int b){
            return a+b;
        }
        public int sub(int a, int b){
            return a-b;
        }
        public int mul(int a, int b){
            return a*b;
        }
        public int div(int a, int b){
            return a/b;
        }
    
        public void setRunning(boolean running) {
            this.running = running;
        }
    
        public void init() throws InterruptedException {
            while(running) {
                int i = (int) (Math.random()*10);
                System.out.println(new Calc().sum(i,i-1));
                System.out.println(new Calc().sub(i,i-1));
                System.out.println(new Calc().mul(i,i-1));
                System.out.println(new Calc().div(i,i-1));
                Thread.sleep(1000);
            }
        }
        @Override
        public void run() {
            try {
                init();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    

    s, Alan

     
  • Leif Mortenson
    Leif Mortenson
    2010-07-03

    Alan,
    The JVM (Not the Wrapper) will start its shutdown process as soon as it detects that there are no running non-daemon threads.   It is possible that you have a timing issue on startup.   You should set your Calc.running flag within your Calc.run method.  That way it is only set when the thread is actually running.  Then add a call to make sure that your WrapperListener.start thread does not return until a Calc.isRunning thread returns true.  Multithreaded programs can be a pain with timing issues.

    Remember that for most applications, we usually recommend using the WrapperSimpleApp helper class to launch your application.  It takes care of all these issues.  Implementing a WrapperListener is for advanced implementations.

    Please let me know if you still have problems getting up and running.

    Cheers,
    Leif

     
  • Alan Prado
    Alan Prado
    2010-07-03

    Hey,
    I tried with method one, its work out.
    Thanks mortenson.
    s, Alan