Exception thrown on repository startup if any node or property use custom namespace
sverker Oct 7, 2011 8:24 PMWhen starting a repository in my test environment I get an exception if I have any already existing content there that have child nodes or properties from other namespace than default. I create my own node type definitions which are loaded in the repository config file. This is the output I get:
02:10:24,407 INFO [request] Sending Request: GET https://roiyatest.s3-eu-west-1.amazonaws.com / Headers: (Content-Type: application/x-www-form-urlencoded; charset=utf-8, )
02:10:25,507 INFO [request] Received successful response: 200, AWS Request ID: 5223ACF94321307D
02:10:25,597 INFO [RepositoryQueryManager] Started rebuilding indexes for repository 'S3repository'
02:10:25,618 INFO [request] Sending Request: GET https://roiyatest.s3-eu-west-1.amazonaws.com / Parameters: (delimiter: /, max-keys: 1000, prefix: , ) Headers: (Content-Type: application/x-www-form-urlencoded; charset=utf-8, )
02:10:25,910 INFO [request] Received successful response: 200, AWS Request ID: 9BE12AD2090C8660
02:10:25,912 INFO [request] Sending Request: GET https://roiyatest.s3-eu-west-1.amazonaws.com /.modeshape Headers: (Content-Type: application/x-www-form-urlencoded; charset=utf-8, )
02:10:25,977 INFO [request] Received successful response: 200, AWS Request ID: 36F542700DA8B7D8
02:10:26,213 INFO [request] Sending Request: HEAD https://roiyatest.s3-eu-west-1.amazonaws.com /test_%24folder%24 Headers: (Content-Type: application/x-www-form-urlencoded; charset=utf-8, )
02:10:26,274 INFO [request] Received successful response: 200, AWS Request ID: FE4ECB717FC2DC4C
02:10:26,274 INFO [request] Sending Request: GET https://roiyatest.s3-eu-west-1.amazonaws.com / Parameters: (delimiter: /, max-keys: 1000, prefix: test/, ) Headers: (Content-Type: application/x-www-form-urlencoded; charset=utf-8, )
02:10:26,648 INFO [request] Received successful response: 200, AWS Request ID: A11B03C084A3AF80
02:10:26,685 INFO [RepositoryQueryManager] Completed rebuilding indexes for repository 'S3repository'
02:10:26,690 ERROR [AbstractTestBase] setUp failed
javax.jcr.RepositoryException: Error starting the "S3repository" repository (check the configuration): Error starting the "S3repository" repository (check the configuration): Error converting String to a Name: lt:description
at com.limetransit.jcr.test.OcmTest.initObjectContentManager(OcmTest.java:73)
at com.limetransit.jcr.test.AbstractTestBase.setUp(AbstractTestBase.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:543)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:212)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278)
at org.testng.SuiteRunner.run(SuiteRunner.java:241)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
at org.testng.TestNG.run(TestNG.java:1006)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)
Caused by: javax.jcr.RepositoryException: Error starting the "S3repository" repository (check the configuration): Error starting the "S3repository" repository (check the configuration): Error converting String to a Name: lt:description
at org.modeshape.jcr.JcrEngine$JcrRepositoryHolder.getRepository(JcrEngine.java:817)
at org.modeshape.jcr.JcrEngine.getRepository(JcrEngine.java:380)
at com.limetransit.jcr.test.OcmTest.initObjectContentManager(OcmTest.java:41)
... 19 more
Caused by: javax.jcr.RepositoryException: Error starting the "S3repository" repository (check the configuration): Error converting String to a Name: lt:description
at org.modeshape.jcr.JcrEngine$RepositoryInitializer.call(JcrEngine.java:903)
at org.modeshape.jcr.JcrEngine$RepositoryInitializer.call(JcrEngine.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.modeshape.graph.property.ValueFormatException: Error converting String to a Name: lt:description
at org.modeshape.graph.property.basic.NameValueFactory.create(NameValueFactory.java:130)
at org.modeshape.graph.property.basic.NameValueFactory.create(NameValueFactory.java:55)
at org.modeshape.graph.property.basic.PathValueFactory.createSegment(PathValueFactory.java:690)
at org.modeshape.graph.property.basic.PathValueFactory.createSegment(PathValueFactory.java:673)
at com.limetransit.modeshape.connector.s3.S3Workspace.getNode(S3Workspace.java:625)
at org.modeshape.graph.connector.base.PathTransaction.getNode(PathTransaction.java:166)
at org.modeshape.graph.connector.base.PathTransaction.getNode(PathTransaction.java:141)
at org.modeshape.graph.connector.base.PathTransaction.getNode(PathTransaction.java:59)
at org.modeshape.graph.connector.base.Processor.getTargetNode(Processor.java:657)
at org.modeshape.graph.connector.base.Processor.process(Processor.java:107)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:668)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:291)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:363)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:235)
at org.modeshape.graph.connector.base.Connection.execute(Connection.java:115)
at org.modeshape.graph.connector.RepositoryConnectionPool$ConnectionWrapper.execute(RepositoryConnectionPool.java:1129)
at org.modeshape.graph.request.CompositeRequestChannel$2.call(CompositeRequestChannel.java:193)
at org.modeshape.graph.request.CompositeRequestChannel$2.call(CompositeRequestChannel.java:183)
... 5 more
Caused by: org.modeshape.graph.property.NamespaceException: There is no namespace registered for the prefix "lt"
at org.modeshape.graph.property.basic.NameValueFactory.create(NameValueFactory.java:116)
... 22 more
FAILED CONFIGURATION: @BeforeSuite setUp
javax.jcr.RepositoryException: Error starting the "S3repository" repository (check the configuration): Error starting the "S3repository" repository (check the configuration): Error converting String to a Name: lt:description
at com.limetransit.jcr.test.OcmTest.initObjectContentManager(OcmTest.java:73)
at com.limetransit.jcr.test.AbstractTestBase.setUp(AbstractTestBase.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:543)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:212)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278)
at org.testng.SuiteRunner.run(SuiteRunner.java:241)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
at org.testng.TestNG.run(TestNG.java:1006)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)
Caused by: javax.jcr.RepositoryException: Error starting the "S3repository" repository (check the configuration): Error starting the "S3repository" repository (check the configuration): Error converting String to a Name: lt:description
at org.modeshape.jcr.JcrEngine$JcrRepositoryHolder.getRepository(JcrEngine.java:817)
at org.modeshape.jcr.JcrEngine.getRepository(JcrEngine.java:380)
at com.limetransit.jcr.test.OcmTest.initObjectContentManager(OcmTest.java:41)
... 19 more
Caused by: javax.jcr.RepositoryException: Error starting the "S3repository" repository (check the configuration): Error converting String to a Name: lt:description
at org.modeshape.jcr.JcrEngine$RepositoryInitializer.call(JcrEngine.java:903)
at org.modeshape.jcr.JcrEngine$RepositoryInitializer.call(JcrEngine.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.modeshape.graph.property.ValueFormatException: Error converting String to a Name: lt:description
at org.modeshape.graph.property.basic.NameValueFactory.create(NameValueFactory.java:130)
at org.modeshape.graph.property.basic.NameValueFactory.create(NameValueFactory.java:55)
at org.modeshape.graph.property.basic.PathValueFactory.createSegment(PathValueFactory.java:690)
at org.modeshape.graph.property.basic.PathValueFactory.createSegment(PathValueFactory.java:673)
at com.limetransit.modeshape.connector.s3.S3Workspace.getNode(S3Workspace.java:625)
at org.modeshape.graph.connector.base.PathTransaction.getNode(PathTransaction.java:166)
at org.modeshape.graph.connector.base.PathTransaction.getNode(PathTransaction.java:141)
at org.modeshape.graph.connector.base.PathTransaction.getNode(PathTransaction.java:59)
at org.modeshape.graph.connector.base.Processor.getTargetNode(Processor.java:657)
at org.modeshape.graph.connector.base.Processor.process(Processor.java:107)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:668)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:291)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:363)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:235)
at org.modeshape.graph.connector.base.Connection.execute(Connection.java:115)
at org.modeshape.graph.connector.RepositoryConnectionPool$ConnectionWrapper.execute(RepositoryConnectionPool.java:1129)
at org.modeshape.graph.request.CompositeRequestChannel$2.call(CompositeRequestChannel.java:193)
at org.modeshape.graph.request.CompositeRequestChannel$2.call(CompositeRequestChannel.java:183)
... 5 more
Caused by: org.modeshape.graph.property.NamespaceException: There is no namespace registered for the prefix "lt"
at org.modeshape.graph.property.basic.NameValueFactory.create(NameValueFactory.java:116)
... 22 more
My test repository config file looks like this:
<configuration xmlns:mode="http://www.modeshape.org/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<!-- Define the JCR repositories -->
<mode:repositories>
<mode:repository jcr:name="S3repository">
<mode:source>AmazonS3Source</mode:source>
<!-- Define the options for the JCR repository, using camelcase version of JcrRepository.Option names-->
<mode:options jcr:primaryType="options">
<!-- Should node types appear as nodes under '/jcr:system/jcr:nodeTypes'? -->
<mode:option jcr:name="projectNodeTypes" mode:value="true"/>
<!-- The name of the JAAS application policy, used when clients get a session with credentials.
(This policy is defined in the 'jboss-modeshape-beans.xml' file). -->
<mode:option jcr:name="jaasLoginConfigName" mode:value="modeshape"/>
<!-- Should indexes should be rebuilt synchronously when the repository restarts, default true -->
<mode:option jcr:name="queryIndexesRebuiltSynchronously" mode:value="true"/>
<!-- specifies the strategy (always or ifMissing) used to determine which query indexes need to be rebuilt when the repository restarts -->
<mode:option jcr:name="rebuildQueryIndexOnStartup" mode:value="ifMissing"/>
</mode:options>
<!-- Define any custom node types. Importing CND files via JcrConfiguration is equivalent to specifying here.-->
<jcr:nodeTypes>
<mode:resource>/com/limetransit/modeshape/connector/s3/s3.cnd</mode:resource>
<mode:resource>/ocm.cnd</mode:resource>
<mode:resource>/lime.cnd</mode:resource>
</jcr:nodeTypes>
</mode:repository>
</mode:repositories>
<!-- Define the sources used by the repository (or repositories) to store and access the content -->
<mode:sources jcr:primaryType="nt:unstructured">
<mode:source jcr:name="AmazonS3Source"
mode:classname="com.limetransit.modeshape.connector.s3.S3Source"
mode:creatingWorkspacesAllowed="true"
mode:accessKey="AKIAIGRICQ6R3TW3FYPA"
mode:secretKey="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"
mode:updatesAllowed="true"
mode:defaultWorkspaceName="roiyatest"
mode:predefinedWorkspaceNames="roiyatest"
mode:endPoint="s3-eu-west-1.amazonaws.com"
mode:folderNodeTypes="{http://www.limetransit.com/jcr/1.0}folder"
mode:fileNodeTypes="{http://www.limetransit.com/jcr/1.0}file"
mode:resoirceNodeTypes="{http://www.limetransit.com/jcr/1.0}resource"
/> <!-- Todo, set node cashe policy, -->
</mode:sources>
</configuration>
The file lime.cnd contains the namespace and my nodetype definitions. It works fine if I start with an empty repository, then I can add nodes from my own namespace and work with them but it is not possible to start up the repository with them already there.
It seems to me that the repository tries to load these nodes before the nodetypes are registered.