Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes
Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes [message #1007411] Tue, 05 February 2013 18:48 Go to next message
Fredrik Robertssen is currently offline Fredrik RobertssenFriend
Messages: 22
Registered: July 2009
Junior Member
Hi,

I upgraded to UML 4.0 and have some troubles reading the models when it comes to stereotypes.

The model was saved with UML2 3.2, (ergo XMI 2.1) and included a profile that was applied with the dynamic technique.

Now, when loading the model with UML 4.0, i receive the following exception:
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value '250' is not legal. (platform:/resource/example/Test.uml, 65, 132)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.loadResource(AdapterFactoryEditingDomain.java:405)

The line where loading fails is a stereotype, and the value an stored UMLPrimitiveTypes::String

Any idea why this happens?

Now, vice-versa, when I create a new model and save it useing UML 4.0, the values of the stereotypes (again, UMLPrimitiveTypes::String), are stored in a "strange" way:

<graphics:Shape xmi:id="_w4hNkPaXEeG_Gb8QAQ0kdw" x="ACED0005740003313830" y="ACED00057400023535" width="ACED0005740003363133" height="ACED00057400023534" base_Element="_wlI-kPaXEeG_Gb8QAQ0kdw"/>



Is this some sort of reference? If, so, I do not find where they point to.

Is there something I have not seen? I have read the migration guide, and I have tried to update the original profile specification, but it did not seem to change things.

Thanks for any help in advance!
Re: Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes [message #1007425 is a reply to message #1007411] Tue, 05 February 2013 19:45 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I cannot comment on the first example that is specific to your models.

The XMI serialization of stereotype applications has always been wierd
in my opinion, using XMI directly to avoid defining a proper object.

Regards

Ed Willink

On 05/02/2013 18:48, Fredrik Robertssen wrote:
> Hi,
>
> I upgraded to UML 4.0 and have some troubles reading the models when
> it comes to stereotypes.
>
> The model was saved with UML2 3.2, (ergo XMI 2.1) and included a
> profile that was applied with the dynamic technique.
>
> Now, when loading the model with UML 4.0, i receive the following
> exception:
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value '250' is not
> legal. (platform:/resource/example/Test.uml, 65, 132)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
> at
> org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.loadResource(AdapterFactoryEditingDomain.java:405)
>
> The line where loading fails is a stereotype, and the value an stored
> UMLPrimitiveTypes::String
>
> Any idea why this happens?
>
> Now, vice-versa, when I create a new model and save it useing UML 4.0,
> the values of the stereotypes (again, UMLPrimitiveTypes::String), are
> stored in a "strange" way:
> <graphics:Shape xmi:id="_w4hNkPaXEeG_Gb8QAQ0kdw"
> x="ACED0005740003313830" y="ACED00057400023535"
> width="ACED0005740003363133" height="ACED00057400023534"
> base_Element="_wlI-kPaXEeG_Gb8QAQ0kdw"/>
>
>
> Is this some sort of reference? If, so, I do not find where they point
> to.
>
> Is there something I have not seen? I have read the migration guide,
> and I have tried to update the original profile specification, but it
> did not seem to change things.
> Thanks for any help in advance!
>
Re: Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes [message #1007680 is a reply to message #1007411] Thu, 07 February 2013 04:48 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Fredrik,

Both the exception and sample XMI seem odd to me. Are you doing this
with a standalone application or from the UML editor in Eclipse? Note
that there were a number of issues with support for legacy profiles in
4.0 which have been fixed in 4.0.x releases...

Kenn

On 13-02-05 1:48 PM, Fredrik Robertssen wrote:
> Hi,
>
> I upgraded to UML 4.0 and have some troubles reading the models when it
> comes to stereotypes.
>
> The model was saved with UML2 3.2, (ergo XMI 2.1) and included a profile
> that was applied with the dynamic technique.
>
> Now, when loading the model with UML 4.0, i receive the following
> exception:
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value '250' is not
> legal. (platform:/resource/example/Test.uml, 65, 132)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
>
> at
> org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.loadResource(AdapterFactoryEditingDomain.java:405)
>
>
> The line where loading fails is a stereotype, and the value an stored
> UMLPrimitiveTypes::String
>
> Any idea why this happens?
>
> Now, vice-versa, when I create a new model and save it useing UML 4.0,
> the values of the stereotypes (again, UMLPrimitiveTypes::String), are
> stored in a "strange" way:
> <graphics:Shape xmi:id="_w4hNkPaXEeG_Gb8QAQ0kdw"
> x="ACED0005740003313830" y="ACED00057400023535"
> width="ACED0005740003363133" height="ACED00057400023534"
> base_Element="_wlI-kPaXEeG_Gb8QAQ0kdw"/>
>
>
> Is this some sort of reference? If, so, I do not find where they point to.
>
> Is there something I have not seen? I have read the migration guide, and
> I have tried to update the original profile specification, but it did
> not seem to change things.
> Thanks for any help in advance!
>
Re: Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes [message #1008096 is a reply to message #1007680] Fri, 08 February 2013 22:39 Go to previous messageGo to next message
Fredrik Robertssen is currently offline Fredrik RobertssenFriend
Messages: 22
Registered: July 2009
Junior Member
Hi Ken,

this happens in a plugin that loads UML models, within Eclipse. But I have tried to open the *.uml files also in the UML 2 Editor in Eclipse, with basically the same exception:

Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value '180' is not legal. (platform:/resource/GUI.uml, 112, 131)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2671)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2725)
	at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2200)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1337)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1475)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:81)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1529)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1308)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	... 8 more
