[jboss-user] [Installation, Configuration & Deployment] - Re: JBoss 4.0.5 Appserver running as a service shutsdown

vamsin do-not-reply at jboss.com
Wed Mar 21 10:30:09 EDT 2007


I fixed it like this:
--------------------------------------------------------------------------
1. create a JNI util dll for windows with one call:

BOOL WINAPI ConsoleCtrlHandler(DWORD dwCtrlType)
{
   if (dwCtrlType == CTRL_LOGOFF_EVENT)
      return TRUE; // ignore this signal and don't pass it on

   return FALSE; // pass it on
}

JNIEXPORT void JNICALL Java_xxx_setConsoleCtrlHandler(JNIEnv *env, jclass jcl)
{
	SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE);
	return;
}
--------------------------------------------------------------------------
2. load this native library in my app's init()
2.a System.loadLibrary(name);
         to do this: add -Djava.library.path option to your startup
2.b set the handler using the JNI call:
      FOO.jniSetConsoleCtrlHandler();
--------------------------------------------------------------------------



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030248#4030248

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030248



More information about the jboss-user mailing list