[mdr-users] CompositionViolationException with Association

Thomas Lesniak <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <OF7ACCE336.FB144E31-ONC1256FDC.004C2A42-C1256FDC.004C2A5B@adesso.de>
Hello,

perhaps someone could help me with my problem. I'm trying to develop a tool
which creates a JMI model from a XMI file generated by Together. For this I
use some AndroMDA classes for reading the model.

The problem is that everything works fine when I draw an UML model
without any association. If I do so I get a CompositionViolationException.
I
thought the problem occured because of Together but I get the same
Exception when I create a model with MagicDraw. I'm a newbie to UML 2.0,
XMI and MDR.

I send you the generated XMI file of the model. There are only 2 classes
(Class1 & Class2) with an association between them called
'{Class1-Class2}'. The XMIReader and the MDRepositoryFacade I use are the
same that are used in AndroMDA. The metamodel is
'M2_DiagramInterchangeModel.xml'. I debugged the whole program and walked
step by step through the XMI. The problem occures in the end of the
<UML:AssociationEnd> tag at line 62 in the xml file. The
reader uses org.netbeans.lib.jmi.xmi.XMIElement which has the method
'endElement' which tries to create an RefObj (createInstance()). There you
have a list of attributes and references. With the attributes everything
works fine. When the XMIElement checks the references it tries to make a
ReferenceHandler and sets the reference
(XMIElement.ReferenceHandler.setReference()). There it tries to make 2
RefObjects and link them via RefAssociation.refAddLink(). However I
don't have the source of AOwnerFeature$Impl and cannot see where exactly
the
Exception is thrown.

Another thing confusing me is the 'export' function in together. I choose
there the XMI 1.2 and UML 1.4 (OMG) versions. But in the XML file stands:
'<XMI xmi.version = '1.2' xmlns:UML = '//org.omg/UML/1.3'>' in line 2.

In line 12 you find:
'<XMI.metamodel xmi.name = 'UML' xmi.version = '1.4'/>'

Am I using UML 1.4 now?

I hope this mail is not to detailed and comprehensible. So I'm working on
the problem since several days and would be very glad about any answer.

Thanks in advance!

Thomas Lesniak
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.