|
From: Leif M. <le...@ta...> - 2004-06-15 13:29:33
|
Tim,
I am not sure what the second line of the stack trace is? Did you
copy it straight
from the log? There is no way that the
WrapperManager.isControlledByNativeWrapper
method could be throwing an NPE. But I don't think that is what this
stack trace
is showing anyway.
Error in WrapperListener.stop callback. java.lang.NullPointerException
java.lang.NullPointerExceptionisControlledByNativeWrapper
at
com.lmco.itis.fis.server.ApplicationMain.stopServer(ApplicationMain.java:26)
at MainWrapper.stop(MainWrapper.java:61)
<snip>
This looks like your ApplicationMain.stopServer method is throwing a NPE
on line 26? This is your code isn't it?
From what I can see, the Wrapper is catching and reporting this problem
correctly.
Let me know if I am missing something.
Cheers,
Leif
Cobble, Tim wrote:
> All,
>
>
>
> Using the integration method of the wrapper. Attempting to call
> custom code in the stop method. Errors received.
>
>
>
> I know I am calling into my custom code due to the console output of
> "Calling pauseServer" But I am not able to stop the threads,
> something bails out. This is existing code that I know works, just
> calling it from the wrapper.
>
>
>
> Pasting Code, and Errors from both the console output and the log file.
>
>
>
> Any help would be most appreciated!!!!
>
>
>
> Tim
>
>
>
> C O D E
>
> ------------------------------------------------------------------------------------------------------------------------------
>
> import org.tanukisoftware.wrapper.WrapperManager;
> import org.tanukisoftware.wrapper.WrapperListener;
> import com.lmco.itis.fis.server.*;
>
> public class MainWrapper
> implements WrapperListener
> {
> private ApplicationMain m_app;
>
>
>
> /*---------------------------------------------------------------
> * Constructors
> *-------------------------------------------------------------*/
> private MainWrapper()
> {
> }
>
>
>
> /*---------------------------------------------------------------
> * WrapperListener Methods
> *-------------------------------------------------------------*/
> public Integer start( String[] args )
> {
> m_app = new ApplicationMain();
> m_app.main(args);
> //_m_app.start_ <file:///%5C%5Cm_app.start>();
>
>
>
> return null;
> }
>
>
>
> /**
> *
> * @param exitCode The suggested exit code that will be
> retJ4RcuQ71YLurned to the OS
> * when the JVM exits.
> *
> * @return The exit code to actually return to the OS. In most
> cases, this
> * should just be the value of exitCode, however the user
> code has
> * the option of changing the exit code if there are any
> problems
> * during shutdown.
> */
> public int stop( int exitCode )
> {
> System.out.println("The Stop Method Got Called.");
> WrapperManager.signalStopping(60000);
> m_app.stopServer();
>
> return exitCode;
> }
>
> /**
> * Called whenever the native wrapper code traps a system control
> signal
> * against the Java process. It is up to the callback to take
> any actions
> * necessary. Possible values are:
> WrapperManager.WRAPPER_CTRL_C_EVENT,
> * WRAPPER_CTRL_CLOSE_EVENT, WRAPPER_CTRL_LOGOFF_EVENT, or
> * WRAPPER_CTRL_SHUTDOWN_EVENT
> *
> * @param event The system control signal.
> */
> public void controlEvent( int event )
> {
> if (WrapperManager.isControlledByNativeWrapper())
> {
> // The Wrapper will take care of this event
> System.out.println("isControlledByNativeWrapper");
> WrapperManager.stop(0);
> }
> 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))
> {
> System.out.println("In the wrapper_ctrl block");
> WrapperManager.stop(0);
> }
> }
> }
>
> /*---------------------------------------------------------------
> * Main Method
> *-------------------------------------------------------------*/
> public static void main( String[] args )
> {
> WrapperManager.start( new MainWrapper(), args );
> }
> }
>
>
>
>
>
>
>
> L O G
>
> ------------------------------------------------------------------------------------------------------------------------------
>
> STATUS | wrapper | 2004/06/15 08:12:45 | --> Wrapper Started as Console
> STATUS | wrapper | 2004/06/15 08:12:45 | Launching a JVM...
> INFO | jvm 1 | 2004/06/15 08:12:47 | Wrapper (Version 3.1.0)
> _http://wrapper.tanukisoftware.org_
> INFO | jvm 1 | 2004/06/15 08:12:47 |
> STATUS | wrapper | 2004/06/15 08:17:26 | CTRL-C trapped. Shutting down.
> INFO | jvm 1 | 2004/06/15 08:17:26 | The Stop Method Got Called.
> INFO | jvm 1 | 2004/06/15 08:17:26 | Calling pauseServer
> INFO | jvm 1 | 2004/06/15 08:17:26 | Error in
> WrapperListener.stop callback. java.lang.NullPointerException
> INFO | jvm 1 | 2004/06/15 08:17:26 |
> java.lang.NullPointerExceptionisControlledByNativeWrapper
> INFO | jvm 1 | 2004/06/15 08:17:26 |
> INFO | jvm 1 | 2004/06/15 08:17:26 | at
> com.lmco.itis.fis.server.ApplicationMain.stopServer(ApplicationMain.java:26)
> INFO | jvm 1 | 2004/06/15 08:17:26 | at
> MainWrapper.stop(MainWrapper.java:61)
> INFO | jvm 1 | 2004/06/15 08:17:26 | at
> org.tanukisoftware.wrapper.WrapperManager.stopInner(WrapperManager.java:1903)
> INFO | jvm 1 | 2004/06/15 08:17:26 | at
> org.tanukisoftware.wrapper.WrapperManager.handleSocket(WrapperManager.java:2312)
> INFO | jvm 1 | 2004/06/15 08:17:26 | at
> org.tanukisoftware.wrapper.WrapperManager.run(WrapperManager.java:2602)
> INFO | jvm 1 | 2004/06/15 08:17:26 | at
> java.lang.Thread.run(Thread.java:536)
> STATUS | wrapper | 2004/06/15 08:17:27 | <-- Wrapper Stopped
>
>
>
>
>
>
>
>
>
> C O N S O L E
>
> ------------------------------------------------------------------------------------------------------------------------------
>
> wrapper | --> Wrapper Started as Console
> wrapper | Launching a JVM...
> jvm 1 | Wrapper (Version 3.1.0) _http://wrapper.tanukisoftware.org_
> jvm 1 |
> wrapper | CTRL-C trapped. Shutting down.
> jvm 1 | The Stop Method Got Called.
> jvm 1 | Calling pauseServer
> jvm 1 | Error in WrapperListener.stop callback.
> java.lang.NullPointerException
> jvm 1 | java.lang.NullPointerExceptionisControlledByNativeWrapper
> jvm 1 |
> jvm 1 | at
> com.lmco.itis.fis.server.ApplicationMain.stopServer(ApplicationMain.java:26)
> jvm 1 | at MainWrapper.stop(MainWrapper.java:61)
> jvm 1 | at
> org.tanukisoftware.wrapper.WrapperManager.stopInner(WrapperManager.java:1903)
> jvm 1 | at
> org.tanukisoftware.wrapper.WrapperManager.handleSocket(WrapperManager.java:2312)
> jvm 1 | at
> org.tanukisoftware.wrapper.WrapperManager.run(WrapperManager.java:2602)
> jvm 1 | at java.lang.Thread.run(Thread.java:536)
> wrapper | <-- Wrapper Stopped
> Terminate batch job (Y/N)?
>
|