Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: Impossible to load UML model via Java code
Re: Impossible to load UML model via Java code [message #477709] Mon, 08 September 2008 12:08 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31005
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040509020302060109050906
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Laurent,

It's best to ask about UML things on the UML2 newsgroup (I've added it
to the "to" list of the reply) and ask about compare on the EMFT
newsgroup. Be sure to read the UML2 FAQ:

http://wiki.eclipse.org/MDT-UML2-FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F

And use google to find related similar questions:

http://www.google.com/cse?cx=017941334893793413703%3Asqfrdtd 112s&q=UML+load+stand+alone&sa=Search
< http://www.google.com/cse?cx=017941334893793413703%3Asqfrdtd 112s&q=UML+load+stand+alone&sa=Search>



Laurent Roubele wrote:
> Hello,
>
> I'm trying to load a model via java (emf) in order to merge it with
> another one... My UML model (.uml) was exported from Magic Draw into
> "EMF UML (v2.x) XMI". Here is my code :
>
>
> import java.io.File;
> import java.io.IOException;
> import java.util.ArrayList;
> import java.util.Calendar;
> import java.util.Collections;
> import java.util.List;
>
> import org.eclipse.emf.compare.diff.merge.service.MergeService;
> import org.eclipse.emf.compare.diff.metamodel.DiffElement;
> import org.eclipse.emf.compare.diff.metamodel.DiffFactory;
> import org.eclipse.emf.compare.diff.metamodel.DiffModel;
> import org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot;
> import org.eclipse.emf.compare.diff.service.DiffService;
> import org.eclipse.emf.compare.match.metamodel.MatchModel;
> import org.eclipse.emf.compare.match.service.MatchService;
> import org.eclipse.emf.compare.util.ModelUtils;
> import org.eclipse.emf.ecore.EObject;
> import org.eclipse.emf.ecore.resource.Resource;
> import org.eclipse.emf.ecore.resource.ResourceSet;
> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
> import org.eclipse.uml2.uml.UMLPackage;
> import org.eclipse.uml2.uml.resource.UMLResource;
>
> public final class ExampleLauncher {
>   /**
>   * This class doesn't need to be instantiated.
>   */
>   private ExampleLauncher() {
>   // prevents instantiation
> }
>
> public static void main(String[] args) {
>   // Creates the resourceSet where we'll load the models
>   final ResourceSet resourceSet = new ResourceSetImpl();
>
>   // Register additional packages here. For UML2:
>   Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
>   UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>   resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
>   UMLPackage.eINSTANCE);
>
>   try {
>      System.out.println("Loading resources.\n"); //$NON-NLS-1$
>      // Loads the model to modify
>      final EObject model1 = ModelUtils.load(new 
> File("D:/eclipse/workspace/EMFTEST/model/model.uml"),resourceSet);
>
>      System.out.println("Loaded.");
>   } catch (Exception e) { // shouldn't be thrown
>      e.printStackTrace();
>   }
>   }
> }
> 

>
> When I launch this sample I got a exception:
> Loading resources.
>
> java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XMLHandler.java:2132)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:2010)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:131)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1789)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1013)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2516)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2397)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1275)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1444)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1009)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:991)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1210)
>
> at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :320)
> at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :218)
> at ExampleLauncher.main(ExampleLauncher.java:68)
>
> In fact, I CAN load .ecore models via this sample code... But
> apparently no .uml models.
>
> Any ideas ?
>
> Regards,
>
> Laurent
>

