Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342234 - [Query 2 Index View] BundleException during Shutdown of IDE if Index View is Opened.
Summary: [Query 2 Index View] BundleException during Shutdown of IDE if Index View is...
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Query2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-08 01:14 EDT by Animesh Kumar CLA
Modified: 2011-05-17 18:00 EDT (History)
2 users (show)

See Also:


Attachments
Releases the Locked Resource Descriptors (1.05 KB, patch)
2011-04-08 01:20 EDT, Animesh Kumar CLA
wayne.beaton: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Animesh Kumar CLA 2011-04-08 01:14:10 EDT
Build Identifier: 

Whenever I shut down the IDE, after opening Index View, I get a BundleException which is caused due to Locked Paging Strategy Pages. It Happens only if I have opened Index View before shutting down the IDE. This problem persists even if, Index View was opened and then closed. But, if the Index View is not at all opened in the IDE lifecycle. The stacktrace is as follows:-
org.osgi.framework.BundleException: Exception in org.eclipse.emf.query.index.Activator.stop() of bundle org.eclipse.emf.query2.index.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:863)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:501)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.suspend(AbstractBundle.java:550)
	at org.eclipse.osgi.framework.internal.core.Framework.suspendBundle(Framework.java:1097)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: java.lang.IllegalStateException: Paging strategy has locked pages
	at org.eclipse.emf.query.index.internal.impl.PagingStrategyImpl.flush(PagingStrategyImpl.java:334)
	at org.eclipse.emf.query.index.internal.impl.PagingResourceDescriptorMap.flush(PagingResourceDescriptorMap.java:105)
	at org.eclipse.emf.query.index.internal.impl.PageableIndexImpl.save(PageableIndexImpl.java:125)
	at org.eclipse.emf.query.index.IndexFactory.dumpIndexes(IndexFactory.java:97)
	at org.eclipse.emf.query.index.Activator.stop(Activator.java:51)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	... 19 more
Root exception:
java.lang.IllegalStateException: Paging strategy has locked pages
	at org.eclipse.emf.query.index.internal.impl.PagingStrategyImpl.flush(PagingStrategyImpl.java:334)
	at org.eclipse.emf.query.index.internal.impl.PagingResourceDescriptorMap.flush(PagingResourceDescriptorMap.java:105)
	at org.eclipse.emf.query.index.internal.impl.PageableIndexImpl.save(PageableIndexImpl.java:125)
	at org.eclipse.emf.query.index.IndexFactory.dumpIndexes(IndexFactory.java:97)
	at org.eclipse.emf.query.index.Activator.stop(Activator.java:51)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:501)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.suspend(AbstractBundle.java:550)
	at org.eclipse.osgi.framework.internal.core.Framework.suspendBundle(Framework.java:1097)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)


Reproducible: Always

Steps to Reproduce:
1. Open Index View.
2. Expand Resource Index Node.
3. Expand any of the the Resource Descriptor Node.
4. Close the IDE.
Comment 1 Animesh Kumar CLA 2011-04-08 01:20:55 EDT
Created attachment 192794 [details]
Releases the Locked Resource Descriptors

This Exception was occuring because in Index View, to retrieve the EObject Tables, incoming Link Tables, and Outgoing Tables, an acquire() was called on the ResourceDescriptors, but these descriptors were not released after retrieving the local tables.
An addition in the code to release() the ResourceDescriptor solves the problem.
Comment 2 Ashwani Kr Sharma CLA 2011-04-13 00:59:38 EDT
patch submitted