org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeRepository': Cannot resolve reference to bean 'cqlTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cqlTemplate' is defined

Spring JIRA | Govardhan Rao Ganji | 1 year ago
  1. 0

    POJO: --------- @Table(value="emp") public class Employee implements Serializable{ @PrimaryKey @Column(value="emp_id") private Integer id; @Column(value="emp_name") private String name; @Column(value="emp_city") private String city; @Column(value="emp_phone") private BigInteger phoneNumber; @Column(value="emp_sal") private BigInteger salary; //simple setter & getter methods. } Repository : ---------------- public interface EmployeeRepository extends CassandraRepository<Employee> { } spring-contect-config.xml: ---------------------------------- <!-- REQUIRED: The Cassandra Cluster --> <cassandra:cluster id="cluster" contact-points="127.0.0.1" port="9042" /> <!-- REQUIRED: The Cassandra Session, built from the Cluster, and attaching to a keyspace --> <cassandra:session id="session" keyspace-name="da_name" cluster-ref="cluster"/> <!-- REQUIRED: The Default Cassandra Mapping Context used by CassandraConverter --> <cassandra:mapping /> <!-- REQUIRED: The Default Cassandra Converter used by CassandraTemplate --> <cassandra:converter /> <!-- REQUIRED: The Cassandra Template is the building block of all Spring Data Cassandra --> <cassandra:template id="cassandraTemplate" session-ref="session" /> <!-- OPTIONAL: If you are using Spring Data Cassandra Repositories, add your base packages to scan here --> <cassandra:mapping entity-base-packages="com.xxx.cassandra.pojo" /> <cassandra:repositories base-package="com.xxx.cassandra.repo" /> *When i runs the code,which throws an error message saying like :* Here is the link: --------------------- http://stackoverflow.com/questions/26710114/cannot-resolve-reference-to-bean-cqltemplate-while-setting-bean-property-cass Here is the stacktrace: ------------------------------ Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeRepository': Cannot resolve reference to bean 'cqlTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cqlTemplate' is defined at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.purpletalk.cassandra.App.main(App.java:26) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cqlTemplate' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) ... 15 more

    Spring JIRA | 1 year ago | Govardhan Rao Ganji
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeRepository': Cannot resolve reference to bean 'cqlTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cqlTemplate' is defined
  2. 0

    POJO: --------- @Table(value="emp") public class Employee implements Serializable{ @PrimaryKey @Column(value="emp_id") private Integer id; @Column(value="emp_name") private String name; @Column(value="emp_city") private String city; @Column(value="emp_phone") private BigInteger phoneNumber; @Column(value="emp_sal") private BigInteger salary; //simple setter & getter methods. } Repository : ---------------- public interface EmployeeRepository extends CassandraRepository<Employee> { } spring-contect-config.xml: ---------------------------------- <!-- REQUIRED: The Cassandra Cluster --> <cassandra:cluster id="cluster" contact-points="127.0.0.1" port="9042" /> <!-- REQUIRED: The Cassandra Session, built from the Cluster, and attaching to a keyspace --> <cassandra:session id="session" keyspace-name="da_name" cluster-ref="cluster"/> <!-- REQUIRED: The Default Cassandra Mapping Context used by CassandraConverter --> <cassandra:mapping /> <!-- REQUIRED: The Default Cassandra Converter used by CassandraTemplate --> <cassandra:converter /> <!-- REQUIRED: The Cassandra Template is the building block of all Spring Data Cassandra --> <cassandra:template id="cassandraTemplate" session-ref="session" /> <!-- OPTIONAL: If you are using Spring Data Cassandra Repositories, add your base packages to scan here --> <cassandra:mapping entity-base-packages="com.xxx.cassandra.pojo" /> <cassandra:repositories base-package="com.xxx.cassandra.repo" /> *When i runs the code,which throws an error message saying like :* Here is the link: --------------------- http://stackoverflow.com/questions/26710114/cannot-resolve-reference-to-bean-cqltemplate-while-setting-bean-property-cass Here is the stacktrace: ------------------------------ Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeRepository': Cannot resolve reference to bean 'cqlTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cqlTemplate' is defined at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.purpletalk.cassandra.App.main(App.java:26) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cqlTemplate' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) ... 15 more

    Spring JIRA | 1 year ago | Govardhan Rao Ganji
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeRepository': Cannot resolve reference to bean 'cqlTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cqlTemplate' is defined
  3. 0

    Cannot resolve reference to bean 'cqlTemplate' while setting bean property 'cassandraTemplate'

    Stack Overflow | 2 years ago | kayyagari
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personRepository': Cannot resolve reference to bean 'cqlTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cqlTemplate' is defined
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Getting error while dynamically providing input,output path

    Stack Overflow | 8 months ago | Varun Maurya
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'step1': Cannot resolve reference to bean 'itemReader' while setting bean property 'itemReader'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemReader' defined in class path resource [spring/config/process-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type [com.sun.proxy.$Proxy11 implementing org.springframework.batch.item.ItemStreamReader,org.springframework.batch.item.ItemStream,org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.batch.item.file.MultiResourceItemReader] for property 'multiReader'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy11 implementing org.springframework.batch.item.ItemStreamReader,org.springframework.batch.item.ItemStream,org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.batch.item.file.MultiResourceItemReader] for property 'multiReader': no matching editors or conversion strategy found
  6. 0

    Issues in serializers config

    GitHub | 3 years ago | dsukhoroslov
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hzInstance': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static com.hazelcast.core.HazelcastInstance com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(com.hazelcast.config.Config)] threw exception; nested exception is com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.NoSuchMethodException: com.hazelcast.nio.serialization.PortableSerializer.<init>()

  1. batwalrus76 7 times, last 6 days ago
  2. rlovtangen 1 times, last 1 week ago
  3. tvrmsmith 6 times, last 2 weeks ago
  4. kjhdofjosvs 1 times, last 4 weeks ago
  5. Andreas Häber 2 times, last 1 month ago
23 more registered users
72 unregistered visitors
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. org.springframework.beans.factory.NoSuchBeanDefinitionException

    No bean named 'cqlTemplate' is defined

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition()
  2. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
    2. org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168)
    3. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281)
    4. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    5. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
    6. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
    7. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
    8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
    9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    10. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    11. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    12. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    13. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    14. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    15. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
    15 frames
  3. Spring Context
    ClassPathXmlApplicationContext.<init>
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    3. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    4. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    4 frames
  4. com.purpletalk.cassandra
    App.main
    1. com.purpletalk.cassandra.App.main(App.java:26)
    1 frame