Discussion:
[mdr-users] Invalid sub-element: UML:TaggedValue
Chris K Wensel
2007-05-01 17:09:16 UTC
Permalink
Hi all

I'm attempting to read an Enterprise Architect exported XMI file (UML
1.4 / XMI 1.2).

I am excluding EA created TaggedValue instances on the export, but I
have many of my own that are being exported from my model.

unfortunately I'm getting the below stack trace.

i inspected the XMI and i can't find any obvious issues with the
TaggedValue elements. all TagDefinitions have tagType as String.

also, this is all brokered through AndroMDA. but the exceptions are
being thrown from netbeans jmi.

any suggestions?

[INFO] org.netbeans.lib.jmi.util.DebugException: Invalid sub-element:
UML:TaggedValue
[INFO] at org.netbeans.lib.jmi.xmi.XmiElement
$Instance.startSubElement(XmiElement.java:508)
[INFO] at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement
(XmiSAXReader.java:219)
[INFO] at org.apache.xerces.parsers.AbstractSAXParser.startElement
(Unknown Source)
[INFO] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement
(Unknown Source)
[INFO] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDispatcher.dispatch(Unknown Source)
[INFO] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
[INFO] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
[INFO] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
[INFO] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[INFO] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
[INFO] at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
[INFO] at org.netbeans.lib.jmi.xmi.XmiSAXReader.read
(XmiSAXReader.java:136)
[INFO] at org.netbeans.lib.jmi.xmi.XmiSAXReader.read
(XmiSAXReader.java:107)
[INFO] at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:77)
[INFO] at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:70)
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.loadModel
(MDRepositoryFacade.java:490)
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.readModel
(MDRepositoryFacade.java:117)
...
[INFO] Exception in thread "main"
org.andromda.core.repository.RepositoryFacadeException:
org.andromda.core.repository.RepositoryFacadeException:
javax.jmi.xmi.MalformedXMIException:
org.netbeans.lib.jmi.util.DebugException: Invalid sub-element:
UML:TaggedValue
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.readModel
(MDRepositoryFacade.java:124)
...
[INFO] Caused by:
org.andromda.core.repository.RepositoryFacadeException:
javax.jmi.xmi.MalformedXMIException:
org.netbeans.lib.jmi.util.DebugException: Invalid sub-element:
UML:TaggedValue
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.loadModel
(MDRepositoryFacade.java:498)
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.readModel
(MDRepositoryFacade.java:117)
[INFO] ... 6 more
[INFO] Caused by: javax.jmi.xmi.MalformedXMIException:
org.netbeans.lib.jmi.util.DebugException: Invalid sub-element:
UML:TaggedValue
[INFO] at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:83)
[INFO] at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:70)
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.loadModel
(MDRepositoryFacade.java:490)
[INFO] ... 7 more

cheers,
chris
Tom Morris
2007-05-01 17:41:14 UTC
Permalink
Post by Chris K Wensel
also, this is all brokered through AndroMDA. but the exceptions are
being thrown from netbeans jmi.
any suggestions?
MDR doesn't include the source line and column information in the exception,
but it does know it. I think it might be spitting it out to syserr or
someplace similar unless the AndroMDA folks have hooked into the
NetBeans-specific logging mechanism.

The stack trace doesn't really include any useful information other than the
summary, viz a TaggedValue is enclosed in something that it shouldn't be.
You'll probably have to provide the XMI file for anyone to give you any more
concrete feedback.

ArgoUML uses MDR as well, so that might be a quicker way to debug this
rather than firing up an AndroMDA build every time.

Tom

p.s. If you want to send me the XMI file, I can take a quick look at it and
may be able to spot the problem.
Chris K Wensel
2007-05-01 17:44:55 UTC
Permalink
excellent idea on using ArgoUML. i'll give that a shot real quick.

if that doesn't yield anything useful, i'll see if i can whittle the
model down and share it.
Post by Tom Morris
Post by Chris K Wensel
also, this is all brokered through AndroMDA. but the exceptions are
being thrown from netbeans jmi.
any suggestions?
MDR doesn't include the source line and column information in the exception,
but it does know it. I think it might be spitting it out to syserr or
someplace similar unless the AndroMDA folks have hooked into the
NetBeans-specific logging mechanism.
The stack trace doesn't really include any useful information other than the
summary, viz a TaggedValue is enclosed in something that it
shouldn't be.
You'll probably have to provide the XMI file for anyone to give you any more
concrete feedback.
ArgoUML uses MDR as well, so that might be a quicker way to debug this
rather than firing up an AndroMDA build every time.
Tom
p.s. If you want to send me the XMI file, I can take a quick look at it and
may be able to spot the problem.
Chris K Wensel
2007-05-01 18:44:00 UTC
Permalink
seems argo isn't reporting anything useful either.

