0

1.Work well with spring-mongo in microservice.

2.Work well with spring-cassandra in microservice.

build project with gradle.

but when i add spring-cassandra into spring-mongo,there are errors.even just import spring-cassandra dependencies,without any cassandra

compile "org.springframework.data:spring-cql:1.5.0.M1"
compile "org.springframework.data:spring-data-cassandra:1.5.0.M1"
compile "com.datastax.cassandra:cassandra-driver-core:3.0.1"

The error trace is too long.just take a summary. throw exceptions

` ``

org.springframework.beans.factory.BeanCreationException
com.datastax.driver.core.exceptions.NoHostAvailableException

not caused by one class.when i run the test with gradle.all testcase throw this exception.and spring boot application cannot start.which worked well before.

and i have not added any java code to call datastax driver to connect cassandra.dont know why there is an exception about cassandra connection.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Code Stone
  • 129
  • 3
  • 12
  • What are the errors? – Andy Wilkinson Sep 07 '16 at 10:39
  • throw exceptions .org.springframework.beans.factory.BeanCreationException com.datastax.driver.core.exceptions.NoHostAvailableException have updated the question.th – Code Stone Sep 07 '16 at 11:10
  • It tries to connect probably because an auto configuration in Spring Boot is now active, after you added the dependency to Cassandra. Check which autoconfigurations are active and disable them, if you don't need it (or override the default Spring Boot configuration for Cassandra with a valid one). – dunni Sep 07 '16 at 11:23
  • you mean that once adding the spring-cassandra dependency.must provide a cassandra db instance to be connected.or disable the AutoConfiguration option.otherwise,it would throw the exception – Code Stone Sep 07 '16 at 11:36

1 Answers1

0

solve this issue by putting mongo/cassandr repository/model into different package

Code Stone
  • 129
  • 3
  • 12