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,354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mysql jsp example issue 32 75
glassfish admin console 1 23
junit as external jar or library 7 40
What browser will run Java? 7 128
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

726 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