unfortunately the powers that be won't let me share this model. and
some attempts at simplifying it has resulted in unbuggy xmi.

i'm currently attempting to generate a list of all the parent
elements TaggedValue is showing up in, in hopes of pinning the error
down.
Post by Chris K Wensel
excellent idea on using ArgoUML. i'll give that a shot real quick.
if that doesn't yield anything useful, i'll see if i can whittle
the model down and share it.
Post by Tom Morris
Post by Chris K Wensel
also, this is all brokered through AndroMDA. but the exceptions are
being thrown from netbeans jmi.
any suggestions?
MDR doesn't include the source line and column information in the exception,
but it does know it. I think it might be spitting it out to
syserr or
someplace similar unless the AndroMDA folks have hooked into the
NetBeans-specific logging mechanism.
The stack trace doesn't really include any useful information
other than the
summary, viz a TaggedValue is enclosed in something that it
shouldn't be.
You'll probably have to provide the XMI file for anyone to give you any more
concrete feedback.
ArgoUML uses MDR as well, so that might be a quicker way to debug this
rather than firing up an AndroMDA build every time.
Tom
p.s. If you want to send me the XMI file, I can take a quick look at it and
may be able to spot the problem.
Tom Morris
2007-05-01 18:53:59 UTC
Permalink
Post by Chris K Wensel
seems argo isn't reporting anything useful either.
I know for ArgoUML we don't (yet) hook the NetBeans error logger, so MDR is
going to be spitting this info out on the console. You'll need to start
ArgoUML from the command line to see it.

Tom
Chris K Wensel
2007-05-01 19:00:44 UTC
Permalink
not looking good..

./argouml.sh
org.netbeans.lib.jmi.util.DebugException: Invalid sub-element:
UML:TaggedValue
at org.netbeans.lib.jmi.xmi.XmiElement
$Instance.startSubElement(XmiElement.java:508)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement
(XmiSAXReader.java:219)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElemen
t(AbstractSAXParser.java:501)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canStartElement(XMLDocumentFragmentScannerImpl.java:1357)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2741)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(XMLDocumentScannerImpl.java:645)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(XMLDocumentFragmentScannerImpl.java:508)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(XML11Configuration.java:807)
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:107)
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.netbeans.lib.jmi.xmi.XmiSAXReader.read
(XmiSAXReader.java:136)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.read
(XmiSAXReader.java:107)
at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:77)
at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:70)
at org.argouml.model.mdr.XmiReaderImpl.parse
(XmiReaderImpl.java:205)
at
org.argouml.persistence.ModelMemberFilePersister.readModels
(ModelMemberFilePersister.java:283)
at org.argouml.persistence.XmiFilePersister.doLoad
(XmiFilePersister.java:264)
at org.argouml.ui.ProjectBrowser.loadProject
(ProjectBrowser.java:1479)
at org.argouml.swingext.LoadSwingWorker.construct
(LoadSwingWorker.java:68)
at org.argouml.swingext.SwingWorker.doConstruct
(SwingWorker.java:129)
at org.argouml.swingext.SwingWorker$2.run(SwingWorker.java:257)
at java.lang.Thread.run(Thread.java:637)
Post by Tom Morris
Post by Chris K Wensel
seems argo isn't reporting anything useful either.
I know for ArgoUML we don't (yet) hook the NetBeans error logger, so MDR is
going to be spitting this info out on the console. You'll need to start
ArgoUML from the command line to see it.
Tom
Chris K Wensel
2007-05-01 19:18:42 UTC
Permalink
found the issue. looks likely to be either related to an outstanding
bug I have with EA or a new one.

seems in some cases, they are dropping a UML:TaggedValue element
directly inside an UML:Association element without the
UML:ModelElement.taggedValue element.

if interested, this xslt did most of the work

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:UML="org.omg.xmi.namespace.UML">

<!-- disable default passthrough template -->
<xsl:template match="text()"/>

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="comment()"/>

<xsl:template match="UML:TaggedValue">
<xsl:copy-of select="name(parent::*)"/><xsl:text> </
xsl:text><xsl:value-of select="parent::*/@xmi.id"/>
<xsl:text>
</xsl:text>
</xsl:template>

</xsl:stylesheet>

via:
xsltproc tagged.xslt output.xml | tr -d "\t" | sort | uniq

