|
From: GLOVER, M. C. <MAR...@UT...> - 2010-09-23 12:43:34
|
Hi, Using wrapper-windows-x86-32-3.5.4 on XP Professional. An application 'Main' executes, then exits when run from the command line. The application will successfully install and uninstall as a service. The application will fail to run as a service with error expression 'The service is not responding to the control function'. Any Suggestions? Command Line C:\wrapper-windows\MainApp\bin>wrapper.exe -c ..\conf\wrapper.conf wrapper | --> Wrapper Started as Console wrapper | Java Service Wrapper Community Edition 32-bit 3.5.4 wrapper | Copyright (C) 1999-2010 Tanuki Software, Ltd. All Rights Reserved. wrapper | http://wrapper.tanukisoftware.com wrapper | wrapper | Launching a JVM... jvm 1 | WrapperManager: Initializing... jvm 1 | [MyApp Constructor] We're here! We're Here! WE'RE HERE! jvm 1 | [MyApp Stop] We're here! We're Here! WE'RE HERE! wrapper | <-- Wrapper Stopped Installing as Service C:\wrapper-windows\MainApp\bin>InstallMainApp-NT.bat wrapper | MarkTestWrapperApp service installed. ---------------------------------------------- Running as Service - FAILURE C:\wrapper-windows\MainApp\bin>net start MarkTestWrapperApp The service is not responding to the control function. More help is available by typing NET HELPMSG 2186. Source Code for MAIN application import org.tanukisoftware.wrapper.WrapperManager; import org.tanukisoftware.wrapper.WrapperListener; public class Main implements WrapperListener { private MyApp m_app; private Main() { } /*--------------------------------------------------------------- * WrapperListener Methods *-------------------------------------------------------------*/ public Integer start( String[] args ) { m_app = new MyApp( args ); WrapperManager.signalStarting( 6543 ); return null; } public int stop( int exitCode ) { m_app.stop(); return exitCode; } public void controlEvent( int event ) { if ( ( event == WrapperManager.WRAPPER_CTRL_LOGOFF_EVENT ) && ( WrapperManager.isLaunchedAsService() || WrapperManager.isIgnoreUserLogoffs() ) ) { // Ignore } else { WrapperManager.stop( 0 ); // Will not get here. } } /*--------------------------------------------------------------- * Main Method *-------------------------------------------------------------*/ public static void main( String[] args ) { WrapperManager.start( new Main(), args ); } } MyApp Source code; public class MyApp { public MyApp(String [] args){ System.out.println("[MyApp Constructor] We're here! We're Here! WE'RE HERE!"); } public static void main(String [] args){ System.out.println("[MyApp main] We're here! We're Here! WE'RE HERE!"); } public Integer start(){ System.out.println("[MyApp Start]We're here! We're Here! WE'RE HERE!"); return null; } public int stop(){ System.out.println("[MyApp Stop] We're here! We're Here! WE'RE HERE!"); return 0; } } Mark Glover UTC Power 195 Governors Highway South Windsor CT 06074 860 727 2253 |