--------------040509020302060109050906
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Laurent,<br>
<br>
It's best to ask about UML things on the UML2 newsgroup (I've added it
to the "to" list of the reply) and ask about compare on the EMFT
newsgroup.
Re: Impossible to load UML model via Java code [message #477710 is a reply to message #477709] Mon, 08 September 2008 13:31 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_0032_01C91195.A8ADC6D0
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

Hi Ed, Laurent,

The thread entitled "Continuing saga of the standalone app" has a =
complete project attached that demonstrates how to load a model (from a =
post on 7/22/2008).

In addition, have a look at =
http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_G=
uide/guide.html
in the section "Programmatic Migration".

.... some other points...

Magic Draw has some known compatibility issues when it comes to its =
serialized format. For example, lowerValue of MultiplicityElement's =
sometimes is initialzed out with type uml:Integer with a value of '*' =
and sometimes as uml:LiteralInteger. lowerValue should be a =
ValueSpecification and so uml:Integer would be incorrect and '*' should =
only apply to LiteralUnlimitedNatural.

If the migration guides still do not help you, perhaps you could post a =
snippet of the model that demonstrates the isssue.

Cheers,
- James.



"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:ga34k3$n8a$1@build.eclipse.org...
Laurent,

It's best to ask about UML things on the UML2 newsgroup (I've added it =
to the "to" list of the reply) and ask about compare on the EMFT =
newsgroup. Be sure to read the UML2 FAQ:

=
http://wiki.eclipse.org/MDT-UML2-FAQ#What.27s_required_to_lo ad_a_UML_.28.=
uml.29_resource_from_a_standalone_application.3F

And use google to find related similar questions:

=
http://www.google.com/cse?cx=3D017941334893793413703%3Asqfrd td112s&q=3DUM=
L+load+stand+alone&sa=3DSearch



Laurent Roubele wrote:=20
Hello,=20

I'm trying to load a model via java (emf) in order to merge it with =
another one... My UML model (.uml) was exported from Magic Draw into =
"EMF UML (v2.x) XMI". Here is my code :=20

=20
    import java.io.File;=20
    import java.io.IOException;=20
    import java.util.ArrayList;=20
    import java.util.Calendar;=20
    import java.util.Collections;=20
    import java.util.List;=20

    import org.eclipse.emf.compare.diff.merge.service.MergeService;=20
    import org.eclipse.emf.compare.diff.metamodel.DiffElement;=20
    import org.eclipse.emf.compare.diff.metamodel.DiffFactory;=20
    import org.eclipse.emf.compare.diff.metamodel.DiffModel;=20
    import org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot;=20
    import org.eclipse.emf.compare.diff.service.DiffService;=20
    import org.eclipse.emf.compare.match.metamodel.MatchModel;=20
    import org.eclipse.emf.compare.match.service.MatchService;=20
    import org.eclipse.emf.compare.util.ModelUtils;=20
    import org.eclipse.emf.ecore.EObject;=20
    import org.eclipse.emf.ecore.resource.Resource;=20
    import org.eclipse.emf.ecore.resource.ResourceSet;=20
    import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;=20
    import org.eclipse.uml2.uml.UMLPackage;=20
    import org.eclipse.uml2.uml.resource.UMLResource;=20

    public final class ExampleLauncher {=20
      /**=20
      * This class doesn't need to be instantiated.=20
      */=20
      private ExampleLauncher() {=20
      // prevents instantiation=20
    }=20

    public static void main(String[] args) {=20
      // Creates the resourceSet where we'll load the models=20
      final ResourceSet resourceSet =3D new ResourceSetImpl();=20

      // Register additional packages here. For UML2:=20
      Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put( =

      UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);=20
      resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,=20
      UMLPackage.eINSTANCE);=20

      try {=20
         System.out.println("Loading resources.\n"); //$NON-NLS-1$=20
         // Loads the model to modify=20
         final EObject model1 =3D ModelUtils.load(new =
File("D:/eclipse/workspace/EMFTEST/model/model.uml"),resourceSet);=20

         System.out.println("Loaded.");=20
      } catch (Exception e) { // shouldn't be thrown=20
         e.printStackTrace();=20
      }=20
      }=20
    }=20
    
=20

When I launch this sample I got a exception:=20
Loading resources.=20

java.lang.NullPointerException=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XML=
Handler.java:2132)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:20=
10)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:13=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1=
789)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1013)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n Source)=20
at =
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown Source)=20
at javax.xml.parsers.SAXParser.parse(Unknown Source)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n Source)=20
at =
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown Source)=20
at javax.xml.parsers.SAXParser.parse(Unknown Source)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n Source)=20
at =
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown Source)=20
at javax.xml.parsers.SAXParser.parse(Unknown Source)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n Source)=20
at =
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown Source)=20
at javax.xml.parsers.SAXParser.parse(Unknown Source)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
210)=20
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :320) =