cheers,
ckw
Post by Chris K Wensel
not looking good..
./argouml.sh
UML:TaggedValue
at org.netbeans.lib.jmi.xmi.XmiElement
$Instance.startSubElement(XmiElement.java:508)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement
(XmiSAXReader.java:219)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElem
ent(AbstractSAXParser.java:501)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
.scanStartElement(XMLDocumentFragmentScannerImpl.java:1357)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2741)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next
(XMLDocumentScannerImpl.java:645)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
(XML11Configuration.java:807)
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:107)
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.netbeans.lib.jmi.xmi.XmiSAXReader.read
(XmiSAXReader.java:136)
at org.netbeans.lib.jmi.xmi.XmiSAXReader.read
(XmiSAXReader.java:107)
at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:77)
at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:70)
at org.argouml.model.mdr.XmiReaderImpl.parse
(XmiReaderImpl.java:205)
at
org.argouml.persistence.ModelMemberFilePersister.readModels
(ModelMemberFilePersister.java:283)
at org.argouml.persistence.XmiFilePersister.doLoad
(XmiFilePersister.java:264)
at org.argouml.ui.ProjectBrowser.loadProject
(ProjectBrowser.java:1479)
at org.argouml.swingext.LoadSwingWorker.construct
(LoadSwingWorker.java:68)
at org.argouml.swingext.SwingWorker.doConstruct
(SwingWorker.java:129)
257)
at java.lang.Thread.run(Thread.java:637)
Post by Tom Morris
Post by Chris K Wensel
seems argo isn't reporting anything useful either.
I know for ArgoUML we don't (yet) hook the NetBeans error logger, so MDR is
going to be spitting this info out on the console. You'll need to start
ArgoUML from the command line to see it.
Tom
Pete Rivett
2007-05-02 02:05:05 UTC
Permalink
Hi Chris,
I have not tried your specific flavor of file from EA, but know of
problems with TaggedValue in their UML 1.3 format - which I created a
XSL stylesheet to fix.
I suspect that here the problem might be different since at UML 1.4 any
ModelElement can contain taggedValues. So the problem might be that
UML:TaggedValue is nested directly underneath an element such a Class
without an intermediate UML:ModelElement.taggedValue element
representing the association.
If you cannot send your actual model try a very basic model with Tags
saved in the same format and send me that (I don't have EA myself so
cannot try).
From experience I think you'll hit a few more problems with EA files
even once you have surmounted this one. I can probably help too having
trodden this route before in order to integrate such UML tools with my
company's own MOF-based repository.

Regards
Pete

Pete Rivett (mailto:***@adaptive.com)
CTO, Adaptive Inc.
Hello House, 135 Somerford Road, Christchurch, BH23 3PY, UK
Tel: +44 (0)1202 491243 Fax: +44 (0)1202 491241
http://www.adaptive.com
-----Original Message-----
Sent: Tuesday, May 01, 2007 6:09 PM
Subject: [mdr-users] Invalid sub-element: UML:TaggedValue
Hi all
I'm attempting to read an Enterprise Architect exported XMI
file (UML
1.4 / XMI 1.2).
I am excluding EA created TaggedValue instances on the export, but I
have many of my own that are being exported from my model.
unfortunately I'm getting the below stack trace.
i inspected the XMI and i can't find any obvious issues with the
TaggedValue elements. all TagDefinitions have tagType as String.
also, this is all brokered through AndroMDA. but the exceptions are
being thrown from netbeans jmi.
any suggestions?
[INFO] org.netbeans.lib.jmi.util.DebugException: Invalid
UML:TaggedValue
[INFO] at org.netbeans.lib.jmi.xmi.XmiElement
$Instance.startSubElement(XmiElement.java:508)
[INFO] at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement
(XmiSAXReader.java:219)
[INFO] at org.apache.xerces.parsers.AbstractSAXParser.startElement
(Unknown Source)
[INFO] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
tElement
(Unknown Source)
[INFO] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDispatcher.dispatch(Unknown Source)
[INFO] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
[INFO] at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
[INFO] at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
[INFO] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[INFO] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
[INFO] at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
[INFO] at org.netbeans.lib.jmi.xmi.XmiSAXReader.read
(XmiSAXReader.java:136)
[INFO] at org.netbeans.lib.jmi.xmi.XmiSAXReader.read
(XmiSAXReader.java:107)
[INFO] at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:77)
[INFO] at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:70)
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.loadModel
(MDRepositoryFacade.java:490)
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.readModel
(MDRepositoryFacade.java:117)
...
[INFO] Exception in thread "main"
UML:TaggedValue
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.readModel
(MDRepositoryFacade.java:124)
...
UML:TaggedValue
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.loadModel
(MDRepositoryFacade.java:498)
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.readModel
(MDRepositoryFacade.java:117)
[INFO] ... 6 more
UML:TaggedValue
[INFO] at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:83)
[INFO] at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:70)
[INFO] at org.andromda.repositories.mdr.MDRepositoryFacade.loadModel
(MDRepositoryFacade.java:490)
[INFO] ... 7 more
cheers,
chris
Loading...