Caused by: java.lang.NullPointerException
	at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1121)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2666)
	... 36 more



Since you mentioned that some legacy issues have been fixed, I have tried with both UML 4.0.1 and especially 4.1.0 M5, with the same behavior. I have also re-applied the profile.

Is there anything else that has been changed from UML 3.2.0 towards 4.0 that could cause this?

The profile is stored in a plugin and contributed by a pathmap, via extension point org.eclipse.emf.ecore.uri_mapping.

Thanks for al feedback,

Fredrik
Re: Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes [message #1008100 is a reply to message #1008096] Fri, 08 February 2013 23:04 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Hmm, it's hard to tell what's happening from the stack trace along. If
you can share a representative profile that demonstrates the problem
I'll try to debug it to figure out what's happening...

Kenn

On 13-02-08 5:39 PM, Fredrik Robertssen wrote:
> Hi Ken,
>
> this happens in a plugin that loads UML models, within Eclipse. But I
> have tried to open the *.uml files also in the UML 2 Editor in Eclipse,
> with basically the same exception:
>
> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value '180'
> is not legal. (platform:/resource/GUI.uml, 112, 131)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2671)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2725)
>
> at
> org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2200)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1337)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1475)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:81)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
>
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
>
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
>
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
>
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
>
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
>
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1529)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1308)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
>
> ... 8 more
> Caused by: java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1121)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2666)
>
> ... 36 more
>
>
> Since you mentioned that some legacy issues have been fixed, I have
> tried with both UML 4.0.1 and especially 4.1.0 M5, with the same
> behavior. I have also re-applied the profile.
> Is there anything else that has been changed from UML 3.2.0 towards 4.0
> that could cause this?
> The profile is stored in a plugin and contributed by a pathmap, via
> extension point org.eclipse.emf.ecore.uri_mapping.
> Thanks for al feedback,
>
> Fredrik
Re: Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes [message #1053545 is a reply to message #1008100] Mon, 06 May 2013 13:10 Go to previous messageGo to next message
Fredrik Robertssen is currently offline Fredrik RobertssenFriend
Messages: 22
Registered: July 2009
Junior Member
Hi,

thanks for the hints, that helped to narrow the problem down. It seems to have to do with the primitive type that is used for one of the stereotype values. It should be a string, and the chosen type was like the following:

<eStructuralFeaturesxmi:type="ecore:EAttribute"xmi:id="_geG1w4uAEdytfOWtpACIqw"name="x"ordered="false"lowerBound="1"]]>
          <eTypexmi:type="ecore:EDataType"href="http://www.eclipse.org/uml2/3.0.0/UML#//String"/>
        </eStructuralFeatures]]>


However, when the profile is updated to this one, also UML 4 can import it:

<eStructuralFeaturesxmi:type="ecore:EAttribute"xmi:id="_f-IIgrZDEeKRqIn5WJZUCg"name="x"ordered="false"lowerBound="1"]]>
          <eTypexmi:type="ecore:EDataType"href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
        </eStructuralFeatures]]>



I guess this has to do with the overhaul of the resources provided with UML 4, as explained here:
http://wiki.eclipse.org/MDT/UML2/UML2_4.0_Migration_Guide#Resources

Is there a "smart" way to fix this? I will try to experiment with updating the type references and profiles.

Thanks again for the help provided!

Fredrik
Re: Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes [message #1053602 is a reply to message #1053545] Mon, 06 May 2013 17:06 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

http://www.eclipse.org/emf/2002/Ecore#//EString seems like a really bad
idea for a 'UML' model.

Have you tried http://www.eclipse.org/uml2/4.0.0/Types#//String ?

Regards

Ed Willink

On 06/05/2013 14:10, Fredrik Robertssen wrote:
> Hi,
>
> thanks for the hints, that helped to narrow the problem down. It seems
> to have to do with the primitive type that is used for one of the
> stereotype values. It should be a string, and the chosen type was like
> the following:
>
>
> <eStructuralFeaturesxmi:type="ecore:EAttribute"xmi:id="_geG1w4uAEdytfOWtpACIqw"name="x"ordered="false"lowerBound="1"]]>
>
> <eTypexmi:type="ecore:EDataType"href="http://www.eclipse.org/uml2/3.0.0/UML#//String"/>
> </eStructuralFeatures]]>
>
>
> However, when the profile is updated to this one, also UML 4 can
> import it:
>
>
> <eStructuralFeaturesxmi:type="ecore:EAttribute"xmi:id="_f-IIgrZDEeKRqIn5WJZUCg"name="x"ordered="false"lowerBound="1"]]>
>
> <eTypexmi:type="ecore:EDataType"href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eStructuralFeatures]]>
>
>
>
> I guess this has to do with the overhaul of the resources provided
> with UML 4, as explained here:
> http://wiki.eclipse.org/MDT/UML2/UML2_4.0_Migration_Guide#Resources
>
> Is there a "smart" way to fix this? I will try to experiment with
> updating the type references and profiles.
> Thanks again for the help provided!
>
> Fredrik
Previous Topic:How to get default value of Enumeration Literal in UML?
Next Topic:how to migrate uml to new definitions
Goto Forum:
  


Current Time: Tue Mar 19 04:54:26 GMT 2024

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

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

Back to the top