at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :218) =

at ExampleLauncher.main(ExampleLauncher.java:68)=20

In fact, I CAN load .ecore models via this sample code... But =
apparently no .uml models.=20

Any ideas ?=20

Regards,=20

Laurent=20


------=_NextPart_000_0032_01C91195.A8ADC6D0
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-15>
<META content=3D"MSHTML 6.00.2900.3268" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Ed, Laurent,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The thread entitled "Continuing saga of =
the=20
standalone app" has a complete project attached that demonstrates how to =
load a=20
model (from a post on 7/22/2008).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In addition, have a look at <A=20
href=3D" http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Mig=
ration_Guide/guide.html">http://www.eclipse.org/modeling/mdt/uml2/docs/gu=
ides/UML2_2.0_Migration_Guide/guide.html</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in the section "Programmatic=20
Migration".</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>... some other points...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Magic Draw has some known compatibility =
issues when=20
it comes to its serialized format.&nbsp;&nbsp; For example, lowerValue =
of=20
MultiplicityElement's sometimes is initialzed out with type uml:Integer =
with a=20
value of '*' and sometimes as uml:LiteralInteger.&nbsp;&nbsp; lowerValue =
should=20
be a ValueSpecification and so uml:Integer would be incorrect and '*' =
should=20
only apply to LiteralUnlimitedNatural.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>If the migration guides still do not =
help you,=20
perhaps you could post a snippet of the model that demonstrates the=20
isssue.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>- James.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:ga34k3$n8a$1@build.eclipse.org">news:ga34k3$n8a$1@build.ecli=
pse.org</A>...</DIV>Laurent,<BR><BR>It's=20
best to ask about UML things on the UML2 newsgroup (I've added it to =
the "to"=20
list of the reply) and ask about compare on the EMFT newsgroup.&nbsp; =
Be sure=20
to read the UML2 FAQ:<BR>
<BLOCKQUOTE><A=20
=
href=3D" http://wiki.eclipse.org/MDT-UML2-FAQ#What.27s_required_to_lo ad_a_=
UML_.28.uml.29_resource_from_a_standalone_application.3F">http://wiki.ecl=
ipse.org/MDT-UML2-FAQ#What.27s_required_to_load_a_UML_.28.um l.29_resource=
_from_a_standalone_application.3F</A><BR></BLOCKQUOTE>And=20
use google to find related similar questions:<BR>
<BLOCKQUOTE><A=20
=
href=3D" http://www.google.com/cse?cx=3D017941334893793413703%3Asqfrd td112=
s&amp;q=3DUML+load+stand+alone&amp;sa=3DSearch">http://www.google.com/cse=
?cx=3D017941334893793413703%3Asqfrdtd112s&amp;q=3DUML+lo ad+stand+alone&am=
p;sa=3DSearch<BR></A></BLOCKQUOTE><BR><BR>Laurent=20
Roubele wrote:=20
<BLOCKQUOTE =
cite=3Dmid:7fc92e8294bf0def37c8cbc8d8ed4ac6$1@www.eclipse.org=20
type=3D"cite">Hello, <BR><BR>I'm trying to load a model via java (emf) =
in=20
order to merge it with another one... My UML model (.uml) was =
exported from=20
Magic Draw into "EMF UML (v2.x) XMI". Here is my code : =
<BR><BR>
=20
    <BR>import java.io.File; <BR>import java.io.IOException; <BR>import=20
    java.util.ArrayList; <BR>import java.util.Calendar; <BR>import=20
    java.util.Collections; <BR>import java.util.List; <BR><BR>import=20
    org.eclipse.emf.compare.diff.merge.service.MergeService; <BR>import=20
    org.eclipse.emf.compare.diff.metamodel.DiffElement; <BR>import=20
    org.eclipse.emf.compare.diff.metamodel.DiffFactory; <BR>import=20
    org.eclipse.emf.compare.diff.metamodel.DiffModel; <BR>import=20
    org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot; =
