That does not seem to be a sensible reason/place to throw an exception.

Chuck


From: <[email protected]> on behalf of 
Paul Hoadley <[email protected]>
Date: Wednesday, July 13, 2016 at 12:52 AM
To: Ted Archibald <[email protected]>
Cc: WebObjects Apple Dev <[email protected]>
Subject: Re: Instance won't shutdown with ERJGroupsSynchronizer

Hi Ted,

Excavating this from the archives:

On 1 Dec 2013, at 8:28 AM, Ted Archibald 
<[email protected]<mailto:[email protected]>> wrote:

I've been having a bug where an instance won't shutdown (caveat: I haven't 
updated wonder in 2 years for fear of breaking stuff...)

The stack trace points to an error in 
ERXObjectStoreCoordinatorSynchronizer$ProcessChangesQueue.stop "Attempted to 
stop the ProcessChangesQueue when it wasn't already running".  I don't really 
care about that error, I just want the instance to shut down, but this stops 
the normal shutdown process.

Any ideas?

…

Caused by: java.lang.IllegalStateException: Attempted to stop the 
ProcessChangesQueue when it wasn't already running
        at 
er.extensions.eof.ERXObjectStoreCoordinatorSynchronizer$ProcessChangesQueue.stop(ERXObjectStoreCoordinatorSynchronizer.java:618)
        at 
er.extensions.eof.ERXObjectStoreCoordinatorSynchronizer.stopRemoteSynchronizer(ERXObjectStoreCoordinatorSynchronizer.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
        at 
com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588)
        at 
com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532)
        at 
com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546)
        at 
er.extensions.appserver.ERXApplication.terminate(ERXApplication.java:2733)
        at 
com.webobjects.appserver.WOApplication._terminateFromMonitor(WOApplication.java:3607)
        at 
com.webobjects.appserver.WOAdminAction.instanceRequestAction(WOAdminAction.java:96)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
com.webobjects.appserver.WODirectAction.performActionNamed(WODirectAction.java:144)
        at 
com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:259)

I’ve just seen this as well, though I can’t reliably reproduce it. In any case, 
modulo some line number changes, this is the code:

public void stop() {
if (_queueThread != null && _queueThread.isAlive()) {
_running = false;
_queueThread.interrupt();
}
else {
throw new IllegalStateException("Attempted to stop the " + 
getClass().getSimpleName() + " when it wasn't already running");
}
}

Unfortunately the original author is long gone, but I’m not seeing the 
rationale for throwing an exception here. This is being called when 
ERXApplication.ApplicationWillTerminateNotification is posted. If _queueThread 
is null or not alive, couldn’t we just do nothing and log it? There’s nothing 
catching this exception, and it goes on to prevent termination, as Ted notes. 
Does anyone have any thoughts on this?


--
Paul Hoadley
http://logicsquad.net/




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to