Bug 436435 - ClassCircularityError when loading models depending on diagram.ecore if Sirius is not already initialized
Summary: ClassCircularityError when loading models depending on diagram.ecore if Siriu...
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 2.0.0   Edit
Assignee: Maxime Porhel CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 440653
  Show dependency tree
 
Reported: 2014-06-03 06:15 EDT by Boubekeur Zendagui CLA
Modified: 2014-10-27 06:52 EDT (History)
6 users (show)

See Also:


Attachments
MainModel.ecore and DiagramUse.ecore models diagram showing link between them (37.79 KB, image/jpeg)
2014-06-03 06:15 EDT, Boubekeur Zendagui CLA
no flags Details
EMF projects (models, edits and editor) (182.17 KB, application/zip)
2014-06-03 06:16 EDT, Boubekeur Zendagui CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Boubekeur Zendagui CLA 2014-06-03 06:15:47 EDT
Created attachment 243872 [details]
MainModel.ecore and DiagramUse.ecore models diagram showing link between them

Since Sirius rc1 is available, I have a problem related to Sirius bundles loading in the case or an ecore model reference Sirius ecore models (viewpoint.ecore and diagram.ecore). 

Here's a simplified example that causes this problem. 

I have two ecore models: MainModel.ecore which is extensible and DiagramUse.ecore which is an extension to MainModel.ecore (see classes.jpg). Models and projects are available in diagram.zip. 

DiagramUse.ecore contains ModelRootElement EClass that has an: 
1 - EReference whose EType is "org.eclipse.sirius.diagram/model/diagram.ecore#//Description/DiagramDescription" 
2 - EAttribute whose EType is "org.eclipse.sirius/model/viewpoint.ecore#//LabelAlignment" 

Here's a scenario to reproduce the problem:
1. Import all the projects from diagram.zip into the workspace. Everything should build without error.
2. Launch a runtime (using the default parameters).
3. In the runtime's workspace, create a basic project, 
4. Inside the project, create a "MainModel Model" (available in New > Other > Example EMF Model Creation Wizards). Choose "Model Root" as the root element type.
5. Open "My.mainmodel". It contains a single "Model Root" element.
6. In "Model Root" element, create a child of type "Model Rool Element"
7. Close the editor, and close the (runtime) Eclipse.
8. Restart the runtime. Open the project, and open the "My.mainmodel"
Comment 1 Boubekeur Zendagui CLA 2014-06-03 06:16:42 EDT
Created attachment 243873 [details]
EMF projects (models, edits and editor)
Comment 2 Pierre-Charles David CLA 2014-06-03 06:55:26 EDT
From what I have been able to determine, it is a regression caused as a side-effect of https://bugs.eclipse.org/bugs/show_bug.cgi?id=430263, which causes a cycle in the lazy initialization of bundles.

I'm not sure we can get a complete fix for 1.0.0, but I hope we can at least reduce the cases where this can happen, and plan for a more complete fix later.
Comment 3 Pierre-Charles David CLA 2014-06-03 08:52:57 EDT
Here is the full stack of the first error when running the described scenarion:

eclipse.buildId=unknown
java.version=1.6.0_45
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=fr_FR
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data /home/pcdavid/p/sirius/wks/../runtime-sirius -dev file:/home/pcdavid/p/sirius/wks/.metadata/.plugins/org.eclipse.pde.core/Sirius/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog

org.eclipse.osgi
Error
Tue Jun 03 14:51:54 CEST 2014
An error occurred while automatically activating bundle org.eclipse.sirius.diagram.ui (6516).

