Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344002

Summary: AssertionFailed during shutdown of Eclipse
Product: [WebTools] WTP ServerTools Reporter: Benjamin Muskalla <b.muskalla>
Component: wst.serverAssignee: Elson Yuen <eyuen7>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3 CC: eyuen7, ted.hopp
Version: unspecified   
Target Milestone: 3.2.5   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/109053
Whiteboard:
Attachments:
Description Flags
v1.0 none

Description Benjamin Muskalla CLA 2011-04-27 13:28:55 EDT
What steps will reproduce the problem?
1. Close Eclipse

-- Error Details --
Date: Wed Apr 27 19:10:54 CEST 2011
Message: Error during shutdown
Severity: Error
Product: Eclipse SDK 3.7.0.v201008051700 (org.eclipse.sdk.ide)
Plugin: org.eclipse.wst.server.core
Exception Stack Trace:
org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
at org.eclipse.core.internal.events.ResourceChangeListenerList.remove(ResourceChangeListenerList.java:146)
at org.eclipse.core.internal.events.NotificationManager.removeListener(NotificationManager.java:305)
at org.eclipse.core.internal.resources.Workspace.removeResourceChangeListener(Workspace.java:1934)
at org.eclipse.wst.server.core.internal.ResourceManager.shutdownImpl(ResourceManager.java:367)
at org.eclipse.wst.server.core.internal.ResourceManager.shutdown(ResourceManager.java:313)
at org.eclipse.wst.server.core.internal.ServerPlugin.stop(ServerPlugin.java:367)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:844)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:837)
at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:499)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.suspend(AbstractBundle.java:550)
at org.eclipse.osgi.framework.internal.core.Framework.suspendBundle(Framework.java:1096)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.decFWSL(StartLevelManager.java:597)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:257)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.shutdown(StartLevelManager.java:215)
at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.suspend(InternalSystemBundle.java:266)
at org.eclipse.osgi.framework.internal.core.Framework.shutdown(Framework.java:690)
at org.eclipse.osgi.framework.internal.core.Framework.close(Framework.java:588)
at org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown(EclipseStarter.java:415)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:198)
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:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Comment 1 Ted Hopp CLA 2011-07-21 01:25:11 EDT
Today I started seeing the same error, with exactly the same stack trace. I'm using:

Eclipse build: eclipse.buildId=M20110210-1200
Platform: Windows 7 SP1 AMD TF-20 64-bit processor; 3GB memory
Java 1.6.0_23 64-bit
Comment 2 Elson Yuen CLA 2011-07-21 17:01:31 EDT
Created attachment 200124 [details]
v1.0

It is strange that we get that error given that the existing code already check to make sure the listener is not null before removing it.  One possibility is the check is too early so I have moved the null check to the line immediately before the remove listener call. That should fix the problem.

I also notice that there is no null check on the property change listener check code on the line below.  I add a null check to it as well to avoid similar problem.
Comment 3 Elson Yuen CLA 2011-07-21 17:09:04 EDT
Code released to 33M.
Comment 4 Ted Hopp CLA 2011-07-21 17:23:55 EDT
(In reply to comment #2)
> It is strange that we get that error given that the existing code already check
> to make sure the listener is not null before removing it.  One possibility is
> the check is too early so I have moved the null check to the line immediately
> before the remove listener call. That should fix the problem.

It sounds like it might be a synchronization problem. If so, moving the check closer should reduce the frequency of errors, but doesn't eliminate the underlying problem.
Comment 5 Elson Yuen CLA 2011-07-22 13:45:50 EDT
There shouldn't be a synchronization problem since that variable is a private variable and there is no code on that class to clear that variable at all.
Comment 6 Elson Yuen CLA 2011-07-22 13:58:53 EDT
Code released to 32M and HEAD
Comment 7 Eclipse Genie CLA 2017-10-11 16:36:43 EDT
New Gerrit change created: https://git.eclipse.org/r/109053