|
From: Larry S. Jr. <la...@gm...> - 2009-01-15 22:58:19
|
I am trying to subclass WrapperSimpleApp and running into problems. I
have read the javadoc where it says it is possible and to make sure
any overridden method calls the super method. I have done that, and it
still is not working the way I want it.
Here is a stripped down example:
package test;
import org.tanukisoftware.wrapper.WrapperSimpleApp;
public class Test extends WrapperSimpleApp {
protected Test(String[] args) {
super(args);
}
public Integer start(String[] args) {
System.out.println("I should see this in the output!");
return super.start(args);
}
}
In my wrapper.conf file:
wrapper.java.mainclass=test.Test
And I include the jar in the wrapper.java.classpath array.
The wrapper starts up, and runs fine as a service and from the
console, but I never see the System.out.println statement in the log
(or on the console). I tried DEBUG log level as well.
If I copy ALL of the source code of WrapperSimpleApp and modify where
necessary (class names, and copy over the WrapperPrintStream), and
enter my System.out.println's where I need them, it works then.
It seems that the WrapperManager (or whatever calls the start (or any
of the other methods subclassed from WrapperSimpleApp) never get
called on my subclass.
Is the javadoc just wrong on the code, and the class cannot be
subclassed, or are there some hoops you have to jump through?
-- Larry
|