我已经创建了Spring data Cassandra CRUD应用程序。当第一次启动这个应用程序时,它会自动终止,并显示以下错误,但它会根据CassandraConfig.java类中的配置创建密钥空间。
当第二次运行应用程序时,它通过引用先前创建的Keyspace运行良好,并且能够顺利地执行CRUD操作。
尝试了不同的方法,仍然不确定缺少什么。
Git库:https://github.com/rahul-ghadge/spring-boot-cassandra-crud
版本:<br>Spring Boot:2.3.3.发布<br>Cassandra:3.11.7
2020-08-24 16:23:16.979 INFO 9740 --- [ s1-io-1] c.d.o.d.i.core.channel.ChannelFactory : [s1] Failed to connect with protocol DSE_V1, retrying with V4
2020-08-24 16:23:21.854 WARN 9740 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'springBootCassandraCrudApplication': Unsatisfied dependency expressed through field 'superHeroRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'superHeroRepository' defined in com.arya.cassandra.repository.SuperHeroRepository defined in @EnableCassandraRepositories declared on SpringBootCassandraCrudApplication: Cannot resolve reference to bean 'cassandraTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminTemplate]: Factory method 'cassandraTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSessionFactory' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Invocation of init method failed; nested exception is org.springframework.data.cassandra.CassandraUncategorizedException: Query; CQL [CREATE TABLE IF NOT EXISTS super_hero (age int, id bigint, name text, profession text, super_name text, super_powers frozen<super_powers>, PRIMARY KEY (id));]; Query timed out after PT2S; nested exception is com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
2020-08-24 16:23:21.927 WARN 9740 --- [ s1-io-2] c.d.o.d.i.core.cql.CqlRequestHandler : [s1|1780306540|0] Unexpected error while refreshing schema after DDL query, keeping previous version (CompletionException: com.datastax.oss.driver.api.core.connection.ClosedConnectionException: Channel was force-closed)
2020-08-24 16:23:21.927 WARN 9740 --- [ s1-io-2] c.d.o.d.i.c.control.ControlConnection : [s1] Unexpected error while refreshing schema for a SCHEMA_CHANGE event, keeping previous version (CompletionException: com.datastax.oss.driver.api.core.connection.ClosedConnectionException: Channel was force-closed)
2020-08-24 16:23:23.994 WARN 9740 --- [ s0-admin-0] c.d.o.d.i.core.session.DefaultSession : [s0] Error while closing com.datastax.oss.driver.internal.core.config.typesafe.DefaultDriverConfigLoader@1247f3f7 (RejectedExecutionException: event executor terminated)
2020-08-24 16:23:26.062 INFO 9740 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-08-24 16:23:26.094 INFO 9740 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-08-24 16:23:26.105 ERROR 9740 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'springBootCassandraCrudApplication': Unsatisfied dependency expressed through field 'superHeroRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'superHeroRepository' defined in com.arya.cassandra.repository.SuperHeroRepository defined in @EnableCassandraRepositories declared on SpringBootCassandraCrudApplication: Cannot resolve reference to bean 'cassandraTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminTemplate]: Factory method 'cassandraTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSessionFactory' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Invocation of init method failed; nested exception is org.springframework.data.cassandra.CassandraUncategorizedException: Query; CQL [CREATE TABLE IF NOT EXISTS super_hero (age int, id bigint, name text, profession text, super_name text, super_powers frozen<super_powers>, PRIMARY KEY (id));]; Query timed out after PT2S; nested exception is com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
at com.arya.cassandra.SpringBootCassandraCrudApplication.main(SpringBootCassandraCrudApplication.java:25) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'superHeroRepository' defined in com.arya.cassandra.repository.SuperHeroRepository defined in @EnableCassandraRepositories declared on SpringBootCassandraCrudApplication: Cannot resolve reference to bean 'cassandraTemplate' while setting bean property 'cassandraTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminTemplate]: Factory method 'cassandraTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSessionFactory' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Invocation of init method failed; nested exception is org.springframework.data.cassandra.CassandraUncategorizedException: Query; CQL [CREATE TABLE IF NOT EXISTS super_hero (age int, id bigint, name text, profession text, super_name text, super_powers frozen<super_powers>, PRIMARY KEY (id));]; Query timed out after PT2S; nested exception is com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:342) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:113) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1697) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1442) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraTemplate' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminTemplate]: Factory method 'cassandraTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSessionFactory' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Invocation of init method failed; nested exception is org.springframework.data.cassandra.CassandraUncategorizedException: Query; CQL [CREATE TABLE IF NOT EXISTS super_hero (age int, id bigint, name text, profession text, super_name text, super_powers frozen<super_powers>, PRIMARY KEY (id));]; Query timed out after PT2S; nested exception is com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:483) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:330) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
... 33 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.core.CassandraAdminTemplate]: Factory method 'cassandraTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSessionFactory' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Invocation of init method failed; nested exception is org.springframework.data.cassandra.CassandraUncategorizedException: Query; CQL [CREATE TABLE IF NOT EXISTS super_hero (age int, id bigint, name text, profession text, super_name text, super_powers frozen<super_powers>, PRIMARY KEY (id));]; Query timed out after PT2S; nested exception is com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
... 43 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cassandraSessionFactory' defined in class path resource [com/arya/cassandra/config/CassandraConfig.class]: Invocation of init method failed; nested exception is org.springframework.data.cassandra.CassandraUncategorizedException: Query; CQL [CREATE TABLE IF NOT EXISTS super_hero (age int, id bigint, name text, profession text, super_name text, super_powers frozen<super_powers>, PRIMARY KEY (id));]; Query timed out after PT2S; nested exception is com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:227) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1175) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:420) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:350) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:343) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.data.cassandra.config.AbstractSessionConfiguration.requireBeanOfType(AbstractSessionConfiguration.java:100) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.config.AbstractCassandraConfiguration.getRequiredSessionFactory(AbstractCassandraConfiguration.java:215) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.config.AbstractCassandraConfiguration.cassandraTemplate(AbstractCassandraConfiguration.java:146) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at com.arya.cassandra.config.CassandraConfig$$EnhancerBySpringCGLIB$$3e6d0aee.CGLIB$cassandraTemplate$9(<generated>) ~[classes/:na]
at com.arya.cassandra.config.CassandraConfig$$EnhancerBySpringCGLIB$$3e6d0aee$$FastClassBySpringCGLIB$$c9e88c5e.invoke(<generated>) ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at com.arya.cassandra.config.CassandraConfig$$EnhancerBySpringCGLIB$$3e6d0aee.cassandraTemplate(<generated>) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
... 44 common frames omitted
Caused by: org.springframework.data.cassandra.CassandraUncategorizedException: Query; CQL [CREATE TABLE IF NOT EXISTS super_hero (age int, id bigint, name text, profession text, super_name text, super_powers frozen<super_powers>, PRIMARY KEY (id));]; Query timed out after PT2S; nested exception is com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
at org.springframework.data.cassandra.core.cql.CassandraExceptionTranslator.translate(CassandraExceptionTranslator.java:160) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.core.cql.CassandraAccessor.translate(CassandraAccessor.java:379) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.core.cql.CqlTemplate.translateException(CqlTemplate.java:718) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.core.cql.CqlTemplate.query(CqlTemplate.java:173) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.core.cql.CqlTemplate.queryForResultSet(CqlTemplate.java:250) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.core.cql.CqlTemplate.execute(CqlTemplate.java:148) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.core.CassandraPersistentEntitySchemaCreator.lambda$createTables$0(CassandraPersistentEntitySchemaCreator.java:102) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[na:1.8.0_191]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[na:1.8.0_191]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[na:1.8.0_191]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[na:1.8.0_191]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[na:1.8.0_191]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_191]
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[na:1.8.0_191]
at org.springframework.data.cassandra.core.CassandraPersistentEntitySchemaCreator.createTables(CassandraPersistentEntitySchemaCreator.java:102) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.performSchemaActions(SessionFactoryFactoryBean.java:220) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.createTables(SessionFactoryFactoryBean.java:199) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.performSchemaAction(SessionFactoryFactoryBean.java:185) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.data.cassandra.config.SessionFactoryFactoryBean.afterPropertiesSet(SessionFactoryFactoryBean.java:135) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
... 67 common frames omitted
Caused by: com.datastax.oss.driver.api.core.DriverTimeoutException: Query timed out after PT2S
at com.datastax.oss.driver.api.core.DriverTimeoutException.copy(DriverTimeoutException.java:34) ~[java-driver-core-4.6.1.jar:na]
at com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:149) ~[java-driver-core-4.6.1.jar:na]
at com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:53) ~[java-driver-core-4.6.1.jar:na]
at com.datastax.oss.driver.internal.core.cql.CqlRequestSyncProcessor.process(CqlRequestSyncProcessor.java:30) ~[java-driver-core-4.6.1.jar:na]
at com.datastax.oss.driver.internal.core.session.DefaultSession.execute(DefaultSession.java:230) ~[java-driver-core-4.6.1.jar:na]
at com.datastax.oss.driver.api.core.cql.SyncCqlSession.execute(SyncCqlSession.java:53) ~[java-driver-core-4.6.1.jar:na]
at org.springframework.data.cassandra.core.cql.CqlTemplate.query(CqlTemplate.java:169) ~[spring-data-cassandra-3.0.3.RELEASE.jar:3.0.3.RELEASE]
... 86 common frames omitted
Process finished with exit code 1
请帮帮忙。提前感谢。
在降级后sping-boot-starter父
版本为2.2.7.RELEASE
它开始工作而不终止应用程序,也创建KEYSPACE和表在一次。
Spring Boot: 2.3.3.RELEASE (Not working as expected)
Cassandra : 3.11.7
Cassandra : 3.0.21
Spring Boot: 2.2.9.RELEASE (Not working as expected)
Cassandra : 3.11.7
Cassandra : 3.0.21
Spring Boot: 2.2.7.RELEASE (Working as expected)
Cassandra : 3.11.7
Cassandra : 3.0.21
工作代码被推送到新的分支。< br> Git资源库:https://github . com/Rahul-GH edge/spring-boot-Cassandra-crud/tree/working-2 . 2 . 7-bug-fix
需要签入官方文档,在 2.2.7.RELEASE 之后发生了什么变化。
我有两个键格。其中一个是完美创建的,但另一个只是用SimpleReplication创建的。当我用网络复制创建它时,它被创建了,但当我在cqlsh中描述keyspace时,它返回: “nonetype”对象没有属性“export_for_schema”
您的帮助应该是值得赞赏的,如果需要,我将提供代码示例。
主要内容:什么是键空间(Keyspace)?,Cassandra Keyspace的不同组件Cassandra查询语言(CQL)可帮助开发人员与Cassandra沟通交互。 Cassandra查询语言的语法与SQL非常相似。 什么是键空间(Keyspace)? 键空间()是用于保存列族,用户定义类型的对象。 键空间(Keyspace)就像RDBMS中的数据库,其中包含列族,索引,用户定义类型,数据中心意识,键空间(Keyspace)中使用的策略,复制因子等。 在Cassandra中,“”
我使用的是Eclipse Kepler,我已经安装了Spring IDE和STS,但当我创建Spring MVC Template项目时,出现了错误,然后我转到Maven Update选项,但出现了错误。我不知道为什么。求求你,救命! 错误:项目构建过程中出错[firstSpring]构建过程中发生错误。在项目“firstSpring”上运行构建器“分面项目验证构建器”时出错。无法初始化类org.
我正在使用Spring Cloud Config Server为我的客户端应用程序提供配置。为了方便机密配置,我使用HashiCorp Vault作为后端。对于其余的配置,我使用GIT repo。因此,我在复合模式下配置了配置服务器。请参阅我的配置服务器引导。yml如下:- 这一切都按预期工作。但是,我使用的代币使用Vault auth策略进行保护。见下文:- 我的问题是,我没有在所有这些范围内存
请有经验的人分享有关使用Spring Boot App配置db2数据库的建议? 创建一个Spring Boot应用程序,该应用程序将使用JpaRepository访问db2表,以使用Thymeleaf在HTML视图中呈现查询结果。 寻找关于如何配置使用Spring数据Jpa访问db2表的Spring Boot应用程序的一般说明。具体来说,我在构建中需要什么。渐变和应用程序。属性来实现这一点?