Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332428

Summary: CDO Export does not support custom datatypes
Product: [Modeling] EMF Reporter: Carel Bast <Carel.Bast>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: Carel.Bast
Version: 4.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
EDate Fix v1
none
FeatureMap Fix v1 none

Description Carel Bast CLA 2010-12-13 07:08:38 EST
Build Identifier: 4.0.0.v20101212-1804

When exporting a CDO database (via the osgi CLI) an IAE occurs when exporting datatype like java.sql.Timestamp and CDOFeatureMapEntryImpl ...

osgi> cdo export pmw pmw.xml
java.lang.IllegalArgumentException: Invalid type: org.eclipse.emf.cdo.internal.common.revision.CDOFeatureMapEntryImpl
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.type(CDOServerExporter.java:667)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportFeature(CDOServerExporter.java:544)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportRevision(CDOServerExporter.java:502)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportRevision(CDOServerExporter.java:1)
        at org.eclipse.emf.cdo.server.CDOServerExporter$2.handleRevision(CDOServerExporter.java:183)
        at org.eclipse.emf.cdo.server.internal.db.DBRevisionHandler.handleRevision(DBRevisionHandler.java:28)
        at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.handleRevisions(AbstractHorizontalClassMapping.jav
a:638)
        at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.handleRevisions(AbstractMappingStrategy.java:187)
        at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.handleRevisions(DBStoreAccessor.java:1049)
        at org.eclipse.emf.cdo.internal.server.Repository.handleRevisions(Repository.java:1192)
        at org.eclipse.emf.cdo.server.CDOServerExporter.exportRevisions(CDOServerExporter.java:177)
        at org.eclipse.emf.cdo.server.CDOServerExporter.exportBranch(CDOServerExporter.java:172)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportBranch(CDOServerExporter.java:450)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportBranch(CDOServerExporter.java:1)
        at org.eclipse.emf.cdo.server.CDOServerExporter.exportBranches(CDOServerExporter.java:149)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportBranches(CDOServerExporter.java:433)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportBranches(CDOServerExporter.java:1)
        at org.eclipse.emf.cdo.server.CDOServerExporter.exportAll(CDOServerExporter.java:104)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportAll(CDOServerExporter.java:386)
        at org.eclipse.emf.cdo.server.CDOServerExporter$XML.exportAll(CDOServerExporter.java:1)
        at org.eclipse.emf.cdo.server.CDOServerExporter.exportRepository(CDOServerExporter.java:83)
        at org.eclipse.emf.cdo.internal.server.bundle.CDOCommandProvider.exportXML(CDOCommandProvider.java:160)
        at org.eclipse.emf.cdo.internal.server.bundle.CDOCommandProvider._cdo(CDOCommandProvider.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)
        at java.lang.Thread.run(Unknown Source)
osgi>



Reproducible: Always

Steps to Reproduce:
1. Start CDO server with filled repository with custom datatypes in it
2. at osgi> console type "cdo export <repository> <xml-file>"
3. -> Exception is thrown when custom datatype is encountered (first part of xml-file is filled correctly)
Comment 1 Eike Stepper CLA 2010-12-15 12:28:59 EST
Hi Carel,

I'm investigating your problem with exporting datatypes. Are you sure that the problem does not only apply to feature map entries? I tested with a Point datatype and had no issues:

<revision id="L2" class="http://www.eclipse.org/emf/CDO/tests/model3/1.0.0#Polygon" version="1" time="1292432757481" resource="L3">
        <feature name="points" type="String" value="1,2"/>
        <feature name="points" type="String" value="3,1"/>
        <feature name="points" type="String" value="4,5"/>
</revision>
Comment 2 Eike Stepper CLA 2010-12-15 14:02:28 EST
Created attachment 185255 [details]
EDate Fix v1
Comment 3 Eike Stepper CLA 2010-12-15 14:03:18 EST
Committed EDate fix v1 to HEAD
Comment 4 Eike Stepper CLA 2010-12-17 08:34:34 EST
Created attachment 185420 [details]
FeatureMap Fix v1
Comment 5 Eike Stepper CLA 2010-12-17 08:35:20 EST
Committed FeatureMapFix v1 to HEAD
Comment 6 Eike Stepper CLA 2011-06-23 03:39:18 EDT
Available in R20110608-1407