Solved

tanukisoftware - 1053: The service did not respond to the start or control request in a timely fashion.

Posted on 2009-04-14
11
1,347 Views
Last Modified: 2012-05-06
Hi,

I am installing my simple Java application using tanukisoftware

It installs great my application as windows services and I can see my application in windows services

But When I start my windows service. I get the error

Could not start the test Timer service on Local Computer
1053: The service did not respond to the start or control request in a timely fashion.


And when I run it as a consle . I get the error below

Also, Please see my code in code snippet area and I am attaching my conf file with extension as .txt


ERROR:

wrapper  | --> Wrapper Started as Console
wrapper  | Java Service Wrapper Community Edition 3.3.3
wrapper  |   Copyright (C) 1999-2009 Tanuki Software, Ltd.  All Rights Reserved.

wrapper  |     http://wrapper.tanukisoftware.org
wrapper  |
wrapper  | Launching a JVM...
jvm 1    | I am running
jvm 1    | I am running
jvm 1    | I am running
wrapper  | Startup failed: Timed out waiting for a signal from the JVM.
wrapper  |
wrapper  | ---------------------------------------------------------------------
---
wrapper  | Advice:
wrapper  | The Wrapper consists of a native component as well as a set of classe
s
wrapper  | which run within the JVM that it launches.  The Java component of the

wrapper  | Wrapper must be initialized promptly after the JVM is launched or the

wrapper  | Wrapper will timeout, as just happened.  Most likely the main class
wrapper  | specified in the Wrapper configuration file is not correctly initiali
zing
wrapper  | the Wrapper classes:
wrapper  |     TimerTest
wrapper  | While it is possible to do so manually, the Wrapper ships with helper

wrapper  | classes to make this initialization processes automatic.
wrapper  | Please review the integration section of the Wrapper's documentation
wrapper  | for the various methods which can be employed to launch an applicatio
n
wrapper  | within the Wrapper:
wrapper  |     http://wrapper.tanukisoftware.org/doc/english/integrate.html
wrapper  | ---------------------------------------------------------------------
---


Please Guide

Many Thanks
import java.util.Timer;

import java.util.TimerTask;

import java.io.BufferedWriter;

import java.io.FileWriter;

import java.text.SimpleDateFormat;

import java.util.Calendar;

import java.util.Random;

//import System.Threading;

 

 

public class TimerTest {

 

	public static

	void main(String[] args)

	throws Exception

	{

 

 

		int initialDelay = 5000;

	    int interval = 1000;

 

		Timer timer = new Timer();

		timer.schedule(new TimerTask()

		{

		    public void run()

		    {

		        System.out.println("I am running");

		        try

		        {

		    	    TimerTest.createFile();

		    	    Thread.sleep(10000);

				}catch(Exception ex)

				{

				}

		    }

 

 

 

		}, initialDelay, interval);

 

	}

 

 

	public static void createFile()

	            throws Exception

	    {

			String strFilename = "C:\\java\\schedular\\hello.txt";

			Calendar cal = Calendar.getInstance();

		    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy-Hmmss");

 

		    Random generator = new Random();

		    String DateIs = sdf.format(cal.getTime());

 

        String strUniqueReference = String.valueOf(generator.nextInt())+DateIs;

 

 

	        BufferedWriter bufferedWriter = null;

 

	        bufferedWriter = new BufferedWriter(new FileWriter(strFilename));

 

	        bufferedWriter.write(strUniqueReference);

 

	        if (bufferedWriter != null)

	        {

	            bufferedWriter.flush();

	            bufferedWriter.close();

	        }

    }

}

Open in new window

wrapperconf.txt
0
Comment
Question by:tia_kamakshi
  • 6
  • 5
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 24137500
You are ignoring exceptions which won't help at all. printStackTrace throughout and don't throw Exception from main
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24138596
Also, you should use logging, particularly with an application like this which runs in the background
0
 

Author Comment

by:tia_kamakshi
ID: 24140125
Many Thanks for your reply.

I have removed throws exception from main

Still same Exception

Not sure, I have just seen, May be I have to do something like this

http://wrapper.tanukisoftware.org/doc/english/integrate-listener.html

Anyway, right now my updated code is:

