Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO - MongoDB] - After first write doesn't restart
[CDO - MongoDB] - After first write doesn't restart [message #962652] Mon, 29 October 2012 08:15 Go to next message
Patrick Di Loreto is currently offline Patrick Di LoretoFriend
Messages: 10
Registered: May 2010
Junior Member
Hi,

I'm trying to use MongoDB store with CDO 4.1 model repository.

When I start the CDO repository with the following configuration for the first time:

<?xml version="1.0" encoding="UTF-8"?>
<cdoServer>

	<acceptor type="tcp" listenerAddr="0.0.0.0" port="2036">
		<!-- <negotiator type="challenge" description="/temp/users.db"/> -->
	</acceptor>

	<repository name="myrepo">
		<property name="overrideUUID" value="" />
		<property name="supportingAudits" value="false" />
		<property name="supportingBranches" value="false" />
		<property name="supportingEcore" value="false" />
		<property name="ensureReferentialIntegrity" value="false" />
		<property name="allowInterruptRunningQueries" value="true" />
		<property name="idGenerationLocation" value="STORE" /> <!-- Possible values: STORE | CLIENT -->

		<!-- ONLY THE FIRST CONFIGURED STORE IS USED FOR THE REPOSITORY!!! -->

		<store type="mongodb">
		   <property name="uri" value="mongodb://localhost"/>
		   <property name="db" value="mydb"/>
		   <property name="drop" value="false"/>
		 </store>
	</repository>

</cdoServer>


everything works fine.

After my application writes some data into the repository and I properly restart it by performing:

...
osgi>cdo stop myrepo
...



On the next start up the CDO repository application fails to start by throwing the following exception:

Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/emf/2002/Ecore' not found. (http://www.eclipse.org/mymodel/1.0, 3, 135)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2585)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2416)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1293)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1462)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1013)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:77)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:995)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:706)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:767)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1315)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3104)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:921)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	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:119)
	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:175)
	... 42 more


any Suggestion?
Re: [CDO - MongoDB] - After first write doesn't restart [message #962825 is a reply to message #962652] Mon, 29 October 2012 10:57 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 29.10.2012 09:15, schrieb Patrick Di Loreto:
> Hi,
>
> I'm trying to use MongoDB store with CDO 4.1 model repository.
>
> When I start the CDO repository with the following configuration for the first time:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cdoServer>
>
> <acceptor type="tcp" listenerAddr="0.0.0.0" port="2036">
> <!-- <negotiator type="challenge" description="/temp/users.db"/> -->
> </acceptor>
>
> <repository name="myrepo">
> <property name="overrideUUID" value="" />
> <property name="supportingAudits" value="false" />
> <property name="supportingBranches" value="false" />
> <property name="supportingEcore" value="false" />
> <property name="ensureReferentialIntegrity" value="false" />
> <property name="allowInterruptRunningQueries" value="true" />
> <property name="idGenerationLocation" value="STORE" /> <!-- Possible values: STORE | CLIENT -->
>
> <!-- ONLY THE FIRST CONFIGURED STORE IS USED FOR THE REPOSITORY!!! -->
>
> <store type="mongodb">
> <property name="uri" value="mongodb://localhost"/>
> <property name="db" value="mydb"/>
> <property name="drop" value="false"/>
> </store>
> </repository>
>
> </cdoServer>
>
>
> everything works fine.
>
> After my application writes some data into the repository and I properly restart it by performing:
>
>
> ..
> osgi>cdo stop myrepo
Please try just "close".

Cheers
/Eike

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


> ..
>
>
>
> On the next start up the CDO repository application fails to start by throwing the following exception:
>
>
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'http://www.eclipse.org/emf/2002/Ecore' not found. (http://www.eclipse.org/mymodel/1.0, 3, 135)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2585)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2416)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1293)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1462)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1013)
> at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:77)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:995)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:706)
> at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
> at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:767)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1315)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3104)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:921)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
> 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:119)
> 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:175)
> ... 42 more
>
>
> any Suggestion?


Re: [CDO - MongoDB] - After first write doesn't restart [message #962917 is a reply to message #962825] Mon, 29 October 2012 12:32 Go to previous messageGo to next message
Patrick Di Loreto is currently offline Patrick Di LoretoFriend
Messages: 10
Registered: May 2010
Junior Member
Hi Eike,

if I use "close" the CDO is logging that is closing but when I restart it the CDO tries to recover from a crash and the mongodb store throws an exception saying "not yet implemented".

osgi> [ERROR] Not yet implemented
java.lang.UnsupportedOperationException: Not yet implemented
	at org.eclipse.emf.cdo.server.internal.mongodb.MongoDBStore.repairAfterCrash(MongoDBStore.java:566)
	at org.eclipse.emf.cdo.server.internal.mongodb.MongoDBStore.reStart(MongoDBStore.java:558)
	at org.eclipse.emf.cdo.server.internal.mongodb.MongoDBStore.doActivate(MongoDBStore.java:489)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:76)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104)
	at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1845)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:76)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104)
	at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:208)
	at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:111)
	at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
	at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
	at java.lang.Thread.run(Thread.java:662)

[Updated on: Mon, 29 October 2012 12:35]

Report message to a moderator

Re: [CDO - MongoDB] - After first write doesn't restart [message #963180 is a reply to message #962917] Mon, 29 October 2012 16:21 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 29.10.2012 13:32, schrieb Patrick Di Loreto:
> Hi Eike,
>
> if I use "close" the CDO is logging that is closing but when I restart it the CDO tries to recover from a crash and
> the mongodb store throws an exception saying "not yet implemented".
>
The crash detection works as follows:

protected void reStart()
{
Set<String> names = new HashSet<String>();
names.add(Props.GRACEFULLY_SHUT_DOWN);

Map<String, String> map = getPersistentProperties(names);
if (map.containsKey(Props.GRACEFULLY_SHUT_DOWN))
{
...
}
else
{
repairAfterCrash();
}

removePersistentProperties(Collections.singleton(Props.GRACEFULLY_SHUT_DOWN));
}

So it seems that the GRACEFULLY_SHUT_DOWN property doesn't get set in doDeactivate():

protected void doDeactivate() throws Exception
{
Map<String, String> map = new HashMap<String, String>();
map.put(Props.GRACEFULLY_SHUT_DOWN, Boolean.TRUE.toString());
setPersistentProperties(map);
}

Maybe with the debugger you can find out why?

Cheers
/Eike

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


Previous Topic:EMF association
Next Topic:[CDO] "an automatic schema migration mechanism"
Goto Forum:
  


Current Time: Thu Apr 25 11:03:35 GMT 2024

Powered by FUDForum. Page generated in 0.03027 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top