org.osgi.framework.BundleException: Exception in org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin$Implementation.start() of bundle org.eclipse.sirius.diagram.ui.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:386)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.sirius.business.internal.migration.AbstractSiriusMigrationService.loadContributions(AbstractSiriusMigrationService.java:72)
	at org.eclipse.sirius.business.internal.migration.description.VSMMigrationService.<init>(VSMMigrationService.java:27)
	at org.eclipse.sirius.business.internal.migration.description.VSMMigrationService.<clinit>(VSMMigrationService.java:24)
	at org.eclipse.sirius.viewpoint.description.util.DescriptionResourceFactoryImpl.createResource(DescriptionResourceFactoryImpl.java:63)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:434)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandCreateResource(ResourceSetImpl.java:243)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:400)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.load(ViewpointRegistryImpl.java:603)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.registerFromPlugin(ViewpointRegistryImpl.java:282)
	at org.eclipse.sirius.ecore.design.service.EcoreSamplePlugin.start(EcoreSamplePlugin.java:61)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:386)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.sirius.common.tools.api.util.EclipseUtil.getExtensionPlugins(EclipseUtil.java:137)
	at org.eclipse.sirius.common.tools.api.util.EclipseUtil.getExtensionPlugins(EclipseUtil.java:79)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.initViewpointsFromPlugins(ViewpointRegistryImpl.java:615)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.init(ViewpointRegistryImpl.java:153)
	at org.eclipse.sirius.viewpoint.SiriusPlugin.initPreferences(SiriusPlugin.java:173)
	at org.eclipse.sirius.viewpoint.SiriusPlugin.start(SiriusPlugin.java:154)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:382)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:285)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:588)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:540)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:527)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:386)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.sirius.diagram.DiagramFactory.<clinit>(DiagramFactory.java:30)
	at org.eclipse.sirius.diagram.impl.DiagramPackageImpl.<init>(DiagramPackageImpl.java:530)
	at org.eclipse.sirius.diagram.impl.DiagramPackageImpl.init(DiagramPackageImpl.java:561)
	at org.eclipse.sirius.diagram.DiagramPackage.<clinit>(DiagramPackage.java:64)
	at diagramDependants.impl.DiagramDependantsPackageImpl.init(DiagramDependantsPackageImpl.java:85)
	at diagramDependants.DiagramDependantsPackage.<clinit>(DiagramDependantsPackage.java:58)
	at sun.misc.Unsafe.ensureClassInitialized(Native Method)
	at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
	at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
	at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
	at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
	at java.lang.reflect.Field.get(Field.java:358)
	at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:273)
	at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
	at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.delegatedGetEPackage(EPackageRegistryImpl.java:190)
	at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:143)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2493)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:2108)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2067)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:128)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1876)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1030)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:81)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
	at mainModel.presentation.MainModelEditor.createModel(MainModelEditor.java:941)
	at mainModel.presentation.MainModelEditor.createPages(MainModelEditor.java:998)
	at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:140)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:321)
	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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:104)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:73)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:55)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:127)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:984)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:663)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:92)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4598)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:207)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:479)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:445)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:692)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:385)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1126)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3127)
	at org.eclipse.ui.internal.WorkbenchPage.access$23(WorkbenchPage.java:3049)
	at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:3031)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3026)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2990)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2980)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:541)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:500)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:360)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:167)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:268)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:233)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)
	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:853)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:850)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1142)
	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1249)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:278)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:272)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:313)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4462)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3806)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3416)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1152)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1033)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:635)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:578)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:233)
	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:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.ClassCircularityError: org/eclipse/sirius/viewpoint/DRepresentation
	at org.eclipse.sirius.diagram.util.DiagramAdapterFactory.<init>(DiagramAdapterFactory.java:139)
	at org.eclipse.sirius.diagram.provider.DiagramItemProviderAdapterFactory.<init>(DiagramItemProviderAdapterFactory.java:76)
	at org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin$Implementation.fillItemProviderFactories(DiagramUIPlugin.java:274)
	at org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin$Implementation.createAdapterFactory(DiagramUIPlugin.java:249)
	at org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin$Implementation.start(DiagramUIPlugin.java:172)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	... 248 more
