|
From: Leif M. <le...@ta...> - 2003-08-06 02:25:55
|
Anakreon,
The Wrapper is detecting that there are no non-daemon threads still
running
and deciding that your application is ready to exit. This is exactly
how Java
works when run without the Wrapper. When run without the Wrapper, the JVM
will exit as soon as the last non-daemon thread has completed.
The Wrapper has to do its own thread counting to emulate the way Java
normally works because the Wrapper has its own non-daemon thread running.
When your WrapperListener.start method returns are you sure that you
have
any other threads running? If so verify that they do not have their
daemon flag
set.
You should be getting the same behavior whether you are running as a
service or as a console app. If you can't figure it out, let me know
what the error
is that you are getting when running as a service.
Cheers,
Leif
Anakreon Mejdi wrote:
> Hello all.
> In order to integrate the wrapper to my application I am using the
> last method, and implemented WrapperListener.
> When starting the application from console
> (Wrapper.exe -c C:\code\java\xrisima\config\wrapper.properties)
> and log level to debug I get this output:
> wrapper | --> Wrapper Started as Console
> wrapper | Launching a JVM...
> jvm 1 | Wrapper Manager: JVM #1
> jvm 1 | Wrapper Manager: Registering shutdown hook
> jvm 1 | Wrapper Manager: Using wrapper
> jvm 1 | Calling native initialization method.
> jvm 1 | Initializing WrapperManager native library.
> jvm 1 | Java Executable: c:\j2sdk1.4.0_01\bin\java.exe
> jvm 1 | Java Version : 1.4.0_01-b03 Java HotSpot(TM) Client VM
> jvm 1 | Java VM Vendor : Sun Microsystems Inc.
> jvm 1 |
> jvm 1 | Wrapper (Version 3.0.0)
> jvm 1 |
> jvm 1 | Open socket to wrapper...
> jvm 1 | Opened Socket
> jvm 1 | Send a packet 110 : O1XpGyFt63WDCMnQ
> jvm 1 | handleSocket(Socket[addr=/127.0.0.1,port=1777,localport=2128])
> jvm 1 | Received a packet 112 : 1
> jvm 1 | Wrapper Manager: LowLogLevel from Wrapper is 1
> jvm 1 | Received a packet 100 : start
> jvm 1 | calling listener.start()
> jvm 1 | returned from listener.start()
> jvm 1 | Send a packet 106 :
> jvm 1 | All non-daemon threads have stopped. Exiting.
> jvm 1 | Send a packet 101 : 0
> jvm 1 | Thread, Wrapper-Connection, handling the shutdown process.
> jvm 1 | calling listener.stop()
> jvm 1 | returned from listener.stop()
> jvm 1 | Send a packet 107 : 0
> jvm 1 | Closing socket.
> jvm 1 | calling System.exit(0)
> wrapper | <-- Wrapper Stopped
>
> Have I forgot something in the implementation of WrapperListener?
> What should I do to prevent wrapper from stoping?
>
> When I try to run the application from the services, an error message is
> displayd.But at the moment I am concerned in the console version.
>
> Thanks in advanced, Anakreon.
>
|