Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320095 - ClassCastException when applying Profile
Summary: ClassCastException when applying Profile
Status: RESOLVED WORKSFORME
Alias: None
Product: MDT.UML2
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Windows 7
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: UML2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 313880
  Show dependency tree
 
Reported: 2010-07-16 08:09 EDT by Nicolas Bros CLA
Modified: 2012-06-20 15:28 EDT (History)
2 users (show)

See Also:
Kenn.Hussey: juno+


Attachments
stacktrace (3.02 KB, text/plain)
2010-07-16 08:09 EDT, Nicolas Bros CLA
no flags Details
my profile (2.45 KB, application/octet-stream)
2010-07-16 08:10 EDT, Nicolas Bros CLA
no flags Details
the model I try to apply the profile on (5.73 KB, application/octet-stream)
2010-07-16 08:11 EDT, Nicolas Bros CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.