Root exception:
java.lang.ClassCircularityError: org/eclipse/sirius/viewpoint/DRepresentation
	at org.eclipse.sirius.diagram.util.DiagramAdapterFactory.<init>(DiagramAdapterFactory.java:139)
	at org.eclipse.sirius.diagram.provider.DiagramItemProviderAdapterFactory.<init>(DiagramItemProviderAdapterFactory.java:76)
	at org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin$Implementation.fillItemProviderFactories(DiagramUIPlugin.java:274)
	at org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin$Implementation.createAdapterFactory(DiagramUIPlugin.java:249)
	at org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin$Implementation.start(DiagramUIPlugin.java:172)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:386)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.sirius.business.internal.migration.AbstractSiriusMigrationService.loadContributions(AbstractSiriusMigrationService.java:72)
	at org.eclipse.sirius.business.internal.migration.description.VSMMigrationService.<init>(VSMMigrationService.java:27)
	at org.eclipse.sirius.business.internal.migration.description.VSMMigrationService.<clinit>(VSMMigrationService.java:24)
	at org.eclipse.sirius.viewpoint.description.util.DescriptionResourceFactoryImpl.createResource(DescriptionResourceFactoryImpl.java:63)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:434)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandCreateResource(ResourceSetImpl.java:243)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:400)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.load(ViewpointRegistryImpl.java:603)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.registerFromPlugin(ViewpointRegistryImpl.java:282)
	at org.eclipse.sirius.ecore.design.service.EcoreSamplePlugin.start(EcoreSamplePlugin.java:61)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:386)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.sirius.common.tools.api.util.EclipseUtil.getExtensionPlugins(EclipseUtil.java:137)
	at org.eclipse.sirius.common.tools.api.util.EclipseUtil.getExtensionPlugins(EclipseUtil.java:79)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.initViewpointsFromPlugins(ViewpointRegistryImpl.java:615)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.init(ViewpointRegistryImpl.java:153)
	at org.eclipse.sirius.viewpoint.SiriusPlugin.initPreferences(SiriusPlugin.java:173)
	at org.eclipse.sirius.viewpoint.SiriusPlugin.start(SiriusPlugin.java:154)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:382)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:285)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:588)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:540)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:527)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:311)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:386)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.sirius.diagram.DiagramFactory.<clinit>(DiagramFactory.java:30)
	at org.eclipse.sirius.diagram.impl.DiagramPackageImpl.<init>(DiagramPackageImpl.java:530)
	at org.eclipse.sirius.diagram.impl.DiagramPackageImpl.init(DiagramPackageImpl.java:561)
	at org.eclipse.sirius.diagram.DiagramPackage.<clinit>(DiagramPackage.java:64)
	at diagramDependants.impl.DiagramDependantsPackageImpl.init(DiagramDependantsPackageImpl.java:85)
	at diagramDependants.DiagramDependantsPackage.<clinit>(DiagramDependantsPackage.java:58)
	at sun.misc.Unsafe.ensureClassInitialized(Native Method)
	at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
	at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
	at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
	at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
	at java.lang.reflect.Field.get(Field.java:358)
	at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:273)
	at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
	at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.delegatedGetEPackage(EPackageRegistryImpl.java:190)
	at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:143)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2493)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:2108)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2067)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:128)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1876)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1030)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:81)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
	at mainModel.presentation.MainModelEditor.createModel(MainModelEditor.java:941)
	at mainModel.presentation.MainModelEditor.createPages(MainModelEditor.java:998)
	at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:140)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:321)
	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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:104)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:73)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:55)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:127)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:984)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:663)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:92)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4598)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:207)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:479)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:445)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:692)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:385)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1126)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3127)
	at org.eclipse.ui.internal.WorkbenchPage.access$23(WorkbenchPage.java:3049)
	at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:3031)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3026)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2990)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2980)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:541)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:500)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:360)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:167)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:268)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:233)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)
	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:853)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:850)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1142)
	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1249)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:278)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:272)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:313)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4462)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3806)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3416)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1152)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1033)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:635)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:578)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:233)
	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:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Comment 4 Pierre-Charles David CLA 2014-06-03 09:44:56 EDT
