Bug 479518 - PackageNotFoundException below XtextResourceSet.getResource (247)
Summary: PackageNotFoundException below XtextResourceSet.getResource (247)
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-10-11 13:17 EDT by EPP Error Reports CLA
Modified: 2015-10-15 21:16 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EPP Error Reports CLA 2015-10-11 13:17:25 EDT
The following incident was reported via the automated error reporting:


    code:                   0
    plugin:                 org.eclipse.sirius_3.0.2.201509150749
    message:                Error adding model dependency
    fingerprint:            2d16c212
    exception class:        java.lang.reflect.InvocationTargetException
    exception message:      -
    number of children:     0
    
    java.lang.reflect.InvocationTargetException: null
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:420)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:500)
    at org.eclipse.sirius.ui.tools.internal.actions.analysis.AddModelDependencyAction.createSemanticResourceDialog(AddModelDependencyAction.java:92)
    at org.eclipse.sirius.ui.tools.internal.actions.analysis.AddModelDependencyAction.run(AddModelDependencyAction.java:80)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1329)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3819)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3430)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
    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:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.omg.org/spec/20130218/core' not found. (platform:/resource/foo/models/movies.core, 2, 264)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
    at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:247)
    at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.addSemanticResource(DAnalysisSessionImpl.java:567)
    at org.eclipse.sirius.tools.api.command.semantic.AddSemanticResourceCommand.doExecute(AddSemanticResourceCommand.java:81)
    at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
    at org.eclipse.emf.common.command.CompoundCommand.execute(CompoundCommand.java:261)
    at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
    at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:516)
    at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
    at org.eclipse.sirius.ui.tools.internal.operations.SemanticResourceAdditionOperation.run(SemanticResourceAdditionOperation.java:67)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.omg.org/spec/20130218/core' not found. (platform:/resource/foo/models/movies.core, 2, 264)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2625)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1335)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
    at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
    at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:78)
    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:190)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
    at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:745)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1292)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3138)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
    at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
    at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
    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.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:247)
    at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.addSemanticResource(DAnalysisSessionImpl.java:567)
    at org.eclipse.sirius.tools.api.command.semantic.AddSemanticResourceCommand.doExecute(AddSemanticResourceCommand.java:81)
    at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
    at org.eclipse.emf.common.command.CompoundCommand.execute(CompoundCommand.java:261)
    at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
    at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:516)
    at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
    at org.eclipse.sirius.ui.tools.internal.operations.SemanticResourceAdditionOperation.run(SemanticResourceAdditionOperation.java:67)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
   
  

General Information:

    reported-by:      Mark Tippetts
    anonymous-id:     1b40af5b-3262-4c56-b8d1-d517e44bb993
    eclipse-build-id: 4.5.1.M20150904-0015
    eclipse-product:  org.eclipse.epp.package.dsl.product
    operating system: Linux 3.19.3 (x86_64) - gtk
    jre-version:      1.8.0_60-b27

The following plug-ins were present on the execution stack (*):
    1. org.eclipse.core.commands_3.7.0.v20150422-0725
    2. org.eclipse.core.databinding.observable_1.5.0.v20150422-0725
    3. org.eclipse.core.databinding_1.5.0.v20150422-0725
    4. org.eclipse.core.runtime_3.11.1.v20150903-1804
    5. org.eclipse.e4.ui.workbench_1.3.0.v20150531-1948
    6. org.eclipse.e4.ui.workbench.swt_0.13.0.v20150504-0621
    7. org.eclipse.emf.common_2.11.0.v20150805-0538
    8. org.eclipse.emf_2.6.0.v20150806-0404
    9. org.eclipse.emf.ecore_2.11.1.v20150805-0538
    10. org.eclipse.emf.ecore.xmi_2.11.1.v20150805-0538
    11. org.eclipse.emf.transaction_1.9.0.201506010221
    12. org.eclipse.emf.workspace_1.5.1.201506010221
    13. org.eclipse.equinox.app_1.3.300.v20150423-1356
    14. org.eclipse.equinox.launcher_1.3.100.v20150511-1540
    15. org.eclipse.jface_3.11.0.v20150602-1400
    16. org.eclipse.sirius_3.0.2.201509150749
    17. org.eclipse.sirius.ui_3.0.2.201509150749
    18. org.eclipse.swt_3.104.1.v20150825-0743
    19. org.eclipse.ui_3.107.0.v20150507-1945
    20. org.eclipse.ui.ide.application_1.1.0.v20150422-0725
    21. org.eclipse.ui.ide_3.11.0.v20150825-2158
    22. org.eclipse.xtext_2.8.4.v201508050135

