Hi,
Oak configuration with RDBMS doesn't work yet.
I use the latest release 1.4.0 but i have the same problem
In particular this is the code i use to initialize Oak
final DocumentMK.Builder builder = new DocumentMK.Builder();
builder.setBlobStore(createFileSystemBlobStore());
final DocumentNodeStore ns = getRDBDocumentNodeStore(builder);
// ds is datasource form postgres 9.4
DocumentStore documentStore = new RDBDocumentStore(ds, builder);
builder.setDocumentStore(documentStore);
DocumentNodeStore ns = new DocumentNodeStore(builder);
DocumentNodeStore ns1 = new
DocumentMK.Builder().setDocumentStore(documentStore).getNodeStore();
InitialContent ic = new InitialContent();
Oak oak = new Oak(ns1).with(ic);
Jcr jcr = new Jcr(oak);
Repository repo = jcr.createRepository();
and this is the stack trace:
java.lang.IllegalStateException: This tree does not exist
at
org.apache.jackrabbit.oak.core.MutableTree.beforeWrite(MutableTree.java:353)
at
org.apache.jackrabbit.oak.core.MutableTree.setProperty(MutableTree.java:232)
at
org.apache.jackrabbit.oak.plugins.name.ReadWriteNamespaceRegistry.registerNamespace(ReadWriteNamespaceRegistry.java:92)
at
org.apache.jackrabbit.commons.cnd.TemplateBuilderFactory.setNamespace(TemplateBuilderFactory.java:92)
at
org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.doNameSpace(CompactNodeTypeDefReader.java:246)
at
org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.parse(CompactNodeTypeDefReader.java:200)
at
org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.<init>(CompactNodeTypeDefReader.java:163)
at
org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.<init>(CompactNodeTypeDefReader.java:139)
at
org.apache.jackrabbit.commons.cnd.CndImporter.registerNodeTypes(CndImporter.java:147)
at
org.apache.jackrabbit.oak.plugins.nodetype.write.NodeTypeRegistry.registerNodeTypes(NodeTypeRegistry.java:109)
at
org.apache.jackrabbit.oak.plugins.nodetype.write.NodeTypeRegistry.register(NodeTypeRegistry.java:104)
at
org.apache.jackrabbit.oak.plugins.nodetype.write.NodeTypeRegistry.registerBuiltIn(NodeTypeRegistry.java:86)
at
org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initialize(InitialContent.java:120)
at
org.apache.jackrabbit.oak.spi.lifecycle.CompositeInitializer.initialize(CompositeInitializer.java:48)
at
org.apache.jackrabbit.oak.spi.lifecycle.OakInitializer.initialize(OakInitializer.java:42)
at org.apache.jackrabbit.oak.Oak.createNewContentRepository(Oak.java:628)
at org.apache.jackrabbit.oak.Oak.createContentRepository(Oak.java:616)
at org.apache.jackrabbit.oak.jcr.Jcr.createContentRepository(Jcr.java:367)
at org.apache.jackrabbit.oak.jcr.Jcr.createRepository(Jcr.java:375)
at
it.siav.jarvis.testplatform.ecm.common.OakRDBMSTest.test(OakRDBMSTest.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at
org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:196)
at
org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:175)
at
org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:208)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:641)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:834)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1142)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:771)
at org.testng.TestRunner.run(TestRunner.java:621)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
at org.testng.SuiteRunner.run(SuiteRunner.java:259)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1176)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1101)
at org.testng.TestNG.run(TestNG.java:1009)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
I think could be a wrong Oak intialization but i didn't find any clear example
Can you give me the correct piece of code to create a content repository to use
RDBMS ?
Thnaks in advance.
Best regards
-----Messaggio originale-----
Da: Julian Reschke [mailto:[email protected]]
Inviato: mercoledì 2 marzo 2016 15:46
A: [email protected]
Oggetto: Re: critical question about oak: db connection
On 2016-03-02 12:08, Ancona Francesco wrote:
> We are using latest stable oak version
>
> In the case i'm sending you we have tried on postgres 9.4
>
> We have simplified the class but now the error is the same we found on
> Oracle.
Once again: please show me the system log; specifically the startup message of
RDBDocumentStore.
> Class connect to database and write a lot of system rows (system
> nodes.) but when i create repository there is the error
>
> Could you give us a complete example that works on Oracle 12 and
> Postgres 9.4 ?
Checkout OAK, run tests in oak-jcr with RDB fixture. For instance:
mvn clean install -Prdb-postgres -Drdb.jdbc-url=jdbc:postgresql:oak
-Drdb.jdbc-user=... -Drdb.jdbc-passwd=... -Dnsfixures=DOCUMENT_RDB
-PintegrationTesting -Prdb-postgres
> Is Postgres 9.4 correct version ?
Or newer.
Best regards, Julian
************************************************************************************
This footnote confirms that this email message has been scanned by PineApp
Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************