eclipse-uml2 / uml2

An EMF-based implementation of the UML 2.x metamodel for the Eclipse platform.
Eclipse Public License 2.0
5 stars 4 forks source link

Cannot open UML2.2 test cases from OMG's Model Interchange Working Group (MIWG) #47

Open eclipse-uml2-bot opened 2 days ago

eclipse-uml2-bot commented 2 days ago

| --- | --- | | Bugzilla Link | 309832 | | Status | NEW | | Importance | P3 normal | | Reported | Apr 20, 2010 11:42 EDT | | Modified | Feb 10, 2014 21:11 EDT | | Reporter | Nicolas Rouquette |

Description

Eclipse Helios build of Eclipse UML can't open most of the models in OMG's Model Interchange Working Group (MIWG)'s test cases.

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.1/uml.xml' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/valid.xmi, 2, 163)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.8beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.8beta/our-export.xml, 6, 75)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.8beta/our-export.xml, 15, 95)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.5/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.5/our-export.xml, 6, 77)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.2' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/MagicDraw-16.5/our-export.xml, 15, 86)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/EnterpriseArchitect-7.5/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/EnterpriseArchitect-7.5/our-export.xml, 3, 76)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-1/Submissions/EnterpriseArchitect-7.5/our-export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.1/uml.xml' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/valid.xmi, 2, 163)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/MagicDraw-16.8beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/MagicDraw-16.8beta/our-export.xml, 6, 75)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/MagicDraw-16.8beta/our-export.xml, 15, 94)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/EnterpriseArchitect-7.5/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/EnterpriseArchitect-7.5/our-export.xml, 3, 76)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/EnterpriseArchitect-7.5/our-export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/ArtisanStudio 7.1b.2/our-export.xmi

org.eclipse.emf.ecore.xmi.UnresolvedReferenceException: Unresolved reference 'RED'. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-2/Submissions/ArtisanStudio%207.1b.2/our-export.xmi, 55, 206)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-3/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.1/uml.xml' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-3/valid.xmi, 3, 70)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1.1/StandardProfileL2.xmi' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-3/valid.xmi, 41, 103)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/MagicDraw16.6/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/MagicDraw16.6/our-export.xml, 6, 75)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/MagicDraw16.6/our-export.xml, 15, 95)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/EnterpriseArchitect7.5plus/our_export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/EnterpriseArchitect7.5plus/our_export.xml, 3, 76)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.1' not found. (platform:/resource/Release-7/Tests/UML2.1.1-XMI2.1/Test-Case-6/Submissions/EnterpriseArchitect7.5plus/our_export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/valid.xmi, 2, 174)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/RSx-8.x/our-export.xmi

org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'Extension' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/RSx-8.x/our-export.xmi, 138, 69)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/uml2/schemas/Ecore/5' not found. (http://schema.omg.org/spec/UML/2.2/StandardProfileL2.xmi, 764, 126)\ java.io.FileNotFoundException: http://schema.omg.org/spec/UML/2.2/Ecore.profile.uml

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/MagicDraw16.8beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/MagicDraw16.8beta/our-export.xml, 6, 75)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.3' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/MagicDraw16.8beta/our-export.xml, 15, 95)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/EnterpriseArchitect8.0beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/EnterpriseArchitect8.0beta/our-export.xml, 3, 76)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-7/Submissions/EnterpriseArchitect8.0beta/our-export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/valid.xmi, 2, 228)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/RSx-8.x/our-export.xmi

org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'Extension' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/RSx-8.x/our-export.xmi, 61, 69)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/Modelio1.1/our-export.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/Modelio1.1/our-export.xmi, 2, 174)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/MagicDraw16.8beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/MagicDraw16.8beta/our-export.xml, 6, 75)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.3' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/MagicDraw16.8beta/our-export.xml, 15, 95)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/EnterpriseArchitect8.0beta/our-export.xml

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/EnterpriseArchitect8.0beta/our-export.xml, 3, 76)\ org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-8/Submissions/EnterpriseArchitect8.0beta/our-export.xml, 4, 70)