<BR>import=20
    org.eclipse.emf.compare.diff.service.DiffService; <BR>import=20
    org.eclipse.emf.compare.match.metamodel.MatchModel; <BR>import=20
    org.eclipse.emf.compare.match.service.MatchService; <BR>import=20
    org.eclipse.emf.compare.util.ModelUtils; <BR>import=20
    org.eclipse.emf.ecore.EObject; <BR>import=20
    org.eclipse.emf.ecore.resource.Resource; <BR>import=20
    org.eclipse.emf.ecore.resource.ResourceSet; <BR>import=20
    org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; <BR>import=20
    org.eclipse.uml2.uml.UMLPackage; <BR>import=20
    org.eclipse.uml2.uml.resource.UMLResource; <BR><BR>public final =
class=20
    ExampleLauncher { <BR>&nbsp; /** <BR>&nbsp; * This class doesn't =
need to be=20
    instantiated. <BR>&nbsp; */ <BR>&nbsp; private ExampleLauncher() {=20
    <BR>&nbsp; // prevents instantiation <BR>} <BR><BR>public static =
void=20
    main(String[] args) { <BR>&nbsp; // Creates the resourceSet where =
we'll load=20
    the models <BR>&nbsp; final ResourceSet resourceSet =3D new =
ResourceSetImpl();=20
    <BR><BR>&nbsp; // Register additional packages here. For UML2: =
<BR>&nbsp;=20
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(=20
    <BR>&nbsp; UMLResource.FILE_EXTENSION, =
UMLResource.Factory.INSTANCE);=20
    <BR>&nbsp; resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,=20
    <BR>&nbsp; UMLPackage.eINSTANCE); <BR><BR>&nbsp; try {=20
    <BR>&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Loading =
resources.\n");=20
    //$NON-NLS-1$ <BR>&nbsp;&nbsp;&nbsp;&nbsp; // Loads the model to =
modify=20
    <BR>&nbsp;&nbsp;&nbsp;&nbsp; final EObject model1 =3D =
ModelUtils.load(new=20
    File("D:/eclipse/workspace/EMFTEST/model/model.uml"),resourceSet);=20
    <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Loaded."); =
<BR>&nbsp; }=20
    catch (Exception e) { // shouldn't be thrown =
<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
    e.printStackTrace(); <BR>&nbsp; } <BR>&nbsp; } <BR>} <BR>
=20
<BR><BR>When I launch this sample I got a exception: <BR>Loading =
resources.=20
<BR><BR>java.lang.NullPointerException <BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XML=
Handler.java:2132)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:20=
10)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:13=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1=
789)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1013)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source) <BR>at javax.xml.parsers.SAXParser.parse(Unknown Source) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source) <BR>at javax.xml.parsers.SAXParser.parse(Unknown Source) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source) <BR>at javax.xml.parsers.SAXParser.parse(Unknown Source) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source) <BR>at javax.xml.parsers.SAXParser.parse(Unknown Source) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
210)=20
<BR>at =
org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :320)=20
<BR>at =
org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :218)=20
<BR>at ExampleLauncher.main(ExampleLauncher.java:68) <BR><BR>In =
fact, I CAN=20
load .ecore models via this sample code... But apparently no .uml =
models.=20
<BR><BR>Any ideas ? <BR><BR>Regards, <BR><BR>Laurent=20
<BR><BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0032_01C91195.A8ADC6D0--
Re: Impossible to load UML model via Java code [message #626904 is a reply to message #477709] Mon, 08 September 2008 13:31 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_0032_01C91195.A8ADC6D0
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

Hi Ed, Laurent,

The thread entitled "Continuing saga of the standalone app" has a =
complete project attached that demonstrates how to load a model (from a =
post on 7/22/2008).

In addition, have a look at =
http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_G=
uide/guide.html
in the section "Programmatic Migration".

.... some other points...

Magic Draw has some known compatibility issues when it comes to its =
serialized format. For example, lowerValue of MultiplicityElement's =
sometimes is initialzed out with type uml:Integer with a value of '*' =
and sometimes as uml:LiteralInteger. lowerValue should be a =
ValueSpecification and so uml:Integer would be incorrect and '*' should =
only apply to LiteralUnlimitedNatural.

If the migration guides still do not help you, perhaps you could post a =
snippet of the model that demonstrates the isssue.

Cheers,
- James.



"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:ga34k3$n8a$1@build.eclipse.org...
Laurent,

It's best to ask about UML things on the UML2 newsgroup (I've added it =
to the "to" list of the reply) and ask about compare on the EMFT =
newsgroup. Be sure to read the UML2 FAQ:

