Hello Ancona,

the mailing list didn’t allow to add an attachment. Could you post it somewhere 
online or (even better) put the code into github?

Best regards,
Tomek

-- 
Tomek Rękawek | Adobe Research | www.adobe.com
reka...@adobe.com

> On 17 Mar 2016, at 14:46, Ancona Francesco <francesco.anc...@siav.it> wrote:
> 
> Hello,
> i send you a maven project to connect with postgres.
> 
> As i told you in other messages i know that oak test cases work; but they 
> start always with RDBDocumentStore and use UpdateOp and other Oak methods to 
> add nodes.
> 
> Instead we'd like to use RDBDocumentNodeStore and we'd like to have 
> jcrRepository and jcr methods to manage documents (nodes).
> 
> I hope the project can be useful.
> 
> Thanks in advance,
> best regards.
> 
> -----Messaggio originale-----
> Da: Julian Reschke [mailto:julian.resc...@gmx.de] 
> Inviato: mercoledì 16 marzo 2016 17:21
> A: oak-dev@jackrabbit.apache.org
> Oggetto: Re: R: critical question about oak: db connection
> 
> Ancona,
> 
> you keep asking for more help but seem to ignore the feedback that you get.
> 
> 1) oak-jcr and oak-run demonstrate that it is possible to run on RDBs; just 
> run the tests. All the information that you need should be in the test cases.
> 
> 2) Don't throw code snippets at us. Without complete classes we can try 
> ourselves there is no way how we can find out what's wrong.
> 
> So either start from the existing working code, or send self-contained test 
> code we can compile and run ourselves.
> 
> Best regards, Julian
> 
> 
> On 2016-03-16 16:28, Ancona Francesco wrote:
>> 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:julian.resc...@gmx.de]
>> Inviato: mercoledì 2 marzo 2016 15:46
>> A: oak-dev@jackrabbit.apache.org
>> 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.
>> **********************************************************************
>> **************
>> 
>> 
>> 
>> 
> 
> 
> 
> 
> ************************************************************************************
> This footnote confirms that this email message has been scanned by PineApp 
> Mail-SeCure for the presence of malicious code, vandals & computer viruses.
> ************************************************************************************
> 
> 
> 
> <oaktest.zip.txt>

Reply via email to