|
From: Leif M. <le...@ta...> - 2008-02-12 03:28:26
|
Steven, Unfortunately no, this is not going to work as is. The Wrapper only monitors the JVM that it launches itself. One option would be to figure out the command line that your first JVM is generating to launch the second JVM. Then have the Wrapper launch it directly. The only other way to do this is to have your primary JVM wait until its child JVMS have completed. The problem is that when you start adding various failure modes, things are going to get complicated for you very quickly. It is pretty difficult for the Wrapper to try to monitor the child processes of the JVM it launches. There would need to be a way for it to figure out which ones should be waited for and which ones could be left running etc. What happens if it crashes rather than completing, etc, etc, etc. Cheers, Leif Steven A Moussa/MAXIMUS wrote: > > I just configured a wrapper for one of our java applications. Now when > I start it as a Windows service, everything starts just fine and our > java app runs and continues running. The problem is that the Windows > wrapper service stops (even though the app continues to run in the > background just fine). I believe that our programs spawns another java > window to run itself (when you run it manually or with the -c option) > which may be why the wrapper thinks it's not running. Does this all > make sense so far? My question is if our application opens up another > java window to run, is there any way for the wrapper to know all > processes that were spawned by the parent process so that it will > continue to show it as running as a Windows service? That is, without > editing the code itself? > > If it helps, I attached the end of the log: > > INFO | jvm 1 | 2008/02/11 11:54:32 | > INFO | jvm 1 | 2008/02/11 11:54:32 | > INFO | jvm 1 | 2008/02/11 11:54:32 | > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'service.rmi_server_registry.xml' (null/null), priority=16000 > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new RmiServerRegistry map (portal=null/null|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new RmiServerRegistry map > (portal=schoolmax/null|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new RmiServerRegistry map > (portal=schoolmax/teacher|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new RmiServerRegistry map > (portal=schoolmax/admin|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new RmiServerRegistry map > (portal=schoolmax/family|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new RmiServerRegistry map > (portal=schoolmax/substitute|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | Reloading > LifecycleEventRegistry > INFO | jvm 1 | 2008/02/11 11:54:32 | ********* Loading > LifecycleEventRegistry files > INFO | jvm 1 | 2008/02/11 11:54:32 | > LifecycleEventRegistryFactory.loadRegistryFiles: starting > INFO | jvm 1 | 2008/02/11 11:54:32 | **** Opening manifest > 'deployment-manifest.mf' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/code_registry.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/code_registry.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'code_registry.all.all.all.lifecycle_event_registry.xml' (null/null), > priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/default.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/default.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'default.all.all.all.lifecycle_event_registry.xml' (null/null), > priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/external.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/external.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'external.all.all.all.lifecycle_event_registry.xml' (null/null), > priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/minimum.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/minimum.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'minimum.all.all.all.lifecycle_event_registry.xml' (null/null), > priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/pageBuilder.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/pageBuilder.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'pageBuilder.all.all.all.lifecycle_event_registry.xml' (null/null), > priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/pagemgr_config.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/pagemgr_config.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'pagemgr_config.all.all.all.lifecycle_event_registry.xml' (null/null), > priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/rmi_server.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/rmi_server.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'rmi_server.all.all.all.lifecycle_event_registry.xml' (null/null), > priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/script.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/script.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'script.all.all.all.lifecycle_event_registry.xml' (null/null), priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/notification.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/notification.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'notification.all.all.all.lifecycle_event_registry.xml' (null/null), > priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': 'config/alerts.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': 'config/alerts.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'alerts.all.all.all.lifecycle_event_registry.xml' (null/null), priority=0 > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'all': > 'config/schoolmax/default.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | Config file for appserver > 'null': > 'config/schoolmax/default.all.all.all.lifecycle_event_registry.xml' > INFO | jvm 1 | 2008/02/11 11:54:32 | ---> Loading config file: > 'default.all.all.all.lifecycle_event_registry.xml' (schoolmax/null), > priority=50 > INFO | jvm 1 | 2008/02/11 11:54:32 | Portal schoolmax.datamgr not > supported, skipping > INFO | jvm 1 | 2008/02/11 11:54:32 | > config_root='D:/app/schoolmax/instance_root/SMAX_train/config_root' > INFO | jvm 1 | 2008/02/11 11:54:32 | > INFO | jvm 1 | 2008/02/11 11:54:32 | > INFO | jvm 1 | 2008/02/11 11:54:32 | > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new LifecycleEventRegistry map > (portal=null/null|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new LifecycleEventRegistry map > (portal=schoolmax/null|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new LifecycleEventRegistry map > (portal=schoolmax/teacher|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new LifecycleEventRegistry map > (portal=schoolmax/admin|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new LifecycleEventRegistry map > (portal=schoolmax/family|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | CACHED RESOURCE MANAGER ... > building new LifecycleEventRegistry map > (portal=schoolmax/substitute|overrideAll=true) > INFO | jvm 1 | 2008/02/11 11:54:32 | **************** DONE > RMISERVER Initializing cache manager ******************** > INFO | jvm 1 | 2008/02/11 11:54:32 | attempting to start server... > DEBUG | wrapperp | 2008/02/11 11:54:32 | send a packet PING : ping > INFO | jvm 1 | 2008/02/11 11:54:32 | Received a packet PING : ping > INFO | jvm 1 | 2008/02/11 11:54:32 | Send a packet PING : ok > INFO | jvm 1 | 2008/02/11 11:54:32 | Non-daemon thread count = 2 > - 1(system) = 1 > DEBUG | wrapperp | 2008/02/11 11:54:32 | read a packet PING : ok > DEBUG | wrapper | 2008/02/11 11:54:32 | Got ping response from JVM > INFO | jvm 1 | 2008/02/11 11:54:33 | SEVERE | rmimgr | 8889804 | > RMIServerFactory.getRemoteServer() - the server with the name > "rmi://localhost:1900/ServiceManager" doesn't appear to be running. > Attempting to startup. | Mon Feb 11 11:54:33 EST 2008 > DEBUG | wrapperp | 2008/02/11 11:54:37 | send a packet PING : ping > INFO | jvm 1 | 2008/02/11 11:54:37 | Received a packet PING : ping > INFO | jvm 1 | 2008/02/11 11:54:37 | Send a packet PING : ok > INFO | jvm 1 | 2008/02/11 11:54:37 | Non-daemon thread count = 2 > - 1(system) = 1 > DEBUG | wrapperp | 2008/02/11 11:54:37 | read a packet PING : ok > DEBUG | wrapper | 2008/02/11 11:54:37 | Got ping response from JVM > INFO | jvm 1 | 2008/02/11 11:54:40 | server started successfully! > INFO | jvm 1 | 2008/02/11 11:54:40 | attempting to start server... > INFO | jvm 1 | 2008/02/11 11:54:40 | server started successfully! > INFO | jvm 1 | 2008/02/11 11:54:40 | WrapperSimpleApp: main > method completed > DEBUG | wrapperp | 2008/02/11 11:54:41 | send a packet PING : ping > INFO | jvm 1 | 2008/02/11 11:54:41 | Received a packet PING : ping > INFO | jvm 1 | 2008/02/11 11:54:41 | Send a packet PING : ok > INFO | jvm 1 | 2008/02/11 11:54:41 | Non-daemon thread count = 1 > - 1(system) = 0 > INFO | jvm 1 | 2008/02/11 11:54:41 | All non-daemon threads have > stopped. Exiting. > INFO | jvm 1 | 2008/02/11 11:54:41 | WrapperManager.stop(0) > called by thread: Wrapper-Connection > INFO | jvm 1 | 2008/02/11 11:54:41 | Send a packet STOP : 0 > DEBUG | wrapperp | 2008/02/11 11:54:41 | read a packet PING : ok > DEBUG | wrapper | 2008/02/11 11:54:41 | Got ping response from JVM > DEBUG | wrapperp | 2008/02/11 11:54:41 | read a packet STOP : 0 > DEBUG | wrapper | 2008/02/11 11:54:41 | JVM requested a shutdown. (0) > DEBUG | wrapper | 2008/02/11 11:54:41 | wrapperStopProcess(0) called. > DEBUG | wrapper | 2008/02/11 11:54:41 | Sending stop signal to JVM > DEBUG | wrapperp | 2008/02/11 11:54:41 | send a packet STOP : NULL > INFO | jvm 1 | 2008/02/11 11:54:42 | Thread, Wrapper-Connection, > handling the shutdown process. > INFO | jvm 1 | 2008/02/11 11:54:42 | calling listener.stop() > INFO | jvm 1 | 2008/02/11 11:54:42 | WrapperSimpleApp: stop(0) > INFO | jvm 1 | 2008/02/11 11:54:42 | returned from listener.stop() > INFO | jvm 1 | 2008/02/11 11:54:42 | Send a packet STOPPED : 0 > DEBUG | wrapperp | 2008/02/11 11:54:42 | read a packet STOPPED : 0 > DEBUG | wrapper | 2008/02/11 11:54:42 | JVM signalled that it was > stopped. > INFO | jvm 1 | 2008/02/11 11:54:42 | Closing socket. > DEBUG | wrapperp | 2008/02/11 11:54:42 | socket read no code (closed?). > DEBUG | wrapperp | 2008/02/11 11:54:42 | server listening on port 32001. > INFO | jvm 1 | 2008/02/11 11:54:43 | calling System.exit(0) > DEBUG | wrapper | 2008/02/11 11:54:43 | JVM process exited with a > code of 0, leaving the wrapper exit code set to 0. > DEBUG | wrapper | 2008/02/11 11:54:43 | JVM exited normally. > STATUS | wrapper | 2008/02/11 11:54:44 | <-- Wrapper Stopped > STATUS | wrapper | 2008/02/11 11:55:47 | The rmiserver Service is > installed. > STATUS | wrapper | 2008/02/11 11:55:47 | Start Type: Manual > STATUS | wrapper | 2008/02/11 11:55:47 | Interactive: No > STATUS | wrapper | 2008/02/11 11:55:47 | Running: No > > Thanks in advance |