=
http://wiki.eclipse.org/MDT-UML2-FAQ#What.27s_required_to_lo ad_a_UML_.28.=
uml.29_resource_from_a_standalone_application.3F

And use google to find related similar questions:

=
http://www.google.com/cse?cx=3D017941334893793413703%3Asqfrd td112s&q=3DUM=
L+load+stand+alone&sa=3DSearch



Laurent Roubele wrote:=20
Hello,=20

I'm trying to load a model via java (emf) in order to merge it with =
another one... My UML model (.uml) was exported from Magic Draw into =
"EMF UML (v2.x) XMI". Here is my code :=20

=20
    import java.io.File;=20
    import java.io.IOException;=20
    import java.util.ArrayList;=20
    import java.util.Calendar;=20
    import java.util.Collections;=20
    import java.util.List;=20

    import org.eclipse.emf.compare.diff.merge.service.MergeService;=20
    import org.eclipse.emf.compare.diff.metamodel.DiffElement;=20
    import org.eclipse.emf.compare.diff.metamodel.DiffFactory;=20
    import org.eclipse.emf.compare.diff.metamodel.DiffModel;=20
    import org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot;=20
    import org.eclipse.emf.compare.diff.service.DiffService;=20
    import org.eclipse.emf.compare.match.metamodel.MatchModel;=20
    import org.eclipse.emf.compare.match.service.MatchService;=20
    import org.eclipse.emf.compare.util.ModelUtils;=20
    import org.eclipse.emf.ecore.EObject;=20
    import org.eclipse.emf.ecore.resource.Resource;=20
    import org.eclipse.emf.ecore.resource.ResourceSet;=20
    import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;=20
    import org.eclipse.uml2.uml.UMLPackage;=20
    import org.eclipse.uml2.uml.resource.UMLResource;=20

    public final class ExampleLauncher {=20
      /**=20
      * This class doesn't need to be instantiated.=20
      */=20
      private ExampleLauncher() {=20
      // prevents instantiation=20
    }=20

    public static void main(String[] args) {=20
      // Creates the resourceSet where we'll load the models=20
      final ResourceSet resourceSet =3D new ResourceSetImpl();=20

      // Register additional packages here. For UML2:=20
      Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put( =

      UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);=20
      resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,=20
      UMLPackage.eINSTANCE);=20

      try {=20
         System.out.println("Loading resources.\n"); //$NON-NLS-1$=20
         // Loads the model to modify=20
         final EObject model1 =3D ModelUtils.load(new =
File("D:/eclipse/workspace/EMFTEST/model/model.uml"),resourceSet);=20

         System.out.println("Loaded.");=20
      } catch (Exception e) { // shouldn't be thrown=20
         e.printStackTrace();=20
      }=20
      }=20
    }=20
    
=20

When I launch this sample I got a exception:=20
Loading resources.=20

java.lang.NullPointerException=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XML=
Handler.java:2132)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:20=
10)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:13=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1=
789)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1013)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n Source)=20
at =
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown Source)=20
at javax.xml.parsers.SAXParser.parse(Unknown Source)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n Source)=20
at =
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown Source)=20
at javax.xml.parsers.SAXParser.parse(Unknown Source)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n Source)=20
at =
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown Source)=20
at javax.xml.parsers.SAXParser.parse(Unknown Source)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
at =
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n Source)=20
at =
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown Source)=20
at javax.xml.parsers.SAXParser.parse(Unknown Source)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)=20
at =
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
at =
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
210)=20
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :320) =