public static
      void main(String[] args)
      {


            int initialDelay = 5000;
          int interval = 1000;

            Timer timer = new Timer();
            timer.schedule(new TimerTask()
            {
                public void run()
                {
                    System.out.println("I am running");
                    try
                    {
                          TimerTest.createFile();
                          Thread.sleep(10000);
                        }catch(Exception ex)
                        {
                        }
                }



            }, initialDelay, interval);

      }
STATUS | wrapper  | 2009/04/14 17:38:10 | --> Wrapper Started as Console

STATUS | wrapper  | 2009/04/14 17:38:10 | Java Service Wrapper Community Edition 3.3.3

STATUS | wrapper  | 2009/04/14 17:38:10 |   Copyright (C) 1999-2009 Tanuki Software, Ltd.  All Rights Reserved.

STATUS | wrapper  | 2009/04/14 17:38:10 |     http://wrapper.tanukisoftware.org

STATUS | wrapper  | 2009/04/14 17:38:10 | 

STATUS | wrapper  | 2009/04/14 17:38:11 | Launching a JVM...

INFO   | jvm 1    | 2009/04/14 17:38:16 | I am running

INFO   | jvm 1    | 2009/04/14 17:38:26 | I am running

INFO   | jvm 1    | 2009/04/14 17:38:36 | I am running

ERROR  | wrapper  | 2009/04/14 17:38:43 | Startup failed: Timed out waiting for a signal from the JVM.

ADVICE | wrapper  | 2009/04/14 17:38:43 | 

ADVICE | wrapper  | 2009/04/14 17:38:43 | ------------------------------------------------------------------------

ADVICE | wrapper  | 2009/04/14 17:38:43 | Advice:

ADVICE | wrapper  | 2009/04/14 17:38:43 | The Wrapper consists of a native component as well as a set of classes

ADVICE | wrapper  | 2009/04/14 17:38:43 | which run within the JVM that it launches.  The Java component of the

ADVICE | wrapper  | 2009/04/14 17:38:43 | Wrapper must be initialized promptly after the JVM is launched or the

ADVICE | wrapper  | 2009/04/14 17:38:43 | Wrapper will timeout, as just happened.  Most likely the main class

ADVICE | wrapper  | 2009/04/14 17:38:43 | specified in the Wrapper configuration file is not correctly initializing

ADVICE | wrapper  | 2009/04/14 17:38:43 | the Wrapper classes:

ADVICE | wrapper  | 2009/04/14 17:38:43 |     TimerTest

ADVICE | wrapper  | 2009/04/14 17:38:43 | While it is possible to do so manually, the Wrapper ships with helper

ADVICE | wrapper  | 2009/04/14 17:38:43 | classes to make this initialization processes automatic.

ADVICE | wrapper  | 2009/04/14 17:38:43 | Please review the integration section of the Wrapper's documentation

ADVICE | wrapper  | 2009/04/14 17:38:43 | for the various methods which can be employed to launch an application

ADVICE | wrapper  | 2009/04/14 17:38:43 | within the Wrapper:

ADVICE | wrapper  | 2009/04/14 17:38:43 |     http://wrapper.tanukisoftware.org/doc/english/integrate.html

ADVICE | wrapper  | 2009/04/14 17:38:43 | ------------------------------------------------------------------------

ADVICE | wrapper  | 2009/04/14 17:38:43 | 

ERROR  | wrapper  | 2009/04/14 17:38:43 | JVM did not exit on request, terminated

STATUS | wrapper  | 2009/04/14 17:38:48 | Launching a JVM...

INFO   | jvm 2    | 2009/04/14 17:38:53 | I am running

INFO   | jvm 2    | 2009/04/14 17:39:04 | I am running

INFO   | jvm 2    | 2009/04/14 17:39:14 | I am running

ERROR  | wrapper  | 2009/04/14 17:39:20 | Startup failed: Timed out waiting for a signal from the JVM.

ADVICE | wrapper  | 2009/04/14 17:39:20 | 

ADVICE | wrapper  | 2009/04/14 17:39:20 | ------------------------------------------------------------------------

ADVICE | wrapper  | 2009/04/14 17:39:20 | Advice:

ADVICE | wrapper  | 2009/04/14 17:39:20 | The Wrapper consists of a native component as well as a set of classes

ADVICE | wrapper  | 2009/04/14 17:39:20 | which run within the JVM that it launches.  The Java component of the