Please note that:
* Messages, stacktraces, and nested status objects may be shortened.
* Bug fields like status, resolution, and whiteboard are sent
  back to reporters.
* The list of present bundles and their respective versions was
  calculated by package naming heuristics. This may or may not reflect reality.

Other Resources:
* Report: https://dev.eclipse.org/recommenders/committers/confess/#/problems/5619498de4b064cdde009951  
* Manual: https://dev.eclipse.org/recommenders/community/confess/#/guide


Thank you for your assistance.
Your friendly error-reports-inbox.

This bug was created on behalf of Sebastian.Zarnekow@xxxxxxxxxxxx.
Comment 1 Sebastian Zarnekow CLA 2015-10-11 13:18:37 EDT
Appears to be a problem with session.danalysis.DAnalysisSessionImpl.addSemanticResource
Comment 2 Pierre-Charles David CLA 2015-10-12 09:01:01 EDT
(In reply to Sebastian Zarnekow from comment #1)
> Appears to be a problem with
> session.danalysis.DAnalysisSessionImpl.addSemanticResource

This method eventually defers to a normal EMF Resource.load(), which fails because the metamodel used by the resource can not be found: "Package with uri 'http://www.omg.org/spec/20130218/core' not found.". Sirius could be a little more resilient to user-model loading errors (with a nicer error message), but it won't be able to load models for which the metamodel is not available.

Unless the XtextResourceSet (or the way Sirius sets it up) does something fishy with the EPackageRegistry where metamodels are expected to be found, we can not do anything on the Sirius side.

In your context, does "/foo/models/movies.core" load properly outside of Sirius? For example, right click > Open With... > Other... > Sample Relfective Ecore Model Editor.
* If this fails with the same kind of error, the problem is not in Sirius (except regarding the cryptic error message which should be clearer) but in that the metamodel used by movies.core is not properly installed/registered.
* If it works, the problem might be in Sirius itself, or in org.eclipse.xtext.resource.XtextResourceSet. Uninstalling the "Sirius Integration with Xtext" (org.eclipse.sirius.runtime.ide.xtext) feature should make Sirius use a plain ResourceSetImpl, which would help distinguish the two possibilities.
Comment 3 Sebastian Zarnekow CLA 2015-10-13 02:51:00 EDT
The XtextResourceSet does nothing fancy here. I think what you see is "just" a org.eclipse.emf.common.util.WrappedException as documented on ResourceSet#getResource. Sirius has to be more resilient against those.
Comment 4 Mark Tippetts CLA 2015-10-15 21:16:22 EDT
This turned out to be a problem with Acceleo. For some reason an *.emtl file was encoded with malformed URIs. I believe this is tied to an issue addressed in the Sirius documentation here: https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#acceleo

"Note: due to an incompatible change in serialization format in EMF 2.9, if you use external .mtl files in your modeler definitions and build your modeler plug-ins using EMF 2.9 or later, the resulting modeler will not work with previous versions of EMF (as the resulting .emtl files will not load correctly with EMF 2.8 and earlier). For reference, EMF 2.9 corresponds to Eclipse 4.3 (Kepler)."