Here is my analysis of what happens (in chronological order of call,
thus reversed from the stack above):

The generated editor tries to load the "My.mainmodel" resource:

	at mainModel.presentation.MainModelEditor.createModel(MainModelEditor.java:941)


To do this it needs the EPackage for "diagramDependants":

	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2493)
        ...
	at org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescriptor.getEPackage(RegistryReader.java:273)


This EPackage depends on diagram.ecore, which means we start to initialize Sirius's
DiagramPackageImpl and the corresponding factory:

	at diagramDependants.DiagramDependantsPackage.<clinit>(DiagramDependantsPackage.java:58)
	at diagramDependants.impl.DiagramDependantsPackageImpl.init(DiagramDependantsPackageImpl.java:85)
        at org.eclipse.sirius.diagram.DiagramPackage.<clinit>(DiagramPackage.java:64)
	at org.eclipse.sirius.diagram.DiagramFactory.<clinit>(DiagramFactory.java:30)

This requires loading the org.eclipse.sirius.diagram.DDiagram class,
which inherits from org.eclipse.sirius.viewpoint.DRepresentation, and
thus we need to that the corresponding plug-in:

        at org.eclipse.sirius.viewpoint.SiriusPlugin.start(SiriusPlugin.java:154)

As part of its startup, SiriusPlugin asks the ViewpointRegistry to
initialize, which involves loading all the VSMs registered in any of
the available plug-ins:

	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.init(ViewpointRegistryImpl.java:153)
	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.initViewpointsFromPlugins(ViewpointRegistryImpl.java:615)
	at org.eclipse.sirius.common.tools.api.util.EclipseUtil.getExtensionPlugins(EclipseUtil.java:79)

If there is even one of them which is available, we start its plug-in
(as the plug-in's start() execution is the part that actually
registers the VSMs into the registry...). In this case, we start the ecore sample modeler:

	at org.eclipse.sirius.ecore.design.service.EcoreSamplePlugin.start(EcoreSamplePlugin.java:61)

which registers the ecore.odesign:

      at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.registerFromPlugin(ViewpointRegistryImpl.java:282)

which must be loaded:

	at org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.load(ViewpointRegistryImpl.java:603)

Because this VSM declares at least one diagram description, loading it
at some point requires accessing to the classes of the Diagram
EPackage... that we are still in the process of initializing in this
very stack, see above. 

Note that in the example, this happens as part of the transparent
migration process because the ecore.odesign VSM is not up to date, but
even after updating it we see a similar failure, except with a
slightly different stack at the end (i.e. something else than trying
to create the DiagramItemProviderAdapterFactory triggers the
circularity error).
Comment 5 Pierre-Charles David CLA 2014-06-03 10:27:47 EDT
Note that if you switch to the "Modeling" perspective before trying to open the "My.mainmodel", the bug is not triggered (as switching to the perspective ensures Sirius is properly initialized).
Comment 6 Pierre-Charles David CLA 2014-06-03 10:49:21 EDT
A slightly better workaround is to add an Activator in the org.eclipse.test.diagram plug-in, with a start() method that ensures the core Sirius plug-in is started when/before the org.eclipse.test.diagram plug-in is started:

    @Override
    public void start(BundleContext context) throws Exception {
        @SuppressWarnings("unused")
        Class<?> siriusCore = SiriusPlugin.class;
    }

It seems to fix the original scenario.

I will continue to work on this a little to see if there are other legitimate scenarios in which the problem can occur, but if the only case I can find is people who extend the Sirius meta-model, I think the few people concerned will have to do with the workaround above for 1.0.0. This does not mean we will no try to fix this or at least improve the situation, but it looks like it would require relatively deep changes for which it is too late for 1.0.

