java.lang.IllegalStateException: Failed to load ApplicationContext

Spring JIRA | Krishna Chaithanya Dhulipala | 2 years ago
  1. 0

    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.

    Spring JIRA | 2 years ago | Krishna Chaithanya Dhulipala
    java.lang.IllegalStateException: Failed to load ApplicationContext
  2. 0

    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.

    Spring JIRA | 2 years ago | Krishna Chaithanya Dhulipala
    java.lang.IllegalStateException: Failed to load ApplicationContext
  3. 0

    Spring Data Couchbase and Spring Data MongoDB at the same time use

    Stack Overflow | 1 year ago | zhsyourai
    java.lang.ClassCastException: org.springframework.data.mongodb.core.convert.CustomConversions cannot be cast to org.springframework.data.couchbase.core.convert.CustomConversions at com.*.*.config.dev.DevelopmentCouchbaseConfig$$EnhancerBySpringCGLIB$$64a18d5.customConversions(<generated>)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Scala 2.11.5 and Squeryl?

    Google Groups | 2 years ago | Clint Gilbert
    java.lang.ClassCastException: scala.None$ cannot be cast to
  6. 0

    adam2vcf

    Google Groups | 8 months ago | someya sayeh
    java.lang.ClassCastException: org.bdgenomics.formats.avro.Fragment cannot be cast to

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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()
    2. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.customConversions(<generated>)
      1 frame
    3. Spring Data Couchbase
      AbstractCouchbaseConfiguration.couchbaseMappingContext
      1. org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseMappingContext(AbstractCouchbaseConfiguration.java:148)
      1 frame
    4. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseMappingContext$8(<generated>)
      2. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>)
      2 frames
    5. Spring Core
      MethodProxy.invokeSuper
      1. org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      1 frame
    6. Spring Context
      ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
      1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)
      1 frame
    7. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>)
      1 frame
    8. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    9. Spring Beans
      AbstractBeanFactory.getBean
      1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
      2. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586)
      3. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      8. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
      9. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      10. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
      11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      11 frames
    10. Spring Context
      ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
      1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324)
      1 frame
    11. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseMappingContext(<generated>)
      1 frame
    12. Spring Data Couchbase
      AbstractCouchbaseConfiguration.mappingCouchbaseConverter
      1. org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.mappingCouchbaseConverter(AbstractCouchbaseConfiguration.java:122)
      1 frame
    13. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$mappingCouchbaseConverter$6(<generated>)
      2. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>)
      2 frames
    14. Spring Core
      MethodProxy.invokeSuper
      1. org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      1 frame
    15. Spring Context
      ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
      1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)
      1 frame
    16. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>)
      1 frame
    17. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    18. Spring Beans
      AbstractBeanFactory.getBean
      1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
      2. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586)
      3. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      8. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
      9. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      10. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
      11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      11 frames
    19. Spring Context
      ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
      1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:324)
      1 frame
    20. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.mappingCouchbaseConverter(<generated>)
      1 frame
    21. Spring Data Couchbase
      AbstractCouchbaseConfiguration.couchbaseTemplate
      1. org.springframework.data.couchbase.config.AbstractCouchbaseConfiguration.couchbaseTemplate(AbstractCouchbaseConfiguration.java:112)
      1 frame
    22. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.CGLIB$couchbaseTemplate$5(<generated>)
      2. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a$$FastClassBySpringCGLIB$$cc27214e.invoke(<generated>)
      2 frames
    23. Spring Core
      MethodProxy.invokeSuper
      1. org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      1 frame
    24. Spring Context
      ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
      1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)
      1 frame
    25. demo.org.krish
      CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate
      1. demo.org.krish.config.couchbase.CouchbaseConfig$$EnhancerBySpringCGLIB$$3a286a9a.couchbaseTemplate(<generated>)
      1 frame
    26. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    27. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
      2. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:586)
      3. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:597)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1094)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:989)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
      7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      8. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
      9. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      10. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
      11. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      12. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
      12 frames
    28. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
      2 frames
    29. Spring Boot
      SpringApplicationContextLoader.loadContext
      1. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
      2. org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
      3. org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:107)
      3 frames
    30. Spring TestContext
      SpringJUnit4ClassRunner$1.runReflectiveCall
      1. org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
      2. org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
      3. org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
      4. org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)
      5. org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:161)
      6. org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:101)
      7. org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331)
      8. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213)
      9. org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290)
      9 frames
    31. JUnit
      ReflectiveCallable.run
      1. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      1 frame
    32. Spring TestContext
      SpringJUnit4ClassRunner.runChild
      1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292)
      2. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
      3. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
      3 frames
    33. JUnit
      ParentRunner$2.evaluate
      1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      5 frames
    34. Spring TestContext
      RunAfterTestClassCallbacks.evaluate
      1. org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      2. org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
      2 frames
    35. JUnit
      ParentRunner.run
      1. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      1 frame
    36. Spring TestContext
      SpringJUnit4ClassRunner.run
      1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
      1 frame
    37. JUnit
      JUnitCore.run
      1. org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      1 frame
    38. IntelliJ junit4 module
      JUnit4IdeaTestRunner.startRunnerWithArgs
      1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
      1 frame
    39. IDEA
      JUnitStarter.main
      1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
      2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
      2 frames
    40. Java RT
      NativeMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2 frames
    41. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
      1 frame