Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320095

Summary: ClassCastException when applying Profile
Product: [Modeling] MDT.UML2 Reporter: Nicolas Bros <nicolas.bros>
Component: CoreAssignee: UML2 Inbox <mdt-uml2-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P2 CC: gdupe, Kenn.Hussey
Version: 3.0.0Flags: Kenn.Hussey: juno+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 313880    
Attachments:
Description Flags
stacktrace
none
my profile
none
the model I try to apply the profile on none

Description Nicolas Bros CLA 2010-07-16 08:09:58 EDT
Created attachment 174483 [details]
stacktrace

I created an UML2 profile, following this tutorial:
http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Introduction_to_UML2_Profiles/article.html

When I try to apply my profile by clicking on the UML2 editor's action "UML Editor > Package > Apply Profile..." (with my Model element selected in the editor), I get a ClassCastException (see attached stacktrace).

I am using UML2 3.0.0.v201005031530 and Eclipse I20100527-1700.
Comment 1 Nicolas Bros CLA 2010-07-16 08:10:46 EDT
Created attachment 174484 [details]
my profile
Comment 2 Nicolas Bros CLA 2010-07-16 08:11:19 EDT
Created attachment 174485 [details]
the model I try to apply the profile on
Comment 3 Kenn Hussey CLA 2010-07-16 09:37:43 EDT
How was the model you are trying to apply the profile to produced? Its reference to the definition of the standard profile looks suspicious:

    <profileApplication xmi:id="_09M-culsEd6OiOZfp0VQ5g">
      <eAnnotations xmi:id="_09M-c-lsEd6OiOZfp0VQ5g" source="http://www.eclipse.org/uml2/2.0.0/UML">
        <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/schemas/Standard/1#/"/>
      </eAnnotations>
      <appliedProfile href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
    </profileApplication>

I would have expected the reference here (#/) not to be to the root element of the resource (i.e., the profile), but instead to the Ecore package defined within it (_yzU58YinEdqtvbnfB2L_5w).
Comment 4 Kenn Hussey CLA 2012-06-20 15:28:00 EDT
This works for me using the latest UML2 4.0 build.