Re: R: critical question about oak: db connection

2016-03-29 Thread Julian Reschke

On 2016-03-23 16:19, Manfred Baedke wrote:

Hi Francesco,

Your tests ran out of the box in my IDE (IntelliJ IDEA 15) using a local
Postgres 9.3.

Best regards,
Manfred


Same here, from command line maven and on PostgreSQL 9.5:


[INFO] Scanning for projects...
[INFO]
[INFO] 
[INFO] Building oaktest 0.0.1-SNAPSHOT
[INFO] 
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ oaktest ---
[INFO] Deleting C:\home\jre\oaktest\target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ oaktest 
---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
C:\home\jre\oaktest\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ oaktest ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ 
oaktest ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, 
i.e. build is platform dependent!
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ 
oaktest ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. 
build is platform dependent!
[INFO] Compiling 1 source file to C:\home\jre\oaktest\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ oaktest ---
[INFO] Surefire report directory: C:\home\jre\oaktest\target\surefire-reports

---
 T E S T S
---
Running oaktest.OakRDBMSTest
16:33:41.896 INFO  [main] AbstractTestContextBootstrapper.java:207 Could not 
instantiate TestExecutionListener 
[org.springframework.test.context.web.ServletTestExecutionListener]. Specify 
custom listener classes or make the default listener classes (and their 
required dependencies) available. Offending class: 
[javax/servlet/ServletContext]
16:33:41.896 INFO  [main] AbstractTestContextBootstrapper.java:185 Using 
TestExecutionListeners: 
[org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@2ffad8fe,
 
org.springframework.test.context.support.DependencyInjectionTestExecutionListener@7dbc244d,
 
org.springframework.test.context.support.DirtiesContextTestExecutionListener@4af37bb8]
16:33:42.017 INFO  [main] XmlBeanDefinitionReader.java:317  Loading XML bean 
definitions from class path resource [config/spring/spring-test-config.xml]
16:33:42.117 INFO  [main] AbstractApplicationContext.java:578 Refreshing 
org.springframework.context.support.GenericApplicationContext@3fb2acb7: startup 
date [Tue Mar 29 16:33:42 CEST 2016]; root of context hierarchy
16:33:42.217 INFO  [main] DriverManagerDataSource.java:133  Loaded JDBC driver: 
org.postgresql.Driver
16:33:42.750 INFO  [main] RDBDocumentStore.java:827 RDBDocumentStore 
(1.4.0) instantiated for database PostgreSQL 9.5.0 (9.5), using driver: 
PostgreSQL Native Driver PostgreSQL 9.4.1207.jre7 (9.4), connecting to: 
jdbc:postgresql:oak, properties: {pg_encoding_to_char(encoding)=UTF8, 
datcollate=C}, transaction isolation level: TRANSACTION_READ_COMMITTED (2), 
.nodes: id varchar(512), modified int8, hasbinary int2, deletedonce int2, 
modcount int8, cmodcount int8, dsize int8, data varchar(16384), bdata 
bytea(2147483647) /* {bytea=-2, int2=5, int8=-5, varchar=12} */ /* unique index 
nodes_pkey on public.nodes (id ASC) other */
16:33:42.750 INFO  [main] RDBDocumentStore.java:834 Tables created upon 
startup: [CLUSTERNODES, NODES, SETTINGS, JOURNAL]
16:33:42.781 INFO  [main] RDBBlobStore.java:224 RDBBlobStore 
(1.4.0) instantiated for database PostgreSQL 9.5.0 (9.5), using driver: 
PostgreSQL Native Driver PostgreSQL 9.4.1207.jre7 (9.4), connecting to: 
jdbc:postgresql:oak, transaction isolation level: TRANSACTION_READ_COMMITTED (2)
16:33:42.781 INFO  [main] RDBBlobStore.java:230 Tables created upon 
startup: [DATASTORE_DATA, DATASTORE_META]
16:33:43.182 INFO  [main] DocumentNodeStore.java:516Initialized 
DocumentNodeStore with clusterNodeId: 1 (id: 1, startTime: 1459262022866, 
machineId: mac:1803733fd6b0, instanceId: C:\home\jre\oaktest, pid: 6024, uuid: 
db2a1755-2346-44d9-a284-37f0a7e69a1f, readWriteMode: null, state: NONE, 
revLock: NONE, oakVersion: 1.4.0)
16:33:44.600 INFO  [main] IndexUpdate.java:182  Found a new index 
node [reference]. Reindexing is requested
16:33:44.600 INFO  [main] IndexUpdate.java:147  Reindexing will be 
performed for following indexes: [/oak:index/reference, /oak:index/nodetype, 
/oak:index/uuid]
16:33:55.139 INFO  [main] IndexUpdate.java:257  Indexing report
- 