Boubekeur, what do you think? Is this workaround applicable in your case, at least for 1.0?
Comment 7 Boubekeur Zendagui CLA 2014-06-03 12:11:05 EDT
Yes, this workaround resolves the problem of ClassCircularityError and Sirius bundles loading.

So i will keep it until a solution will be found.

Thanks Pierre-Charles.
Comment 8 Pierre-Charles David CLA 2014-06-04 03:22:18 EDT
OK. Reducing the severity to "major" and moving to 2.0, we'll see after 1.0.0 what can be done to improve the situation here.
Comment 9 Melanie Bats CLA 2014-07-08 04:26:14 EDT
I had the same exception in UML Designer when I tried to register a session listener in the activator. I fixed this issue by using the session listener extension point to register my listener. See the UML Designer corresponding commit : https://github.com/ObeoNetwork/UML-Designer/commit/f3a76aa3e4ade4e7cad77e71941c3b65bc9b4b8f
Comment 10 Cedric Brun CLA 2014-07-23 04:17:14 EDT
Looks like this problem is more common than we first though it was.
We should try to fix it in the maintenance stream.

What about moving the VPRegistry initialization logic out of the SiriusPlugin.start() and initializing it through the first ViewpointRegistry.getInstance() call ?
Comment 11 Cedric Brun CLA 2014-07-23 04:53:47 EDT
BTW do we really have a preference for the initial size of the Viewpoint registry ?!?

 final IPreferencesService service = Platform.getPreferencesService();
        /* init the viewpoints registry with an initial size */
        final int initialSize = service.getInt(ID, DCorePreferences.VIEWPOINT_REGISTRY_INITIAL_SIZE, DCorePreferences.VIEWPOINT_REGISTRY_INITIAL_SIZE_DEFAULT_VALUE, null);
        ViewpointRegistry.getInstance().init(initialSize);

Which is 10 by default, this looks highly overkill to me (especially considering that a hashset has a default initial size of 16...) If there is no specific reason for this we should get rid of these preferences as this creates more chances to fail in headless/standalone.

Of org.eclipse.sirius.tools.api.preferences.DCorePreferences, none looks usefull at first sight.
Comment 12 Cedric Brun CLA 2014-07-29 11:19:10 EDT
A review for the 2.0 stream is here:

https://git.eclipse.org/r/#/c/30679/

This move the initialization code into the getInstance() call, using a known pattern in Java to defer this initialization in a thread-safe way.

