[CDO - MongoDB] - After first write doesn't restart [message #962652] |
Mon, 29 October 2012 04:15  |
Eclipse User |
|
|
|
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 #963180 is a reply to message #962917] |
Mon, 29 October 2012 12:21  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.05594 seconds