As an ArgoUML contributor I'm going to blog my activities here, so that they may draw interest by other developers or help other developers when doing tasks similar to what I've done. AND(!) the grand vision that makes an Argonaut what he is, TO THRIVE IN THE BIG DANGEROUS WORLD, TAKING THE Argo TO A GOOD SHORE ;-))

Wednesday, December 30, 2009

First experiments with ArgoUML's UML2 implementation

To answer Thomas' question regarding ditching *.profile file in ArgoUML persisted projects, I started experimenting with the UML2 implementation that is currently being worked on. The problem is that I don't know it well enough to understand if it is possible to do without the file, so, I thought, well, I should experiment with the implementation and start baby stepping the ArgoUML UML Profile for C++ and the C++ module in the path to be UML2 capable.

But, here comes the pain of experimenting with a not production ready implementation – the persistence of the introduced profile projects isn't working correctly for me. Basically, it isn't loading correctly profiles which were persisted. Not so basically, when you load a *.zargo file which model (*.xmi file contained) is a profile, the case is handled exceptionally, but, correctly in org.argouml.persistence.UmlFilePersister.doLoad(File, File, ProgressMgr) (see UmlFilePersister.java:388). But, then, contrary to what I would expect, the org.argouml.persistence.ModelMemberFilePersister.readModels(InputSource) (see ModelMemberFilePersister.java:258), fails to get hold of a list of UML elements with some contents.

XMI format error : org.argouml.model.UmlException: java.io.IOException: Tag uml:Profile not found
If this file was produced by a tool other than ArgoUML, please
check to make sure that the file is in a supported format, including
both UML and XMI versions.

If you believe that the file is legal UML/XMI and should have loaded
or if it was produced by any version of ArgoUML, please report
the problem as a bug by going to http://argouml.tigris.org/project_bugs.html.
 System Info:
ArgoUML version : PRE-0.29.4
Java Version : 1.6.0_16
Java Vendor : Sun Microsystems Inc.
Java Vendor URL : http://java.sun.com/
Java Home Directory : /usr/lib/jvm/java-6-sun-1.6.0.16/jre
Java Classpath : /home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app/build-eclipse-tests:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app/build-eclipse:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-infra/lib/log4j-1.2.6.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model/build-eclipse:/home/luis/programas/eclipse-ganymede/plugins/org.junit_3.8.2.v20080602-1318/junit.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app/lib/commons-logging-1.0.2.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app/lib/gef-0.13.1M3.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app/lib/ocl-argo-1.1.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app/lib/swidgets-0.1.4.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app/lib/toolbar-1.4.1-20071227.jar:/home/luis/programacao/ArgoUML/svnco/argouml/tools/lib/easymock12.jar:/home/luis/programacao/ArgoUML/svnco/argouml/tools/jdepend-2.9/lib/jdepend-2.9.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-mdr/lib/jmi.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-mdr/lib/jmiutils.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-mdr/lib/mdrapi.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-mdr/lib/mof.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-mdr/lib/nbmdr.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-mdr/lib/openide-util.jar:/argouml-core-tools/build-eclipse:/home/luis/programacao/ArgoUML/svnco/argouml/tools/junit-3.8.2/junit.jar:/home/luis/programacao/ArgoUML/svnco/argouml/tools/apache-ant-1.7.0/lib/ant.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app/lib/antlr-2.7.7.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.common_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.ecore_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.ecore.change_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.ecore.change.edit_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.ecore.edit_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.ecore.xmi_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.edit_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.mapping_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/uml2/org.eclipse.uml2.common_1.5.0.v200905041045.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/uml2/org.eclipse.uml2.common.edit_1.5.0.v200905041045.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/uml2/org.eclipse.uml2.uml_3.0.1.v200908281330.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/uml2/org.eclipse.uml2.uml.edit_3.0.0.v200905041045.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/uml2/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/lib/emf/org.eclipse.emf.mapping.ecore2xml_2.5.0.v200906151043.jar:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-model-euml/build-eclipse:/argouml-core-infra/bin:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-diagrams-sequence2/build-eclipse:/home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-core-umlpropertypanels/build-eclipse
Operation System : Linux, Version 2.6.29-1-netbook
Architecture : i386
User Name : luis
User Home Directory : /home/luis
Current Directory : /home/luis/programacao/ArgoUML/svnco/argouml/src/argouml-app
JVM Total Memory : 23228416
JVM Free Memory : 5806928


 Error occurred at : Wed Dec 30 08:05:01 WET 2009
