Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Error while importing xml cdo export file.
[CDO] Error while importing xml cdo export file. [message #1007248] Tue, 05 February 2013 04:19 Go to next message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 914
Registered: July 2009
Senior Member
Hi,

I have a question about XML export and import. I manage to produce an export file,
when importing however I get various exceptions (below), after I deleted the DB and restarted the server.

I wonder if I am using this functionality wrongly? Does the repo (repo1) need to be in a certain state when initializing a blank server? Is it possible to start with a clean DB? (Although the packages have been initialized).

Thanks!


1. Exceptions Repository not found:

[INFO] Dropping all tables from repository repo1...

!ENTRY org.eclipse.emf.cdo.server.db 1 0 2013-02-05 10:06:37.588
!MESSAGE Dropping all tables from repository repo1...
[ERROR] Factory not found: org.eclipse.emf.cdo.server.repositories[default]
org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found: org.eclipse.emf.cdo.server.repositories[default]
at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:200)
at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:534)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:292)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:273)
at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:45)

2. Exception Duplicate MySQL entries.

osgi> cdo import repo1 /Users/Christophe/netxserver/export05022013.xml
org.eclipse.net4j.db.DBException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'http://www.netxforge.com/13042011/services' for key 'I1360055197819_373'
at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:262)
at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:291)
at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.writePackageUnits(MetaDataManager.java:138)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:826)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.rawStore(DBStoreAccessor.java:1240)
at org.eclipse.emf.cdo.server.CDOServerImporter$FlushHandler.handleModels(CDOServerImporter.java:240)
at org.eclipse.emf.cdo.server.CDOServerImporter$XML$XMLHandler.endElement(CDOServerImporter.java:548)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)

Re: [CDO] Error while importing xml cdo export file. [message #1007258 is a reply to message #1007248] Tue, 05 February 2013 04:39 Go to previous messageGo to next message
Eike Stepper is currently offline Eike Stepper
Messages: 5501
Registered: July 2009
Senior Member
Am 05.02.2013 10:19, schrieb Christophe Bouhier:
> Hi,
> I have a question about XML export and import. I manage to produce an export file, when importing however I get
> various exceptions (below), after I deleted the DB and restarted the server.
> I wonder if I am using this functionality wrongly? Does the repo (repo1) need to be in a certain state when
> initializing a blank server? Is it possible to start with a clean DB? (Although the packages have been initialized).
The import creates a *new* repository from the exported XML data. No tables should exist in the database.

Does that solve the problems below?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


> Thanks!
>
> 1. Exceptions Repository not found:
> [INFO] Dropping all tables from repository repo1...
>
> !ENTRY org.eclipse.emf.cdo.server.db 1 0 2013-02-05 10:06:37.588
> !MESSAGE Dropping all tables from repository repo1...
> [ERROR] Factory not found: org.eclipse.emf.cdo.server.repositories[default]
> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found:
> org.eclipse.emf.cdo.server.repositories[default]
> at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:200)
> at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:534)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:292)
> at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:273)
> at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:45)
>
> 2. Exception Duplicate MySQL entries.
> osgi> cdo import repo1 /Users/Christophe/netxserver/export05022013.xml
> org.eclipse.net4j.db.DBException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> Duplicate entry 'http://www.netxforge.com/13042011/services' for key 'I1360055197819_373'
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:262)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:291)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.writePackageUnits(MetaDataManager.java:138)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:826)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.rawStore(DBStoreAccessor.java:1240)
> at org.eclipse.emf.cdo.server.CDOServerImporter$FlushHandler.handleModels(CDOServerImporter.java:240)
> at org.eclipse.emf.cdo.server.CDOServerImporter$XML$XMLHandler.endElement(CDOServerImporter.java:548)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
> at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
> at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)
>
>
Re: [CDO] Error while importing xml cdo export file. [message #1007260 is a reply to message #1007248] Tue, 05 February 2013 04:47 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 740
Registered: July 2009
Senior Member
I think you should not have "initialPackages" set in your cdo-server.xml as this will initially create the db structure/tables when the server starts... and the import will fail.

Christophe Bouhier wrote on Tue, 05 February 2013 10:19
Hi,

I have a question about XML export and import. I manage to produce an export file,
when importing however I get various exceptions (below), after I deleted the DB and restarted the server.

I wonder if I am using this functionality wrongly? Does the repo (repo1) need to be in a certain state when initializing a blank server? Is it possible to start with a clean DB? (Although the packages have been initialized).

Thanks!


1. Exceptions Repository not found:

[INFO] Dropping all tables from repository repo1...

!ENTRY org.eclipse.emf.cdo.server.db 1 0 2013-02-05 10:06:37.588
!MESSAGE Dropping all tables from repository repo1...
[ERROR] Factory not found: org.eclipse.emf.cdo.server.repositories[default]
org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not found: org.eclipse.emf.cdo.server.repositories[default]
at org.eclipse.net4j.util.container.ManagedContainer.getFactory(ManagedContainer.java:200)
at org.eclipse.net4j.util.container.ManagedContainer.createElement(ManagedContainer.java:534)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:292)
at org.eclipse.net4j.util.container.ManagedContainer.getElement(ManagedContainer.java:273)
at org.eclipse.emf.cdo.spi.server.RepositoryFactory.get(RepositoryFactory.java:45)

2. Exception Duplicate MySQL entries.

osgi> cdo import repo1 /Users/Christophe/netxserver/export05022013.xml
org.eclipse.net4j.db.DBException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'http://www.netxforge.com/13042011/services' for key 'I1360055197819_373'
at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:262)
at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:291)
at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.writePackageUnits(MetaDataManager.java:138)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:826)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.rawStore(DBStoreAccessor.java:1240)
at org.eclipse.emf.cdo.server.CDOServerImporter$FlushHandler.handleModels(CDOServerImporter.java:240)
at org.eclipse.emf.cdo.server.CDOServerImporter$XML$XMLHandler.endElement(CDOServerImporter.java:548)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)


Re: [CDO] Error while importing xml cdo export file. [message #1007263 is a reply to message #1007258] Tue, 05 February 2013 04:54 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 914
Registered: July 2009
Senior Member
Hi Eike,

Ah OK, so it needs to be clean. I wonder if the repo definition in the config file will not conflict with the import?
I mean the config defines "repo1" and the import aswell. Or should the server be initialized without a repo? (Is that even possible?).

thanks, Christophe

Re: [CDO] Error while importing xml cdo export file. [message #1007271 is a reply to message #1007263] Tue, 05 February 2013 05:27 Go to previous message
Christophe Bouhier is currently offline Christophe Bouhier
Messages: 914
Registered: July 2009
Senior Member
It's working, I needed to indeed remove the initialization of the EPackages from the cdo-server.xml
and remove initialization of empty CDOFolders and CDO Resources.
Thanks guys!
Previous Topic:[Maven] Adding resource -> encoding problem
Next Topic:[CDO] "Different object was registered for OID XX" in Native mode
Goto Forum:
  


Current Time: Wed Aug 27 17:25:13 EDT 2014

Powered by FUDForum. Page generated in 0.02504 seconds