https://dev.enterprisecomponent.com:9992/repos/OMG-Model-Interchange/branches/Release-7/Tests/UML2.2-XMI2.1/Test-Case-9/valid.xmi

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/UML/2.2' not found. (platform:/resource/Release-7/Tests/UML2.2-XMI2.1/Test-Case-9/valid.xmi, 2, 284)

There may be a problem in the way Eclipse UML defines the resource factories for various versions of UML/XMI.

Compare:

/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI2UMLResourceFactoryImpl.java\ /org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/resource/XMI212UMLResourceFactoryImpl.java

XMI212UMLResourceFactoryImpl adds package registrations for the org.eclipse.core.contenttype.contentType extensions in org.eclipse.uml2.uml's plugin.xml whereas XMI2UMLResourceFactoryImpl doesn't.

eclipse-uml2-bot commented 2 days ago

By Thomas Neustupny on Feb 22, 2011 04:12

Is there some workaround, like some editing domain configuration that allows for reading the MIWG test cases?

Like Ed Merks said in the Eclipse Forum:\ "EMF provides support for content types based on extension points so\ there is definitely a mechanism by which everyone can share and reuse\ the same global mappings. I.e., you can define content type recognizers\ and you can associate a resource factory with a content type."

eclipse-uml2-bot commented 2 days ago

By Kenn Hussey on Feb 22, 2011 09:05