Re: R: critical question about oak: db connection

2016-03-23 Thread Manfred Baedke

Hi Francesco,

Your tests ran out of the box in my IDE (IntelliJ IDEA 15) using a local 
Postgres 9.3.


Best regards,
Manfred

On 3/23/2016 8:27 AM, Ancona Francesco wrote:

Hello,
any news about question ?

Thanks in advance,
best regards


-Messaggio originale-
Da: Ancona Francesco [mailto:francesco.anc...@siav.it]
Inviato: venerdì 18 marzo 2016 11:40
A: oak-dev@jackrabbit.apache.org
Oggetto: R: critical question about oak: db connection

Done.

https://github.com/francescoancona/oaktest.git

Thanks in advance,
best regards


-Messaggio originale-
Da: Tomek Rekawek [mailto:reka...@adobe.com]
Inviato: giovedì 17 marzo 2016 15:32
A: oak-dev@jackrabbit.apache.org
Oggetto: Re: critical question about oak: db connection

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.(CompactNodeTypeDefReader.java:163)
 at 
org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.(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.ja

R: critical question about oak: db connection

2016-03-23 Thread Ancona Francesco
Hello,
any news about question ?

Thanks in advance,
best regards


-Messaggio originale-
Da: Ancona Francesco [mailto:francesco.anc...@siav.it] 
Inviato: venerdì 18 marzo 2016 11:40
A: oak-dev@jackrabbit.apache.org
Oggetto: R: critical question about oak: db connection

Done.

https://github.com/francescoancona/oaktest.git

Thanks in advance,
best regards


-Messaggio originale-
Da: Tomek Rekawek [mailto:reka...@adobe.com]
Inviato: giovedì 17 marzo 2016 15:32
A: oak-dev@jackrabbit.apache.org
Oggetto: Re: critical question about oak: db connection

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.(CompactNodeTypeDefReader.java:163)
>> at 
>> org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.(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(NodeTypeRegis

R: R: critical question about oak: db connection

2016-03-19 Thread Ancona Francesco
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.(CompactNodeTypeDefReader.java:163)
>  at 
> org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.(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.

R: critical question about oak: db connection

2016-03-19 Thread Ancona Francesco
Done.

https://github.com/francescoancona/oaktest.git

Thanks in advance,
best regards


-Messaggio originale-
Da: Tomek Rekawek [mailto:reka...@adobe.com] 
Inviato: giovedì 17 marzo 2016 15:32
A: oak-dev@jackrabbit.apache.org
Oggetto: Re: critical question about oak: db connection

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.(CompactNodeTypeDefReader.java:163)
>> at 
>> org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.(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.jackrab

Re: R: R: critical question about oak: db connection

2016-03-19 Thread Julian Reschke

On 2016-03-17 14:46, Ancona Francesco 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.
...


Both oak-jcr and oak-run contain tests that use JCR->OAK->RDB sucessfully.

Best regards, Julian


Re: R: critical question about oak: db connection

2016-03-19 Thread Julian Reschke

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.(CompactNodeTypeDefReader.java:163)
 at 
org.apache.jackrabbit.commons.cnd.CompactNodeTypeDefReader.(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 

Re: R: critical question about oak: db connection

2016-03-02 Thread Manfred Baedke

Hi Francesco,


Or could you point out the unit test in oak source code, can we use ?


A natural starting point is 
org.apache.jackrabbit.oak.plugins.document.rbd.RDBDocumentStoreTest in 
oak-core.


Best regards,
Manfred

On 3/2/2016 12:45 PM, Ancona Francesco wrote:

I’m not authorized  to publish anything;
could you give me a project that  works ?

Or could you point out the unit test in oak source code, can we use ?

Thanks
Best regards

Da: Alex Parvulescu [mailto:alex.parvule...@gmail.com]
Inviato: mercoledì 2 marzo 2016 12:22
A: Oak devs 
Oggetto: Re: critical question about oak: db connection

Hi,

I see you keep having issues with getting a prototype up and running, but 
pasting the code in emails might be a bit off-putting for anyone looking to 
give you a hand.
Might I suggest publishing the relevant bits (self contained project easy to 
run and see the error) to a GitHub repository?

best,
alex




On Wed, Mar 2, 2016 at 12:08 PM, 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.



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 ?

Is Postgres 9.4 correct version ?



Thanks

Best regards





@Autowired

 @Qualifier("oakPostgresDataSource")

 private DataSource ds;



 @Test

 public void test() {



final DocumentMK.Builder builder = new 
DocumentMK.Builder();


builder.setBlobStore(createFileSystemBlobStore());

final DocumentNodeStore ns = 
getRDBDocumentNodeStore(builder);

Oak oak = new Oak(ns);

Jcr jcr = new Jcr(oak);



Repository repo = jcr.createRepository();

Session session = null;

try {

InputStream is = new 
ByteArrayInputStream(document_small);

session = repo.login(new 
SimpleCredentials("admin", "admin".toCharArray()));

ValueFactory valueFactory = 
session.getValueFactory();

Binary data = 
valueFactory.createBinary(is);

Node root = 
session.getRootNode();

root.addNode("hello", 
NodeType.NT_UNSTRUCTURED);

session.save();

// Logout

} catch (LoginException e) {

// TODO Auto-generated catch 
block

e.printStackTrace();

} catch (RepositoryException e) {

// TODO Auto-generated catch 
block

e.printStackTrace();

} finally {

if (session != null) 
session.logout();

ns.dispose();

}

 }



 private DocumentNodeStore 
getRDBDocumentNodeStore(DocumentMK.Builder builder) {

DocumentNodeStore ns = null;

if (builder == null) {

ns = new 
DocumentMK.Builder().setRDBConnection(ds).getNodeStore();

} else {

ns = 
builder.setRDBConnection(ds).getNodeStore();

}

return ns;

 }



 private BlobStore createFileSystemBlobStore() {

try {

FileUtils.deleteDirectory(new 
File("/var/tmp/oak"));

} catch (IOException e) {

// TODO Auto-generated catch 
block

e.printStackTrace();

}



FileBlobStore store = new 
FileBlobStore("/var/tmp/oak");

return store;

 }






[cid:image002.png@01D1747C.2AE9FF00]
Francesco Ancona | Software Dev. Dept. (SP) - Software 

R: critical question about oak: db connection

2016-03-02 Thread Ancona Francesco
I’m not authorized  to publish anything;
could you give me a project that  works ?

Or could you point out the unit test in oak source code, can we use ?

Thanks
Best regards

Da: Alex Parvulescu [mailto:alex.parvule...@gmail.com]
Inviato: mercoledì 2 marzo 2016 12:22
A: Oak devs 
Oggetto: Re: critical question about oak: db connection

Hi,

I see you keep having issues with getting a prototype up and running, but 
pasting the code in emails might be a bit off-putting for anyone looking to 
give you a hand.
Might I suggest publishing the relevant bits (self contained project easy to 
run and see the error) to a GitHub repository?

best,
alex




On Wed, Mar 2, 2016 at 12:08 PM, 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.



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 ?

Is Postgres 9.4 correct version ?



Thanks

Best regards





@Autowired

@Qualifier("oakPostgresDataSource")

private DataSource ds;



@Test

public void test() {



   final DocumentMK.Builder builder = new 
DocumentMK.Builder();

   
builder.setBlobStore(createFileSystemBlobStore());

   final DocumentNodeStore ns = 
getRDBDocumentNodeStore(builder);

   Oak oak = new Oak(ns);

   Jcr jcr = new Jcr(oak);



   Repository repo = jcr.createRepository();

   Session session = null;

   try {

   InputStream is = new 
ByteArrayInputStream(document_small);

   session = repo.login(new 
SimpleCredentials("admin", "admin".toCharArray()));

   ValueFactory valueFactory = 
session.getValueFactory();

   Binary data = 
valueFactory.createBinary(is);

   Node root = 
session.getRootNode();

   root.addNode("hello", 
NodeType.NT_UNSTRUCTURED);

   session.save();

   // Logout

   } catch (LoginException e) {

   // TODO Auto-generated catch 
block

   e.printStackTrace();

   } catch (RepositoryException e) {

   // TODO Auto-generated catch 
block

   e.printStackTrace();

   } finally {

   if (session != null) 
session.logout();

   ns.dispose();

   }

}



private DocumentNodeStore 
getRDBDocumentNodeStore(DocumentMK.Builder builder) {

   DocumentNodeStore ns = null;

   if (builder == null) {

   ns = new 
DocumentMK.Builder().setRDBConnection(ds).getNodeStore();

   } else {

   ns = 
builder.setRDBConnection(ds).getNodeStore();

   }

   return ns;

}



private BlobStore createFileSystemBlobStore() {

   try {

   FileUtils.deleteDirectory(new 
File("/var/tmp/oak"));

   } catch (IOException e) {

   // TODO Auto-generated catch 
block

   e.printStackTrace();

   }



   FileBlobStore store = new 
FileBlobStore("/var/tmp/oak");

   return store;

}






[cid:image002.png@01D1747C.2AE9FF00]
Francesco Ancona | Software Dev. Dept. (SP) - Software Architect
tel. +39 049 8979797 | fax +39 049 
8978800 | cel. +39 3299060325
e-mail: francesco.anc...@siav.it | 
www.siav.it

I contenuti di questa e-mail e dei suoi allegati sono confidenziali