|
From: Leif M. <le...@ta...> - 2003-10-28 03:31:46
|
Jimmy,
From the error message, by guess is that the java executable is not
being found
when run as a service. The way to quickly solve problems like this is
to set the
wrapper.debug=true property and attempt to start your service again.
In most
cases, it will then be obvious what the problem is. If you could post
the resulting
DEBUG output from a single invocation of the Wrapper, I should be able to
tell you what the problem is.
Make sure that the JAVA_HOME and JWrapperPath environment variables
have been defined as system level environment variables.
Cheers,
Leif
Jimmy Chu wrote:
>Hi,
>
>I followed the example of implementing the wrapperListener interface. I
>tested it first in console mode and experienced no problem (The wrapper
>created the instance, started it, and finally stopped it). Then I
>registered it as service using -i flag and started it using the -t flag.
>But when I started the service, it gave me the error message of:
>
>wrapper | Starting the Jimmy Chu Sample Application service...
>wrapper | The Jimmy Chu Sample Application service was launched, but
>failed to
>start.
>
>Any help is greatly appreciated!
>
>My sample app. is as followed:
>
>//========== myApp.java =====================
>import org.tanukisoftware.wrapper.WrapperManager;
>import org.tanukisoftware.wrapper.WrapperListener;
>
>public class myApp implements WrapperListener {
>
> public myApp() {
> System.out.println("Creating me...");
> }
>
> public Integer start( String[] args ) {
> System.out.println("I am starting");
> return null;
> }
>
> public int stop( int exitCode ) {
> System.out.println("I am stopping");
> return exitCode;
> }
>
> public void controlEvent( int event )
> {
> if (WrapperManager.isControlledByNativeWrapper()) {
> // The Wrapper will take care of this event
> } else {
> // We are not being controlled by the Wrapper, so
> // handle the event ourselves.
> if ((event == WrapperManager.WRAPPER_CTRL_C_EVENT) ||
> (event == WrapperManager.WRAPPER_CTRL_CLOSE_EVENT) ||
> (event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT)){
> WrapperManager.stop(0);
> }
> }
> }
>
> public static void main(String[] args) {
> WrapperManager.start( new myApp(), args);
> }
>}
>
>#==============wrapper.conf===================
>wrapper.java.command=%JAVA_HOME%/bin/java
>wrapper.java.mainclass=myApp
>wrapper.java.classpath.1=./wrapper.jar
>wrapper.java.classpath.2=.
>wrapper.java.library.path.1=%JWrapperPath%/lib
>wrapper.java.initmemory=3
>wrapper.java.maxmemory=64
>
>wrapper.ntservice.name=TESTINGMYAPP
>wrapper.ntservice.displayname=Jimmy Chu Sample Application
>wrapper.ntservice.description=Jimmy Chu Service Description
>
>Jimmy Chu
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: The SF.net Donation Program.
>Do you like what SourceForge.net is doing for the Open
>Source Community? Make a contribution, and help us add new
>features and functionality. Click here: http://sourceforge.net/donate/
>_______________________________________________
>Wrapper-user mailing list
>Wra...@li...
>https://lists.sourceforge.net/lists/listinfo/wrapper-user
>
>
>
|