Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: [EMF] Loading UML Magicdraw models
Re: [EMF] Loading UML Magicdraw models [message #477792] Tue, 07 October 2008 19:37 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Waldemar,

It's best to ask on the UML2 newsgroup because I don't have a clue about
how profile magic works. I've added it to the "to" list of the reply,
so no need to repost.



Waldemar Neto wrote:
> Hi,
>
> I need load UML models exported from MagicDraw. To load these models i
> configure UML environment as said in the section Programmatic
> Migration in the article:
>
> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
>
>
> Well, but when a run my program these exception is throwed:
>
> rs.emf4atl.ASMEMFModel.loadASMEMFModel(ASMEMFModel.java:365)
> at
> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:222)
>
> at
> br.edu.gmf.udt.m2m.atl.ATLExecutor.createASMMetamodel(ATLExe cutor.java:235)
>
> at
> br.edu.gmf.udt.m2m.atl.ATLExecutor.initInputModels(ATLExecut or.java:288)
> at
> br.edu.gmf.udt.m2m.atl.ATLExecutor.makeTransformation(ATLExe cutor.java:256)
>
> at
> br.edu.gmf.udt.m2m.atl.ATLExecutor.executeTransformations(AT LExecutor.java:335)
>
> at br.edu.gmf.udt.AbsExecutor.generateTests(AbsExecutor.java:28 )
> at br.edu.gmf.udt.UDTExecutor.main(UDTExecutor.java:53)
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri 'http:///_zrN_0SUoEdmNXYQzyImvfA.profile.uml2' not found.
> ( file:///C:/Users/Netuh/Desktop/eclipse%20Place/workspace/UDT 2/IN,
> 18218, 99)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2566)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2398)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1276)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1445)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1010)
>
> 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:992)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(AbstractSAXParser.java:501)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(AbstractXMLDocumentParser.java:179)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(XMLDocumentFragmentSca nnerImpl.java:2747)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(XMLDocumentScannerImpl.java:648)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.next(XMLNSDocumentScannerImpl.java:140)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java: 510)
>
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(XML11Configuration.java:807)
>
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(XML11Configuration.java:737)
>
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(X MLParser.java:107)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(AbstractSAXParser.java:1205)
>
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(SAXParserImpl.java:522)
>
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> .. 10 more
>
>
>
> Any idea is very helpful.
>
> Thanks in advance,
>
> Waldemar Neto
>
> PS: sorry if my question was a crossing question, because i usaing the
> plugin ATL for load these models.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF] Loading UML Magicdraw models [message #477795 is a reply to message #477792] Tue, 07 October 2008 22:01 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Waldemar ,

I'm no expert with MagicDraw but it is my understanding that they do not use
the opensource UML2 API and their serialization may (probably) be
incompatible.
see: http://wiki.eclipse.org/MDT-UML2-Tool-Compatibility

You will have to somehow convert their format to the .uml format before the
tips in the migration guide can help. The code in that guide indicate how
to open up models serialized with the .uml format.

Can you provide a snippet of the model you are trying to open from
MagicDraw.

Cheers,
- James.



"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:gcgdp3$udi$1@build.eclipse.org...
> Waldemar,
>
> It's best to ask on the UML2 newsgroup because I don't have a clue about
> how profile magic works. I've added it to the "to" list of the reply, so
> no need to repost.
>
>
>
> Waldemar Neto wrote:
>> Hi,
>>
>> I need load UML models exported from MagicDraw. To load these models i
>> configure UML environment as said in the section Programmatic Migration
>> in the article:
>>
>> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
>>
>> Well, but when a run my program these exception is throwed:
>>
>> rs.emf4atl.ASMEMFModel.loadASMEMFModel(ASMEMFModel.java:365)
>> at
>> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:222)
>> at
>> br.edu.gmf.udt.m2m.atl.ATLExecutor.createASMMetamodel(ATLExe cutor.java:235)
>> at
>> br.edu.gmf.udt.m2m.atl.ATLExecutor.initInputModels(ATLExecut or.java:288)
>> at
>> br.edu.gmf.udt.m2m.atl.ATLExecutor.makeTransformation(ATLExe cutor.java:256)
>> at
>> br.edu.gmf.udt.m2m.atl.ATLExecutor.executeTransformations(AT LExecutor.java:335)
>> at br.edu.gmf.udt.AbsExecutor.generateTests(AbsExecutor.java:28 )
>> at br.edu.gmf.udt.UDTExecutor.main(UDTExecutor.java:53)
>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
>> with uri 'http:///_zrN_0SUoEdmNXYQzyImvfA.profile.uml2' not found.
>> ( file:///C:/Users/Netuh/Desktop/eclipse%20Place/workspace/UDT 2/IN, 18218,
>> 99)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2566)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2398)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1276)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1445)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1010)
>> 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:992)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(AbstractSAXParser.java:501)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(AbstractXMLDocumentParser.java:179)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(XMLDocumentFragmentSca nnerImpl.java:2747)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(XMLDocumentScannerImpl.java:648)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.next(XMLNSDocumentScannerImpl.java:140)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java: 510)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(XML11Configuration.java:807)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(XML11Configuration.java:737)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(X MLParser.java:107)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(AbstractSAXParser.java:1205)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(SAXParserImpl.java:522)
>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>> .. 10 more
>>
>>
>>
>> Any idea is very helpful.
>>
>> Thanks in advance,
>>
>> Waldemar Neto
>>
>> PS: sorry if my question was a crossing question, because i usaing the
>> plugin ATL for load these models.
>>
Re: [EMF] Loading UML Magicdraw models [message #477797 is a reply to message #477795] Tue, 07 October 2008 23:39 Go to previous messageGo to next message
neto Mising name is currently offline neto Mising nameFriend
Messages: 33
Registered: July 2009
Member
hi,

well, i m sure that is compatible. Using the eclipse plugin ATL gui, the
models from Magicdraw are loaded correctly (as so as the Omondo models)
using the mdt.uml2 as metamodel. But, by the java code these exception is
throwed. I think that i need register some Resource.

i read these post, is a near problem, but i didnt understood the solution.

http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00956.html

the header of xmi generated by the magic draw is:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:MagicDrawProfile="http:///schemas/MagicDrawProfile/_CxnngHntEd2tfOBIvlYxCw/0"
xmlns:UMLProfileforJava="http:///schemas/UMLProfileforJava/_CjXwIHntEd2tfOBIvlYxCw/0"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
xsi:schemaLocation="http:///schemas/MagicDrawProfile/_CxnngHntEd2tfOBIvlYxCw/0
UML_Standard_Profile.MagicDraw_Profile.profile.uml#_Dexor3nt Ed2tfOBIvlYxCw
http:///schemas/UMLProfileforJava/_CjXwIHntEd2tfOBIvlYxCw/0
UML_Profile_for_Java.profile.uml#_DevzQXntEd2tfOBIvlYxCw">
<uml:Model xmi:id="eee_1045467100313_135436_1" name="Data" viewpoint="">
<ownedComment xmi:id="_15_5_5cd0205_1220296941577_29498_210"
body="Author:Netuh.&#xA;Created:9/1/08 4:22
PM.&#xA;Title:.&#xA;Comment:.&#xA;"
annotatedElement="eee_1045467100313_135436_1"/>
<packageImport xmi:id="_0primitiveTypesData">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
<packageImport xmi:id="_0javaPrimitiveTypesData">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/JavaPrimitiveTypes.library.uml#_0"/>
</packageImport>
...

Thanks again.

Waldemar Neto
Re: [EMF] Loading UML Magicdraw models [message #626994 is a reply to message #477792] Tue, 07 October 2008 22:01 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Waldemar ,

I'm no expert with MagicDraw but it is my understanding that they do not use
the opensource UML2 API and their serialization may (probably) be
incompatible.
see: http://wiki.eclipse.org/MDT-UML2-Tool-Compatibility

You will have to somehow convert their format to the .uml format before the
tips in the migration guide can help. The code in that guide indicate how
to open up models serialized with the .uml format.

Can you provide a snippet of the model you are trying to open from
MagicDraw.

Cheers,
- James.



"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:gcgdp3$udi$1@build.eclipse.org...
> Waldemar,
>
> It's best to ask on the UML2 newsgroup because I don't have a clue about
> how profile magic works. I've added it to the "to" list of the reply, so
> no need to repost.
>
>
>
> Waldemar Neto wrote:
>> Hi,
>>
>> I need load UML models exported from MagicDraw. To load these models i
>> configure UML environment as said in the section Programmatic Migration
>> in the article:
>>
>> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
>>
>> Well, but when a run my program these exception is throwed:
>>
>> rs.emf4atl.ASMEMFModel.loadASMEMFModel(ASMEMFModel.java:365)
>> at
>> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:222)
>> at
>> br.edu.gmf.udt.m2m.atl.ATLExecutor.createASMMetamodel(ATLExe cutor.java:235)
>> at
>> br.edu.gmf.udt.m2m.atl.ATLExecutor.initInputModels(ATLExecut or.java:288)
>> at
>> br.edu.gmf.udt.m2m.atl.ATLExecutor.makeTransformation(ATLExe cutor.java:256)
>> at
>> br.edu.gmf.udt.m2m.atl.ATLExecutor.executeTransformations(AT LExecutor.java:335)
>> at br.edu.gmf.udt.AbsExecutor.generateTests(AbsExecutor.java:28 )
>> at br.edu.gmf.udt.UDTExecutor.main(UDTExecutor.java:53)
>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
>> with uri 'http:///_zrN_0SUoEdmNXYQzyImvfA.profile.uml2' not found.
>> ( file:///C:/Users/Netuh/Desktop/eclipse%20Place/workspace/UDT 2/IN, 18218,
>> 99)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2566)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2398)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1276)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1445)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1010)
>> 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:992)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(AbstractSAXParser.java:501)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(AbstractXMLDocumentParser.java:179)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(XMLDocumentFragmentSca nnerImpl.java:2747)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(XMLDocumentScannerImpl.java:648)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.next(XMLNSDocumentScannerImpl.java:140)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java: 510)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(XML11Configuration.java:807)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(XML11Configuration.java:737)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(X MLParser.java:107)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(AbstractSAXParser.java:1205)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(SAXParserImpl.java:522)
>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>> .. 10 more
>>
>>
>>
>> Any idea is very helpful.
>>
>> Thanks in advance,
>>
>> Waldemar Neto
>>
>> PS: sorry if my question was a crossing question, because i usaing the
>> plugin ATL for load these models.
>>
Re: [EMF] Loading UML Magicdraw models [message #626996 is a reply to message #477795] Tue, 07 October 2008 23:39 Go to previous messageGo to next message
neto Mising name is currently offline neto Mising nameFriend
Messages: 33
Registered: July 2009
Member
hi,

well, i m sure that is compatible. Using the eclipse plugin ATL gui, the
models from Magicdraw are loaded correctly (as so as the Omondo models)
using the mdt.uml2 as metamodel. But, by the java code these exception is
throwed. I think that i need register some Resource.

i read these post, is a near problem, but i didnt understood the solution.

http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00956.html

the header of xmi generated by the magic draw is:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:MagicDrawProfile="http:///schemas/MagicDrawProfile/_CxnngHntEd2tfOBIvlYxCw/0"
xmlns:UMLProfileforJava="http:///schemas/UMLProfileforJava/_CjXwIHntEd2tfOBIvlYxCw/0"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
xsi:schemaLocation="http:///schemas/MagicDrawProfile/_CxnngHntEd2tfOBIvlYxCw/0
UML_Standard_Profile.MagicDraw_Profile.profile.uml#_Dexor3nt Ed2tfOBIvlYxCw
http:///schemas/UMLProfileforJava/_CjXwIHntEd2tfOBIvlYxCw/0
UML_Profile_for_Java.profile.uml#_DevzQXntEd2tfOBIvlYxCw">
<uml:Model xmi:id="eee_1045467100313_135436_1" name="Data" viewpoint="">
<ownedComment xmi:id="_15_5_5cd0205_1220296941577_29498_210"
body="Author:Netuh.&#xA;Created:9/1/08 4:22
PM.&#xA;Title:.&#xA;Comment:.&#xA;"
annotatedElement="eee_1045467100313_135436_1"/>
<packageImport xmi:id="_0primitiveTypesData">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
<packageImport xmi:id="_0javaPrimitiveTypesData">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/JavaPrimitiveTypes.library.uml#_0"/>
</packageImport>
...

Thanks again.

Waldemar Neto
Re: [EMF] Loading UML Magicdraw models [message #1722716 is a reply to message #626996] Mon, 08 February 2016 14:30 Go to previous message
Zille Huma is currently offline Zille HumaFriend
Messages: 6
Registered: February 2016
Junior Member
Hi Waldemar,

I have exactly the same problem that the model in the .uml file generated from magic draw cannot be read and there is an exception "org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl cannot be cast to org.eclipse.uml2.uml.NamedElement". Did you find a solution to this problem?
Previous Topic:How to reference UML elements from Ecore models?
Next Topic:How to convert the .uml generated from Magic draw to .ecore using UML2EcoreConverter
Goto Forum:
  


Current Time: Thu Apr 25 00:16:42 GMT 2024

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

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

Back to the top