I don't immediately see why this is happening but also don't see a
likely way out. One approach might be to write a couple classes that
are basically scripts that start the appropriate jar in a new vm.
thanks
david jencks
On May 30, 2007, at 5:03 AM, Joel Spotts wrote:
I should probably go into more detail the issue we are having:
We are wrapping Geronimo in a windows service using JavaService
(http://forge.objectweb.org/projects/javaservice/). It is similar
to Java Service Wrapper. You can specify the java class path as a
systme property when the application the service wraps startsup and
shuts down. You also provide the start class as well as optionally
the stop class. You can only provide one classpath -- to be used
for the start class as well as the stop class. So we configure the
start class as org.apache.geronimo.system.main.Daemon and for the
stop class: org.apache.geronimo.deployment.cli.StopServer. In order
for that stop method to be on the classpath we configure the
classpath as follows:
bin/server.jar;bin/shutdown.jar. If we leave out shutdown.jar, the
StopServer.jar is missing.
So far so good, and that works out ok, but here is the rub: hot
deployment will not work. We get the dreaded ClassNotFOundException:
Exception in thread "Geronimo hot deploy scanner"
java.lang.NoClassDefFoundError: org/apache/geronimo/deployment/
plugin/ConfigIDExtractor
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass
(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass
(MultiParentClassLoader.java:227)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass
(MultiParentClassLoader.java:227)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass
(MultiParentClassLoader.java:227)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at
org.apache.geronimo.deployment.hot.DirectoryMonitor.calculateModuleId(
DirectoryMonitor.java:358)
at org.apache.geronimo.deployment.hot.DirectoryMonitor.initialize
(DirectoryMonitor.java:230)
at org.apache.geronimo.deployment.hot.DirectoryMonitor.run
(DirectoryMonitor.java:206)
at java.lang.Thread.run(Thread.java:619)
There seems to be some sort of class loader clash.
Now, if we remove the server.jar from the classpath, hot deployment
works just fine, but of course we can't use the shutdown class
then. That prompted my original question. The JavaService states:
If no stop_class is specified, the process containing the Virtual
Machine is simply terminated when the service is stopped.
I do notice much less logging when removing the stop class, so it
seems like the shutdown hooks are not called.
So do I have any options to get both the shutdown hook and hot
deployment?
Thanks,
Yoel Spotts
<graycol.gif>
David Jencks <[EMAIL PROTECTED]>
David Jencks <[EMAIL PROTECTED]>
05/29/2007 07:18 PM
Please respond to
[email protected]
<ecblank.gif>
To
<ecblank.gif>
[email protected]
<ecblank.gif>
cc
<ecblank.gif>
<ecblank.gif>
Subject
<ecblank.gif>
Re: Safe shutdown
<ecblank.gif>
<ecblank.gif>
On May 29, 2007, at 3:09 PM, Mark Aufdencamp wrote:
I would guess this probably depends on your application, but it
doesnt sound like a good idea. I would think that an EJB container
would need to be able to safely complete transactions and passivate/
deallocate it's Beans particular CMP Entity Beans. The Web
container might also maintain Application scoped information that
needs a clean safe shutdown as well.
However, both the shutdown jar or console command and hitting ctrl-
c on your console have approximately the same effect in code --
calling the shutdown hook that stops and unloads all the running
configurations in reverse order of their starting. If your
application uses transactions properly any kind of shutdown
shouldn't result in data corruption, but you may lose partially
computed results in process. We don't make any attempt I'm aware
of to finish processing in flight requests before turning off a gbean.
thanks
david jencks
Mark Aufdencamp
[EMAIL PROTECTED]
-------- Original Message --------
Subject: Safe shutdown
From: Joel Spotts <[EMAIL PROTECTED]>
Date: Tue, May 29, 2007 5:05 pm
To: [email protected]
Is there any danger in stopping geronimo by simply killing the
application as opposed to running the shutdown.jar or shutdown.bat?
For various reasons (which I can get into if the answer is that it
is not safe) I cannot easily stop the server with the shutdown tool.
Thanks,
Yoel Spotts