I could not make sure the scenario mentionned by Boubekeur was fixed so far because I could not reproduce it with the current master (even without my change).
Comment 13 Maxime Porhel CLA 2014-07-30 10:24:09 EDT
With Cedric's patch I do not reproduce the error anymore.
Comment 14 Maxime Porhel CLA 2014-07-31 09:46:55 EDT
I have updated Cedric's patch to also remove DCorePreferences.VIEWPOINT_REGISTRY_INITIAL_SIZE and DCorePreferences.VIEWPOINT_REGISTRY_INITIAL_SIZE_DEFAULT_VALUE.
Comment 15 Maxime Porhel CLA 2014-08-04 10:24:17 EDT
Corrected on master by commit 87e7457917d198c4fbf25db2ea6713266336a94a
Comment 16 Ed Willink CLA 2014-08-13 05:47:12 EDT
(In reply to Cedric Brun from comment #10)
> Looks like this problem is more common than we first though it was.
> We should try to fix it in the maintenance stream.
> 
> What about moving the VPRegistry initialization logic out of the
> SiriusPlugin.start() and initializing it through the first
> ViewpointRegistry.getInstance() call ?

I just tried to create an Ecore diagram and get an "The chosen operation is not currently available" popup. The erropr log shows a varierty of Sirious issues with deep ClassCircularityError.

Is there a simple workaround so that Ecore Tools 2 can be used at all?
Comment 17 Pierre-Charles David CLA 2014-08-13 11:00:32 EDT
(In reply to Ed Willink from comment #16)
> I just tried to create an Ecore diagram and get an "The chosen operation is
> not currently available" popup. The erropr log shows a varierty of Sirious
> issues with deep ClassCircularityError.
> 
> Is there a simple workaround so that Ecore Tools 2 can be used at all?

This is normally fixed in the Sirius 1.0.x stream, and the current plan is to release 1.0.1, with this fix included, next week. In the meantime you can update Sirius itself using the 1.0.1rc1 available at http://download.eclipse.org/sirius/updates/milestones/1.0.1rc1/luna/ and confirm (or infirm that the bug is indeed fixed in your case.
Comment 18 Ed Willink CLA 2014-08-13 12:19:56 EDT
(In reply to Pierre-Charles David from comment #17)
> In the meantime you can
> update Sirius itself using the 1.0.1rc1 available at
> http://download.eclipse.org/sirius/updates/milestones/1.0.1rc1/luna/ and
> confirm (or infirm that the bug is indeed fixed in your case.

Not obvious what to install; it took three reductions in selection to succeed. I guess it is a P2 enhancement request to support Update From....

It now spends a long time thinking about Intitilaize Ecore Diagram..., demands a *.aird file, and then gives me: Found 2 main representations files (that means not referenced by another) in "org.eclipse.qvtd.build.schedule": representations.aird and QVTSchedule.aird. A modeling project must contain only one.

No idea what this means; in the old days, X.ecore was accompanied by X.ecore_diagram. I would exprct something similar, certainly no prohibition on multiple *.ecore.
Comment 19 Cedric Brun CLA 2014-08-13 12:36:33 EDT
(In reply to Ed Willink from comment #18)
> (In reply to Pierre-Charles David from comment #17)
> > In the meantime you can
> > update Sirius itself using the 1.0.1rc1 available at
> > http://download.eclipse.org/sirius/updates/milestones/1.0.1rc1/luna/ and
> > confirm (or infirm that the bug is indeed fixed in your case.
> 
> Not obvious what to install; it took three reductions in selection to
> succeed. I guess it is a P2 enhancement request to support Update From....
> 
> It now spends a long time thinking about Intitilaize Ecore Diagram...,
> demands a *.aird file, and then gives me: Found 2 main representations files
> (that means not referenced by another) in "org.eclipse.qvtd.build.schedule":
> representations.aird and QVTSchedule.aird. A modeling project must contain
> only one.
> 

This indeed is a bug in EcoreTools, the "initialize Ecore Diagram" action might lead you to an inconsistent state in regard to sirius. 

I just tracked it there :

https://bugs.eclipse.org/bugs/show_bug.cgi?id=441716

In the meantime you can declare the .ecore diagram as being managed by the modeling project : http://www.eclipse.org/ecoretools/doc/index.html#LoadingExternalModels and then you can use the EClasses instances of this .ecore file in a diagram.

> No idea what this means; in the old days, X.ecore was accompanied by
> X.ecore_diagram. I would exprct something similar, certainly no prohibition
> on multiple *.ecore.
Comment 20 Pierre-Charles David CLA 2014-08-14 07:33:48 EDT
(In reply to Ed Willink from comment #18)
> (In reply to Pierre-Charles David from comment #17)
> > In the meantime you can
> > update Sirius itself using the 1.0.1rc1 available at
> > http://download.eclipse.org/sirius/updates/milestones/1.0.1rc1/luna/ and
> > confirm (or infirm that the bug is indeed fixed in your case.
> 
> Not obvious what to install; it took three reductions in selection to
> succeed. I guess it is a P2 enhancement request to support Update From....

Adding the update-site I mentioned to "Available Update Sites" and then "Help > Check for Updates" should pick up updated versions of only the plugins & features already installed initially.
Comment 21 Pierre-Charles David CLA 2014-10-27 06:52:16 EDT
Available in Sirius 2.0.0.