ADVICE | wrapper  | 2009/04/14 17:39:20 | Wrapper must be initialized promptly after the JVM is launched or the

ADVICE | wrapper  | 2009/04/14 17:39:20 | Wrapper will timeout, as just happened.  Most likely the main class

ADVICE | wrapper  | 2009/04/14 17:39:20 | specified in the Wrapper configuration file is not correctly initializing

ADVICE | wrapper  | 2009/04/14 17:39:20 | the Wrapper classes:

ADVICE | wrapper  | 2009/04/14 17:39:20 |     TimerTest

ADVICE | wrapper  | 2009/04/14 17:39:20 | While it is possible to do so manually, the Wrapper ships with helper

ADVICE | wrapper  | 2009/04/14 17:39:20 | classes to make this initialization processes automatic.

ADVICE | wrapper  | 2009/04/14 17:39:20 | Please review the integration section of the Wrapper's documentation

ADVICE | wrapper  | 2009/04/14 17:39:20 | for the various methods which can be employed to launch an application

ADVICE | wrapper  | 2009/04/14 17:39:20 | within the Wrapper:

ADVICE | wrapper  | 2009/04/14 17:39:20 |     http://wrapper.tanukisoftware.org/doc/english/integrate.html

ADVICE | wrapper  | 2009/04/14 17:39:20 | ------------------------------------------------------------------------

ADVICE | wrapper  | 2009/04/14 17:39:20 | 

ERROR  | wrapper  | 2009/04/14 17:39:20 | JVM did not exit on request, terminated

STATUS | wrapper  | 2009/04/14 17:39:23 | CTRL-C trapped.  Shutting down.

STATUS | wrapper  | 2009/04/14 17:39:23 | <-- Wrapper Stopped

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24140142
You're still ignoring exceptions
0
 

Author Comment

by:tia_kamakshi
ID: 24146007
Hi,

Many Thanks for your reply.

I am trying to add wrapper as suggested in documentation of tanukisoftware

I have created a Main.java file, from that I am trying to call my TimerTest.java file

But I am getting the exception

C:\java\schedular\app\Main.java:33: cannot find symbol
symbol  : constructor TimerTest(java.lang.String[])
location: class TimerTest
        m_app = new TimerTest( args );
                ^
C:\java\schedular\app\Main.java:34: cannot find symbol
symbol  : method start()
location: class TimerTest
        m_app.start();
             ^
C:\java\schedular\app\Main.java:57: cannot find symbol
symbol  : method stop()
location: class TimerTest
        m_app.stop();
             ^
3 errors

Tool completed with exit code 1

Please help me in fixing it

Many Thanks for yoour co-operation


Mainjava.txt
TimerTestjava.txt
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 24147166
>>m_app = new TimerTest( args );

You don't have a constructor for TimerTest that takes a String array, but you attempt to call one
0
 

Author Comment

by:tia_kamakshi
ID: 24147455
Thanks for your reply.

Isn't it method public TimerTest(String[] args)  is constructor in my TimerTest.java

I  was compiling Main.java, When I get this error.

Please guide me to fix this

Many Thanks



public TimerTest(String[] args)

	{

			System.out.println("I am in constructor");
 

			try

					{

						int initialDelay = 5000;

				    	int interval = 1000;
 

						Timer timer = new Timer();

						timer.schedule(new TimerTask()

						{

						    public void run()

						    {

						        System.out.println("I am running");

						        try

						        {

						    	    TimerTest.createFile();

						    	    Thread.sleep(10000);

								}catch(Exception ex)

								{

									System.out.println("Exception occurs1: "+ex.toString());

								}

						    }

						}, initialDelay, interval);

					}catch(Exception ex2)

					{

						System.out.println("Exception occurs2: "+ex2.toString());

		}

	}

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24147657
It is *now* yes ;-) It wasn't originally in your first posting
0
 

Author Comment

by:tia_kamakshi
ID: 24147915
Many Thanks, It works great now.

It was picking my class file from classpath.

Therefore not picking the updated file

It works great now.

Many Many Thanks for all your help
0
 

Author Closing Comment

by:tia_kamakshi
ID: 31569827
Many Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24148206
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Eclipse Neon and jdk 1.8.0 11 126
base64 decode encode 12 119
VB Script to add site to Java Exception List 4 48
print map entry 34 54
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now