|
From: Leif M. <lei...@ta...> - 2009-10-13 08:42:44
|
Riyaz,
Looking over your code, it appears to be written correctly with one
exception. The problem is that your MyWrapperApplication class does
not define its own main method. This means that it falls back to the
WrapperSimpleApp class's main method which creates a WrapperSimpleApp
instance, not a MyWrapperApplication instance.
Please add a method like the following to your class and it should
start working:
public static void main( String args[] )
{
new MyWrapperApplication( args );
}
Please let me know if you still have problems getting it work and I
will take another look.
Cheers,
Leif
On Mon, Oct 12, 2009 at 3:38 PM, Riyaz Saiyed <riy...@mi...> wrote:
>
> Hi,
>
> I tried extending WrapperSimpleApp to implement stop method and added some
> debugging statements. It seems to be not executing. What is the best way to
> implement shutdown hook?
>
> class:
> public class MyWrapperApplication extends WrapperSimpleApp
> {
> ....
> ....
> @Override
> public int stop ( int exitCode )
> {
> if ( logService.isInfoEnabled ( ) )
> {
> logService.info ( "Print Service Shutting down." );
> }
> return super.stop ( exitCode );
> }
> }
>
> configuration:
> #********************************************************************
> # Wrapper Properties
> #********************************************************************
> # Java Application
> wrapper.java.command=java
>
> # Java Main class. This class must implement the WrapperListener interface
> # or guarantee that the WrapperManager class is initialized. Helper
> # classes are provided to do this for you. See the Integration section
> # of the documentation for details.
> wrapper.java.mainclass=printservice.bootstrap.MyWrapperApplication
>
> # Java Classpath (include wrapper.jar) Add class path elements as
> # needed starting from 1
> wrapper.java.classpath.1=../wrapperLib/wrapper.jar
> wrapper.java.classpath.2=../applicationLib/*.jar
> wrapper.java.library.path.1=../wrapperLib
>
> # Java Library Path (location of Wrapper.DLL or libwrapper.so)
>
> # Java Additional Parameters
>
> # Initial Java Heap Size (in MB)
> #wrapper.java.initmemory=3
>
> # Maximum Java Heap Size (in MB)
> wrapper.java.maxmemory=64
>
>
> -----
> Regards,
> Riyaz..
|