(In reply to comment #1)

Is there some workaround, like some editing domain configuration that allows for reading the MIWG test cases?

The editing domain for the UML Editor is supposed to be configured so that you can successfully open these files via 'Open With > UML Editor'...

Like Ed Merks said in the Eclipse Forum: "EMF provides support for content types based on extension points so there is definitely a mechanism by which everyone can share and reuse the same global mappings. I.e., you can define content type recognizers and you can associate a resource factory with a content type."

It should be possible to get this working with the necessary resource factories in place (based on content type, not extension)...

eclipse-uml2-bot commented 2 days ago

By Thomas Neustupny on Feb 23, 2011 04:22

The editing domain for the UML Editor is supposed to be configured so that you can successfully open these files via 'Open With > UML Editor'...

I'm not a user nor a developer of the UML Editor. Can you point me to the place where the UML Editor configures it's editing domain, so that I can make my code read the MIWG models? (I must admit that I can't get the UML Editor running in my Helios installation.)

eclipse-uml2-bot commented 2 days ago

By Kenn Hussey on Feb 24, 2011 23:22

(In reply to comment #3)

I'm not a user nor a developer of the UML Editor. Can you point me to the place where the UML Editor configures it's editing domain, so that I can make my code read the MIWG models? (I must admit that I can't get the UML Editor running in my Helios installation.)

Sure. If you look at the source for the createModel() method of the org.eclipse.uml2.uml.editor.presentation.UMLEditor class, you'll see that it registers the necessary content types and extended metadata like this:

    Map<String, Object> contentTypeToFactoryMap = resourceSet
        .getResourceFactoryRegistry().getContentTypeToFactoryMap();

    contentTypeToFactoryMap.put(\
        UML22UMLResource.UML2_CONTENT_TYPE_IDENTIFIER,\
        UML22UMLResource.Factory.INSTANCE);\
    contentTypeToFactoryMap.put(\
        UML212UMLResource.UML_2_1_0_CONTENT_TYPE_IDENTIFIER,\
        UML212UMLResource.Factory.INSTANCE);\
    contentTypeToFactoryMap.put(\
        XMI2UMLResource.UML_CONTENT_TYPE_IDENTIFIER,\
        XMI2UMLResource.Factory.INSTANCE);\
    contentTypeToFactoryMap.put(\
        XMI212UMLResource.UML_2_1_1_CONTENT_TYPE_IDENTIFIER,\
        XMI212UMLResource.Factory.INSTANCE);\
    contentTypeToFactoryMap.put(\
        XMI212UMLResource.UML_2_1_CONTENT_TYPE_IDENTIFIER,\
        XMI212UMLResource.Factory.INSTANCE);\
    contentTypeToFactoryMap.put(\
        CMOF2UMLResource.CMOF_CONTENT_TYPE_IDENTIFIER,\
        CMOF2UMLResource.Factory.INSTANCE);

    Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();

    uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());\
    uriMap.putAll(XMI2UMLExtendedMetaData.getURIMap());\
    uriMap.putAll(CMOF2UMLExtendedMetaData.getURIMap());
eclipse-uml2-bot commented 2 days ago

By Kenn Hussey on Feb 28, 2011 21:07

(In reply to comment #0)

Eclipse Helios build of Eclipse UML can't open most of the models in OMG's Model Interchange Working Group (MIWG)'s test cases.

Nicolas, I don't have access to any of the resources you referenced; attaching them to this bug will go a long way toward me being able to debug the problem...

eclipse-uml2-bot commented 2 days ago

By Thomas Neustupny on Mar 02, 2011 07:12

Kenn, your extensions to the contentTypeToFactoryMap seems to have no effect, but I found that adding the following in the xmi file works:

xsi:schemaLocation="http://schema.omg.org/spec/UML/2.1.1/uml.xml http://www.eclipse.org/uml2/3.0.0/UML"

So I have a problem with http://schema.omg.org/spec/UML/2.1.1/uml.xml, how can I configure my editing domain so that I don't need this (dirty?) xmi hack? That would solve this issue in my eyes.

eclipse-uml2-bot commented 2 days ago

By Thomas Neustupny on Mar 02, 2011 07:26

Maybe this constant is to be used?\ org.eclipse.uml2.uml.resource.XMI212UMLResource.UML_METAMODEL_2_1_1_URI

eclipse-uml2-bot commented 2 days ago

By Kenn Hussey on Mar 02, 2011 09:16

(In reply to comment #6)

Kenn, your extensions to the contentTypeToFactoryMap seems to have no effect, but I found that adding the following in the xmi file works:

xsi:schemaLocation="http://schema.omg.org/spec/UML/2.1.1/uml.xml http://www.eclipse.org/uml2/3.0.0/UML"

Hmm, I would have expected use of http://schema.omg.org/spec/UML/2.1.1 to identify the UML 2.1.1 namespace, and that's what the content type registrations in UML expect:

 <content-type\
       base-type="org.omg.uml"\
       file-extensions="xmi"\
       id="org.omg.uml_2_1_1"\
       name="%_UI_OMG_UML_2_1_1_content_type"\
       priority="normal">\
    <describer\
          class="org.eclipse.emf.ecore.xmi.impl.RootXMLContentHandlerImpl$Describer">\
       <parameter\
             name="namespace"\
             value="http://schema.omg.org/spec/UML/2.1.1" />\
       <parameter\
             name="kind"\
             value="xmi" />\
    </describer>\
 </content-type>

I suppose this content type registration could/should be adjusted to handle the extra "/uml.xml", but I'm not convinced that's the correct normative namespace URI for UML 2.1.1...

eclipse-uml2-bot commented 2 days ago

By Thomas Neustupny on Mar 02, 2011 10:35

Replacing http://schema.omg.org/spec/UML/2.1.1/uml.xml by http://schema.omg.org/spec/UML/2.1.1 globally in the xmi file works!

However, the header of the MIWG test case 1 xmi file definitely is:

<?xml version="1.0" encoding="UTF-8"?>\

(And that's what needs to get working unless MIWG doesn't change the namespace.)
eclipse-uml2-bot commented 2 days ago

By Thomas Neustupny on Mar 03, 2011 04:15

Here is the fix I propose:

Registry packageRegistry = resourceSet.getPackageRegistry();\ packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_URI, UMLPackage.eINSTANCE);

Works for me. Nicolas, whatever you use to open the MIWG test cases, it should have built in something like that. Needs to be checked, probably in the editing domain for the UML Editor.

eclipse-uml2-bot commented 2 days ago

By Kenn Hussey on Jun 21, 2012 12:45

New utilities have been added in UML2 4.0 to initialize a resource set with all of the necessary registrations needed to load UML resources of various flavors/versions. See UMLUtil.init(ResourceSet) and UMLResourcesUtil.init(ResourceSet), the latter of which is for standalone scenarios. Please consider trying one/both of these utilities to see if the issues you encountered still exist.