Hi,
i wrote yesterday that we are making a lots of performance test on oak and
jackrabbit in order to select our target platform. We are going to try with
several plane tests; one of them is using oak with RDBMS Postgres to store
metadata.
We found an exception when save a new node
(root.addNode("hello").setProperty("count", 1);)
Our driver postgres is: datasource
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1207.jre7</version>
</dependency>
Can you help us?
Thanks in advance.
Best regards
Class detail:
@Test
@ContextConfiguration(locations = { "classpath:spring-test-config.xml" })
public class OakPostgresTest extends AbstractTestCommons {
@Autowired
@Qualifier("oakDataSource")
private DataSource ds;
@Test
public void test() {
final DocumentMK.Builder builder = new
DocumentMK.Builder();
builder.setBlobStore(createFileSystemBlobStore());
final DocumentNodeStore ns =
getPosgresDocumentNodeStore(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();
if (root.hasNode("hello")) {
Node hello =
root.getNode("hello");
long count =
hello.getProperty("count").getLong();
if (count > 1) {
hello.remove();
System.out.println("delete the hello node");
} else {
hello.setProperty("count", count + 1);
hello.setProperty("data", data);
System.out.println("found the hello node, count = " + count);
}
} else {
System.out.println("creating the hello node");
root.addNode("hello").setProperty("count", 1);
}
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
getPosgresDocumentNodeStore(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("/home/test/oak"));
} catch (IOException e) {
// TODO Auto-generated catch
block
e.printStackTrace();
}
FileBlobStore store = new
FileBlobStore("/home/test/oak");
return store;
}
}
java.text.ParseException: Query: SELECT * FROM [nt:base] WHERE(*)[jcr:uuid] =
$id /* oak-internal */; expected: unknown node type
at
org.apache.jackrabbit.oak.query.SQL2Parser.getSyntaxError(SQL2Parser.java:1357)
at
org.apache.jackrabbit.oak.query.SQL2Parser.parseSelector(SQL2Parser.java:252)
at
org.apache.jackrabbit.oak.query.SQL2Parser.parseSource(SQL2Parser.java:278)
at
org.apache.jackrabbit.oak.query.SQL2Parser.parseSelect(SQL2Parser.java:203)
at
org.apache.jackrabbit.oak.query.SQL2Parser.parse(SQL2Parser.java:148)
at
org.apache.jackrabbit.oak.query.QueryEngineImpl.parseQuery(QueryEngineImpl.java:177)
at
org.apache.jackrabbit.oak.query.QueryEngineImpl.executeQuery(QueryEngineImpl.java:257)
at
org.apache.jackrabbit.oak.query.QueryEngineImpl.executeQuery(QueryEngineImpl.java:233)
at
org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.resolveUUID(IdentifierManager.java:314)
at
org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.resolveUUID(IdentifierManager.java:308)
at
org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.resolveUUID(IdentifierManager.java:304)
at
org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager.getTree(IdentifierManager.java:133)
at
org.apache.jackrabbit.oak.security.user.AuthorizableBaseProvider.getByContentID(AuthorizableBaseProvider.java:56)
at
org.apache.jackrabbit.oak.security.user.AuthorizableBaseProvider.getByID(AuthorizableBaseProvider.java:51)
at
org.apache.jackrabbit.oak.security.user.UserProvider.getAuthorizable(UserProvider.java:211)
at
org.apache.jackrabbit.oak.security.user.UserManagerImpl.getAuthorizable(UserManagerImpl.java:106)
at
org.apache.jackrabbit.oak.security.user.UserInitializer.initialize(UserInitializer.java:130)
at
org.apache.jackrabbit.oak.spi.lifecycle.OakInitializer.initialize(OakInitializer.java:57)
at
org.apache.jackrabbit.oak.Oak.createNewContentRepository(Oak.java:672)
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.zzzz.yyyy.testplatform.ecm.oak.OakPostgresTest.test(OakPostgresTest.java:53)
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:86)
at
org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:197)
at
org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:175)
at
org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:209)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:641)
at
org.testng.internal.Invoker.invokeTestMethod(Invoker.java:822)
at
org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1130)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at
org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at
org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:113)
at
org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177)
2016-02-25 10:06:43 [main] ERROR o.a.j.o.p.i.IdentifierManager -
query failed
[cid:[email protected]]
Francesco Ancona | Software Dev. Dept. (SP) - Software Architect
tel. +39 049 8979797 | fax +39 049 8978800 | cel. +39 3299060325
e-mail: [email protected] | www.siav.it
I contenuti di questa e-mail e dei suoi allegati sono confidenziali e riservati
esclusivamente ai destinatari.
L'utilizzo per qualunque fine del presente messaggio e degli allegati così come
la relativa divulgazione senza l'autorizzazione del mittente sono vietati.
Se avete ricevuto questa e-mail per errore, vi preghiamo di distruggerla e di
comunicarcelo.
I dati personali sono trattati esclusivamente per le finalità della presente
comunicazione in conformità con la legislazione vigente (D.lgs. 196/2003
"Codice Privacy").
Per informazioni: SIAV S.p.A. - [email protected] - 049 8979797
The contents of this e-mail and its attachments are confidential and reserved
exclusively to the recipients.
The use for any purpose of this message and attachments as well as its
disclosure without the consent of the sender is prohibited.
If you have received this email in error, please destroy it and notify us.
Personal data shall be processed solely for the purposes of this notice in
accordance with current legislation (Legislative Decree no. 196/2003 "Code").
For more information: SIAV S.p.A. - [email protected] - 049 8979797