4

I am trying to start the Context Service, but it getting stopped with below Error Logs.

    2017-02-01 14:22:30,002 ERROR SpringApplication - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextDataSource': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List com.sdl.context.odata.datalayer.ContextDataSource.oDataDaos; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ODataContextMapDao': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextRepositoryResolver': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Repository does not have a "root" bucket, perhaps it has not been initialised
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
    at com.sdl.delivery.service.WinServiceContainer.start(WinServiceContainer.java:29) [service-container-core-8.1.1-1007.jar:8.1.1-1007]
    at com.sdl.delivery.service.WinServiceContainer.main(WinServiceContainer.java:46) [service-container-core-8.1.1-1007.jar:8.1.1-1007]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.List com.sdl.context.odata.datalayer.ContextDataSource.oDataDaos; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ODataContextMapDao': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextRepositoryResolver': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Repository does not have a "root" bucket, perhaps it has not been initialised
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    ... 15 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ODataContextMapDao': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextRepositoryResolver': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Repository does not have a "root" bucket, perhaps it has not been initialised
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:996) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    ... 17 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextRepositoryResolver': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Repository does not have a "root" bucket, perhaps it has not been initialised
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:217) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:350) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:331) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:968) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at com.sdl.context.odata.datalayer.dao.ODataContextMapDao.initContextEngine(ODataContextMapDao.java:93) ~[cwd_odata_extension-8.1.1-1012.jar:8.1.1-1012]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    ... 29 common frames omitted
Caused by: java.lang.IllegalStateException: Repository does not have a "root" bucket, perhaps it has not been initialised
    at com.sdl.context.engine.repository.AbstractContextRepository.cloneToRulesRepository(AbstractContextRepository.java:646) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository$5.call(PersistentContextRepository.java:474) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository$5.call(PersistentContextRepository.java:470) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository.withSession(PersistentContextRepository.java:731) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository.createRulesRepository(PersistentContextRepository.java:470) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository.access$1700(PersistentContextRepository.java:79) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository$4.call(PersistentContextRepository.java:418) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository$4.call(PersistentContextRepository.java:416) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository.withSession(PersistentContextRepository.java:731) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository.withSession(PersistentContextRepository.java:718) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.PersistentContextRepository.getRulesRepository(PersistentContextRepository.java:416) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at com.sun.proxy.$Proxy86.getRulesRepository(Unknown Source) ~[na:na]
    at com.sdl.context.engine.repository.ContextRepositoryResolver.flush(ContextRepositoryResolver.java:45) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at com.sdl.context.engine.repository.ContextRepositoryResolver.afterPropertiesSet(ContextRepositoryResolver.java:32) ~[cwd_engine-8.1.1-1014.jar:8.1.1-1014]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
    ... 46 common frames omitted

I am using SDL Web 8.1, DXA 1.5 Web Application. Java Version : Java 8 Update 101

I even tried to update the repository, but that is failing too with below error

Shutting HSQLDB context repository down : jdbc:hsqldb:file:../repository/sdl-context-repository;hsqldb.default_table_type=cached;hsqldb.write_delay_millis=5000;hsqldb.lock_file=tru
e;hsqldb.tx=mvcc;readonly=false;files_readonly=false;hsqldb.log_data=true;hsqldb.cache_size=1000;hsqldb.cache_rows=5000
Cannot execute context repository manager
com.sdl.context.engine.repository.exception.ContextRepositoryException: Cannot load context knowledge from https://context.sdl.com/seed

Please help.

3

We had to follow the below steps in order to resolve the issue.

Ensure that the IP address of the machine on which you wish to set up the device database is on the white list managed by SDL. When in doubt, contact SDL Customer Support for more information.

On a Windows operating system, open a PowerShell command prompt. Navigate to the bin\ subfolder of your Context Service root location. Depending on your operating system, open a command line and do one of the following:

On a Windows operating system, type updateRepository.ps1, but do not yet press Enter. On a non-Windows operating system, type updateRepository.sh, but do not yet press Enter.

If you intend to use an HSQLDB database, add a space and --client to the command.

Press Enter. The command creates a new subfolder called repository\ in the services\ sibling folder.

We re-installed the service after the above steps, and it started working fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.