Cause : org.argouml.model.UmlException: java.io.IOException: Tag uml:Profile not found
at org.argouml.model.euml.XmiReaderEUMLImpl.parse(XmiReaderEUMLImpl.java:162)
at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:258)
at org.argouml.persistence.ModelMemberFilePersister.load(ModelMemberFilePersister.java:112)
at org.argouml.persistence.UmlFilePersister.doLoad(UmlFilePersister.java:389)
at org.argouml.persistence.ZargoFilePersister.doLoad(ZargoFilePersister.java:240)
at org.argouml.ui.ProjectBrowser.loadProject(ProjectBrowser.java:1577)
at org.argouml.ui.LoadSwingWorker.construct(LoadSwingWorker.java:75)
at org.argouml.ui.SwingWorker.doConstruct(SwingWorker.java:139)
at org.argouml.ui.SwingWorker$2.run(SwingWorker.java:267)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Tag uml:Profile not found
at org.argouml.persistence.XmlInputStream.realRead(XmlInputStream.java:378)
at org.argouml.persistence.XmlInputStream.skipToTag(XmlInputStream.java:226)
at org.argouml.persistence.XmlInputStream.read(XmlInputStream.java:136)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2933)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:739)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
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.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:181)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:180)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1494)
at org.argouml.model.euml.XmiReaderEUMLImpl.parse(XmiReaderEUMLImpl.java:160)
... 9 more
-------
Full exception : org.argouml.persistence.XmiFormatException: org.argouml.model.UmlException: java.io.IOException: Tag uml:Profile not found
at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:287)
at org.argouml.persistence.ModelMemberFilePersister.load(ModelMemberFilePersister.java:112)
at org.argouml.persistence.UmlFilePersister.doLoad(UmlFilePersister.java:389)
at org.argouml.persistence.ZargoFilePersister.doLoad(ZargoFilePersister.java:240)
at org.argouml.ui.ProjectBrowser.loadProject(ProjectBrowser.java:1577)
at org.argouml.ui.LoadSwingWorker.construct(LoadSwingWorker.java:75)
at org.argouml.ui.SwingWorker.doConstruct(SwingWorker.java:139)
at org.argouml.ui.SwingWorker$2.run(SwingWorker.java:267)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.argouml.model.UmlException: java.io.IOException: Tag uml:Profile not found
at org.argouml.model.euml.XmiReaderEUMLImpl.parse(XmiReaderEUMLImpl.java:162)
at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:258)
... 8 more
Caused by: java.io.IOException: Tag uml:Profile not found
at org.argouml.persistence.XmlInputStream.realRead(XmlInputStream.java:378)
at org.argouml.persistence.XmlInputStream.skipToTag(XmlInputStream.java:226)
at org.argouml.persistence.XmlInputStream.read(XmlInputStream.java:136)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2933)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:739)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
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.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:181)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:180)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1494)
at org.argouml.model.euml.XmiReaderEUMLImpl.parse(XmiReaderEUMLImpl.java:160)
... 9 more

I wanted to prepare a UML2 compatible UML profile for C++ to test that we may live without the *.profile files. But, to make this I can't create it from scratch, I need something like a UML1.4 profile to UML2.x profile conversion. Lets try to do it manually...

Using Emacs, I opened my test profile made with ArgoUML UML2 (MyUML2Profile.xmi), the base UML2.2 profile of ArgoUML (default-uml22.xmi), and the UML1.4 profile for C++ (CppUmlProfile.xmi). One thing I noticed is that the XMI format changed very much. Specifically, in the begin of the file, it is much more noisy. If you don't believe my word, check the following in default-uml22.xmi:

  • What the heck is the metaclassReference attribute and why does it have so much noise?
  • It is importing element by element many of the standard UML2.2 metamodel elements. It even does this in duplicate:
      <elementImport xmi:type="uml:ElementImport" xmi:id="_pGIiAMosEd6otN4YcPG1_w" importingNamespace="_PB5O8MoqEd6otN4YcPG1_w">
        <importedElement xmi:type="uml:Class" href="http://schema.omg.org/spec/UML/2.2/uml.xml#Abstraction"/>
      </elementImport>
      (...)
      <elementImport xmi:type="uml:ElementImport" xmi:id="_wcazEMosEd6otN4YcPG1_w" importingNamespace="_PB5O8MoqEd6otN4YcPG1_w">
        <importedElement xmi:type="uml:Class" href="http://schema.omg.org/spec/UML/2.2/uml.xml#Abstraction"/>
      </elementImport>
      
    Does this mean that you have to make this dance twice for it to work?!?

No comments:

Reader Shared items

Followers