Following the README.md at
https://svn.apache.org/repos/asf/jackrabbit/oak/trunk/oak-examples/standalone/README.md,
I try to start the standalone application with Mongo. I just pulled the code
from the trunk as of today and did a 'mvn clean install' without any other
configuration or modifications.
Starting the app with mongo support fails with errors though. (The app works
fine without Mongo but the default SegmentMk/File System though).

I have Mongod running on localhost and default port. After I run

$ java -jar target/oak-standalone-1.6-SNAPSHOT.jar --mongo

and I check in Mongo, I do see that the oak database got created
(oak.mongo.db=oak in application.yml of the standalone sample app), i.e.:

> use oak
switched to db oak
> show tables
journal
nodes
system.indexes
> db.system.indexes.find({})
{ "v" : 1, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "oak.nodes" }
{ "v" : 1, "key" : { "_modified" : 1, "_id" : 1 }, "name" :
"_modified_1__id_1", "ns" : "oak.nodes" }
{ "v" : 1, "key" : { "_bin" : 1 }, "name" : "_bin_1", "ns" : "oak.nodes",
"sparse" : true }
{ "v" : 1, "key" : { "_deletedOnce" : 1 }, "name" : "_deletedOnce_1", "ns" :
"oak.nodes", "sparse" : true }
{ "v" : 1, "key" : { "_sdType" : 1 }, "name" : "_sdType_1", "ns" :
"oak.nodes", "sparse" : true }
{ "v" : 1, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "oak.journal" }
{ "v" : 1, "key" : { "_modified" : 1 }, "name" : "_modified_1", "ns" :
"oak.journal" }
> 


However, the application throws the following errors and then halts. Am I
missing something?


SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.3.0.RELEASE)

java.lang.reflect.InvocationTargetException
        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:483)
        at
org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'metricsSupport': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: private org.apache.felix.connect.launch.PojoServiceRegistry
org.apache.jackrabbit.oak.standalone.MetricsSupport.serviceRegistry; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'repositoryInitializer': Invocation of init method
failed; nested exception is javax.jcr.RepositoryException: Repository could
not be started in 10 seconds
        at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
        at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
        at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
        at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
        at
org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347)
        at
org.springframework.boot.SpringApplication.run(SpringApplication.java:295)
        at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1112)
        at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1101)
        at 
org.apache.jackrabbit.oak.standalone.OakServer.main(OakServer.java:29)
        ... 6 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could
not autowire field: private
org.apache.felix.connect.launch.PojoServiceRegistry
org.apache.jackrabbit.oak.standalone.MetricsSupport.serviceRegistry; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'repositoryInitializer': Invocation of init method
failed; nested exception is javax.jcr.RepositoryException: Repository could
not be started in 10 seconds
        at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
        at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
        at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
        ... 23 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'repositoryInitializer': Invocation of init method
failed; nested exception is javax.jcr.RepositoryException: Repository could
not be started in 10 seconds
        at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:368)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1192)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
        at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
        ... 25 more
Caused by: javax.jcr.RepositoryException: Repository could not be started in
10 seconds
        at
org.apache.jackrabbit.oak.run.osgi.OakOSGiRepositoryFactory.getRepository(OakOSGiRepositoryFactory.java:213)
        at
org.apache.jackrabbit.oak.standalone.RepositoryInitializer.createRepository(RepositoryInitializer.java:132)
        at
org.apache.jackrabbit.oak.standalone.RepositoryInitializer.initRepository(RepositoryInitializer.java:111)
        at
org.apache.jackrabbit.oak.standalone.RepositoryInitializer.initialize(RepositoryInitializer.java:83)
        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:483)
        at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:354)
        at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:305)
        at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
        ... 46 more
Caused by: java.util.concurrent.TimeoutException: Timeout waiting for task.
        at
com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:269)
        at
com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:96)
        at
org.apache.jackrabbit.oak.run.osgi.OakOSGiRepositoryFactory.getRepository(OakOSGiRepositoryFactory.java:195)
        ... 56 more


Thanks for any hints.

Environment:
Mac OS X El Capitano
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

- Mathias



--
View this message in context: 
http://jackrabbit.510166.n4.nabble.com/oak-standalone-with-mongo-unable-to-start-repository-tp4665855.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Reply via email to