|
From: Leif M. <lei...@ta...> - 2010-09-23 17:10:44
|
Mark, 1) The application is exiting right away when run from the command line because its main method simply returns. Java will shut itself down when there are no non-daemon threads running. 2) The install as a service looks fine. 3) The attempt to start the service is saying that the Service Manager is trying to start the Wrapper, but it does not respond that it has started up. Could you please send me your wrapper.conf, as well as the wrapper.log file when wrapper.debug=true is set? This should tell me what exactly is happening when you try to start the service. In most cases, you do not need to implement your own WrapperListener implementation. Most applications will work fine if launched using our WrapperSimpleApp helper class. Its use is described as Integration Method #1. This will let you get up and running without any Java code. Cheers, Leif On Thu, Sep 23, 2010 at 9:15 PM, GLOVER, MARK CSC <MAR...@ut...> wrote: > 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; > > } > > > > } |