at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :218) =

at ExampleLauncher.main(ExampleLauncher.java:68)=20

In fact, I CAN load .ecore models via this sample code... But =
apparently no .uml models.=20

Any ideas ?=20

Regards,=20

Laurent=20


------=_NextPart_000_0032_01C91195.A8ADC6D0
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-15>
<META content=3D"MSHTML 6.00.2900.3268" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Ed, Laurent,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The thread entitled "Continuing saga of =
the=20
standalone app" has a complete project attached that demonstrates how to =
load a=20
model (from a post on 7/22/2008).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In addition, have a look at <A=20
href=3D" http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Mig=
ration_Guide/guide.html">http://www.eclipse.org/modeling/mdt/uml2/docs/gu=
ides/UML2_2.0_Migration_Guide/guide.html</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in the section "Programmatic=20
Migration".</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>... some other points...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Magic Draw has some known compatibility =
issues when=20
it comes to its serialized format.&nbsp;&nbsp; For example, lowerValue =
of=20
MultiplicityElement's sometimes is initialzed out with type uml:Integer =
with a=20
value of '*' and sometimes as uml:LiteralInteger.&nbsp;&nbsp; lowerValue =
should=20
be a ValueSpecification and so uml:Integer would be incorrect and '*' =
should=20
only apply to LiteralUnlimitedNatural.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>If the migration guides still do not =
help you,=20
perhaps you could post a snippet of the model that demonstrates the=20
isssue.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>- James.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:ga34k3$n8a$1@build.eclipse.org">news:ga34k3$n8a$1@build.ecli=
pse.org</A>...</DIV>Laurent,<BR><BR>It's=20
best to ask about UML things on the UML2 newsgroup (I've added it to =
the "to"=20
list of the reply) and ask about compare on the EMFT newsgroup.&nbsp; =
Be sure=20
to read the UML2 FAQ:<BR>
<BLOCKQUOTE><A=20
=
href=3D" http://wiki.eclipse.org/MDT-UML2-FAQ#What.27s_required_to_lo ad_a_=
UML_.28.uml.29_resource_from_a_standalone_application.3F">http://wiki.ecl=
ipse.org/MDT-UML2-FAQ#What.27s_required_to_load_a_UML_.28.um l.29_resource=
_from_a_standalone_application.3F</A><BR></BLOCKQUOTE>And=20
use google to find related similar questions:<BR>
<BLOCKQUOTE><A=20
=
href=3D" http://www.google.com/cse?cx=3D017941334893793413703%3Asqfrd td112=
s&amp;q=3DUML+load+stand+alone&amp;sa=3DSearch">http://www.google.com/cse=
?cx=3D017941334893793413703%3Asqfrdtd112s&amp;q=3DUML+lo ad+stand+alone&am=
p;sa=3DSearch<BR></A></BLOCKQUOTE><BR><BR>Laurent=20
Roubele wrote:=20
<BLOCKQUOTE =
cite=3Dmid:7fc92e8294bf0def37c8cbc8d8ed4ac6$1@www.eclipse.org=20
type=3D"cite">Hello, <BR><BR>I'm trying to load a model via java (emf) =
in=20
order to merge it with another one... My UML model (.uml) was =
exported from=20
Magic Draw into "EMF UML (v2.x) XMI". Here is my code : =
<BR><BR>
=20
    <BR>import java.io.File; <BR>import java.io.IOException; <BR>import=20
    java.util.ArrayList; <BR>import java.util.Calendar; <BR>import=20
    java.util.Collections; <BR>import java.util.List; <BR><BR>import=20
    org.eclipse.emf.compare.diff.merge.service.MergeService; <BR>import=20
    org.eclipse.emf.compare.diff.metamodel.DiffElement; <BR>import=20
    org.eclipse.emf.compare.diff.metamodel.DiffFactory; <BR>import=20
    org.eclipse.emf.compare.diff.metamodel.DiffModel; <BR>import=20
    org.eclipse.emf.compare.diff.metamodel.ModelInputSnapshot; =
