Re: [mdr-users] Restoring data from XMI
Martin Matula <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.user |
|---|---|
| Message-ID | <[email protected]> |
Olivier,
clustering is not supported for nested packages. From your description
it seems that your MoodGraphable package is nested.
Regards,
Martin
Olivier RICHAUD wrote:
>Hi Martin,
>
>I have a problem I've never had when restoring instances of object from
>XMI. When I restore my system, here are the steps I follow :
>1. I restore all my models from their corresponding XMI files. I create
>an extent - calling createExtent("name", null, null) - and use an XMI
>reader to load data into the extent.
>2. For each set of objects, I get the top level package of the
>corresponding model and pass it to createExtent - calling
>createExtent("name", topLevelPackage, null) and of course, reload with
>an XmiReader the objects.
>
>This worked fine without clustered. Now, we use clustered packages, as
>you explained how to use them. We can :
>1. load a model (see STBPM_1_7.xmi) and dynamically cluster package
>mood.diagrams so that we can make some of our class inherits from
>mood.diagrams.MoodGraphable.
>2. Of course, we can create instacnes of objects which classes are
>described into mood.diagrams.
>3. We are able to backup our model and our space of objects into XMI
>files (those which are attached). You can notice that since our classes
>inherits from MoodGraphable which has a representations association, the
>XMI contains links (see tag
>mood.diagrams.MoodGraphable.representations).
>
>In order to use clustering, we have added import directives and we pass
>a RefPackage array to createExtent (for both creating the model and the
>space) which contains a RefPackage (the extent of model containing the
>clustered package). The model is correctly restored.
>
>Now the problem is with restoring data : we can't restore data from
>STBPM2004.xmi. I get the following exception :
>
>22:07:42,223 ERROR [STDERR] org.netbeans.lib.jmi.util.DebugException:
>Element name cannot be resolved, unknown package:
>mood.diagrams.MoodGraphable.representations
>22:07:42,223 ERROR [STDERR] at
>org.netbeans.lib.jmi.xmi.XmiContext.resolveElementName(XmiContext.java:5
>27)
>22:07:42,223 ERROR [STDERR] at
>org.netbeans.lib.jmi.xmi.XmiElement$Instance.startSubElement(XmiElement.
>java:502)
>22:07:42,223 ERROR [STDERR] at
>org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:219
>)
>22:07:42,223 ERROR [STDERR] at
>org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXPars
>er.java:434)
>22:07:42,223 ERROR [STDERR] at
>org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinde
>r.java:571)
>22:07:42,233 ERROR [STDERR] at
>org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.
>java:796)
>22:07:42,233 ERROR [STDERR] at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X
>MLDocumentFragmentScannerImpl.java:752)
>22:07:42,233 ERROR [STDERR] at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
>patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1454)
>22:07:42,233 ERROR [STDERR] at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo
>cumentFragmentScannerImpl.java:333)
>22:07:42,233 ERROR [STDERR] at
>org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars
>erConfiguration.java:529)
>22:07:42,233 ERROR [STDERR] at
>org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars
>erConfiguration.java:585)
>22:07:42,233 ERROR [STDERR] at
>org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
>22:07:42,233 ERROR [STDERR] at
>org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java
>:1148)
>22:07:42,233 ERROR [STDERR] at
>javax.xml.parsers.SAXParser.parse(Unknown Source)
>22:07:42,233 ERROR [STDERR] at
>org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:136)
>22:07:42,233 ERROR [STDERR] at
>org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:98)
>22:07:42,233 ERROR [STDERR] at
>org.netbeans.lib.jmi.xmi.XMISaxReaderImpl.read(XMISaxReaderImpl.java:37)
>
>
>
>Sure, I have missed something, but what?
>
>Thanks for your help.
>
>Olivier.
>