java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • steps to reproduce: 1. start with simple spring-boot project using start.spring.io by choosing - web - mongodb - gradle project - jar - 1.6/1.7 - java - 1.1.5 Release 2. After importing the project to IDE add the dependencies for couchbase 1.1.2 release 3. Extend both org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration and org.springframework.data.couchbase.config.AbstractMongoConfiguration 4.implement only the required methods. 5. Start the application 6. Failed to load the application context Exeception root cause is {code} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseTemplate' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:107) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:161) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:101) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 44 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate(AbstractCouchbaseConfiguration.java:112) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseTemplate$5(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 45 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 66 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter(AbstractCouchbaseConfiguration.java:122) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$mappingCouchbaseConverter$6(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 67 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 88 common frames omitted Caused by: java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext(AbstractCouchbaseConfiguration.java:148) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseMappingContext$8(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 89 common frames omitted 2014-08-23 23:57:30.892 ERROR 2652 --- [ main] o.s.test.context.TestContextManager : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@12b27c38] to prepare test instance [demo.ApplicationTests@3f94a1f] java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:161) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:101) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseTemplate' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:107) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) ... 28 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 44 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate(AbstractCouchbaseConfiguration.java:112) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseTemplate$5(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 45 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 66 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter(AbstractCouchbaseConfiguration.java:122) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$mappingCouchbaseConverter$6(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 67 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 88 common frames omitted Caused by: java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext(AbstractCouchbaseConfiguration.java:148) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseMappingContext$8(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 89 common frames omitted java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:161) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:101) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseTemplate' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:107) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) ... 28 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 44 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate(AbstractCouchbaseConfiguration.java:112) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseTemplate$5(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 45 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 66 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter(AbstractCouchbaseConfiguration.java:122) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$mappingCouchbaseConverter$6(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 67 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 88 more Caused by: java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext(AbstractCouchbaseConfiguration.java:148) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseMappingContext$8(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 89 more {code} Fullstacktrace is added in the attachement. Added the project source as well.
    via by Krishna Chaithanya Dhulipala,
  • steps to reproduce: 1. start with simple spring-boot project using start.spring.io by choosing - web - mongodb - gradle project - jar - 1.6/1.7 - java - 1.1.5 Release 2. After importing the project to IDE add the dependencies for couchbase 1.1.2 release 3. Extend both org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration and org.springframework.data.couchbase.config.AbstractMongoConfiguration 4.implement only the required methods. 5. Start the application 6. Failed to load the application context Exeception root cause is {code} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseTemplate' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:107) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:161) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:101) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 44 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate(AbstractCouchbaseConfiguration.java:112) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseTemplate$5(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 45 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 66 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter(AbstractCouchbaseConfiguration.java:122) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$mappingCouchbaseConverter$6(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 67 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 88 common frames omitted Caused by: java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext(AbstractCouchbaseConfiguration.java:148) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseMappingContext$8(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 89 common frames omitted 2014-08-23 23:57:30.892 ERROR 2652 --- [ main] o.s.test.context.TestContextManager : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@12b27c38] to prepare test instance [demo.ApplicationTests@3f94a1f] java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:161) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:101) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseTemplate' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:107) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) ... 28 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 44 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate(AbstractCouchbaseConfiguration.java:112) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseTemplate$5(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 45 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 66 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter(AbstractCouchbaseConfiguration.java:122) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$mappingCouchbaseConverter$6(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 67 common frames omitted Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 88 common frames omitted Caused by: java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext(AbstractCouchbaseConfiguration.java:148) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseMappingContext$8(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) 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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 89 common frames omitted java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:161) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:101) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseTemplate' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:107) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) ... 28 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 44 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate(AbstractCouchbaseConfiguration.java:112) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseTemplate$5(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 45 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 66 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter(AbstractCouchbaseConfiguration.java:122) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$mappingCouchbaseConverter$6(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 67 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 88 more Caused by: java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext(AbstractCouchbaseConfiguration.java:148) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseMappingContext$8(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 89 more {code} Fullstacktrace is added in the attachement. Added the project source as well.
    via by Krishna Chaithanya Dhulipala,
    • java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:161) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:101) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseTemplate' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:107) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64) at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91) ... 27 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.CouchbaseTemplate org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 44 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingCouchbaseConverter' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate(AbstractCouchbaseConfiguration.java:112) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseTemplate$5(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 45 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 66 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchbaseMappingContext' defined in class path resource [demo/org/krish/config/couchbase/CouchbaseConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter(AbstractCouchbaseConfiguration.java:122) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$mappingCouchbaseConverter$6(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 67 more Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.couchbase.core.mapping.CouchbaseMappingContext org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext() throws java.lang.Exception] threw exception; nested exception is java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:188) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586) ... 88 more Caused by: java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions(<generated>) at org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext(AbstractCouchbaseConfiguration.java:148) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseMappingContext$8(<generated>) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312) at demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166) ... 89 more
    No Bugmate found.