<BR>import=20
    org.eclipse.emf.compare.diff.service.DiffService; <BR>import=20
    org.eclipse.emf.compare.match.metamodel.MatchModel; <BR>import=20
    org.eclipse.emf.compare.match.service.MatchService; <BR>import=20
    org.eclipse.emf.compare.util.ModelUtils; <BR>import=20
    org.eclipse.emf.ecore.EObject; <BR>import=20
    org.eclipse.emf.ecore.resource.Resource; <BR>import=20
    org.eclipse.emf.ecore.resource.ResourceSet; <BR>import=20
    org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; <BR>import=20
    org.eclipse.uml2.uml.UMLPackage; <BR>import=20
    org.eclipse.uml2.uml.resource.UMLResource; <BR><BR>public final =
class=20
    ExampleLauncher { <BR>&nbsp; /** <BR>&nbsp; * This class doesn't =
need to be=20
    instantiated. <BR>&nbsp; */ <BR>&nbsp; private ExampleLauncher() {=20
    <BR>&nbsp; // prevents instantiation <BR>} <BR><BR>public static =
void=20
    main(String[] args) { <BR>&nbsp; // Creates the resourceSet where =
we'll load=20
    the models <BR>&nbsp; final ResourceSet resourceSet =3D new =
ResourceSetImpl();=20
    <BR><BR>&nbsp; // Register additional packages here. For UML2: =
<BR>&nbsp;=20
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(=20
    <BR>&nbsp; UMLResource.FILE_EXTENSION, =
UMLResource.Factory.INSTANCE);=20
    <BR>&nbsp; resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,=20
    <BR>&nbsp; UMLPackage.eINSTANCE); <BR><BR>&nbsp; try {=20
    <BR>&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Loading =
resources.\n");=20
    //$NON-NLS-1$ <BR>&nbsp;&nbsp;&nbsp;&nbsp; // Loads the model to =
modify=20
    <BR>&nbsp;&nbsp;&nbsp;&nbsp; final EObject model1 =3D =
ModelUtils.load(new=20
    File("D:/eclipse/workspace/EMFTEST/model/model.uml"),resourceSet);=20
    <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Loaded."); =
<BR>&nbsp; }=20
    catch (Exception e) { // shouldn't be thrown =
<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
    e.printStackTrace(); <BR>&nbsp; } <BR>&nbsp; } <BR>} <BR>
=20
<BR><BR>When I launch this sample I got a exception: <BR>Loading =
resources.=20
<BR><BR>java.lang.NullPointerException <BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFe atureType(XML=
Handler.java:2132)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:20=
10)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:13=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1=
789)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1013)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source) <BR>at javax.xml.parsers.SAXParser.parse(Unknown Source) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source) <BR>at javax.xml.parsers.SAXParser.parse(Unknown Source) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source) <BR>at javax.xml.parsers.SAXParser.parse(Unknown Source) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.jav=
a:2516)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.=
java:2397)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.j=
ava:1275)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java=
:1444)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:=
1009)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:=
87)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:99=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:71=
1)=20
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:16=
7)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement=
(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.empt=
yElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anStartElement(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$Fr=
agmentContentDriver.next(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source) <BR>at=20
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown =
Source)=20
<BR>at=20
=
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source) <BR>at=20
=
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source) <BR>at javax.xml.parsers.SAXParser.parse(Unknown Source) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181) =
<BR>at=20
=
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
414)=20
<BR>at=20
=
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
210)=20
<BR>at =
org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :320)=20
<BR>at =
org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :218)=20
<BR>at ExampleLauncher.main(ExampleLauncher.java:68) <BR><BR>In =
fact, I CAN=20
load .ecore models via this sample code... But apparently no .uml =
models.=20
<BR><BR>Any ideas ? <BR><BR>Regards, <BR><BR>Laurent=20
<BR><BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0032_01C91195.A8ADC6D0--
Previous Topic:Re: Impossible to load UML model via Java code
Next Topic:Reverse engineering tool
Goto Forum:
  


Current Time: Wed Apr 01 02:33:49 GMT 2020

Powered by FUDForum. Page generated in 0.02135 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top