当前位置: 动力学知识库 > 问答 > 编程问答 >

java - All host(s) tried for query failed (tried: PC

问题描述:

I am doing Spring Dao with cassandra DB.But i unable to made the connection.

I am getting this Error

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Exception in thread "main"

com.datastax.driver.core.exceptions.NoHostAvailableException: All

host(s) tried for query failed (tried: PC264506/10.249.67.4:9042

(com.datastax.driver.core.TransportException:

[PC264506/10.249.67.4:9042] Cannot connect)) at

com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223)

at

com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78)

at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1230)

at com.datastax.driver.core.Cluster.init(Cluster.java:157) at

com.datastax.driver.core.Cluster.connect(Cluster.java:245) at

com.datastax.driver.core.Cluster.connect(Cluster.java:278) at

org.spring.cassandra.example.CassandraApp.main(CassandraApp.java:32)

My POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>org.spring.cassandra.example</groupId>

<artifactId>app-cass-tutorial1</artifactId>

<packaging>jar</packaging>

<version>1.0-SNAPSHOT</version>

<name>app-cass-tutorial1</name>

<url>http://maven.apache.org</url>

<repositories>

<repository>

<id>spring-milestone</id>

<name>Spring Maven MILESTONE Repository</name>

<url>http://repo.spring.io/libs-milestone</url>

</repository>

</repositories>

<dependencies>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>4.11</version>

<scope>test</scope>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-core</artifactId>

<version>4.2.4.RELEASE</version>

</dependency>

<dependency>

<groupId>com.datastax.cassandra</groupId>

<artifactId>cassandra-driver-core</artifactId>

<version>2.1.9</version>

</dependency>

<dependency>

<groupId>org.springframework.data</groupId>

<artifactId>spring-data-cassandra</artifactId>

<version>1.3.0.RELEASE</version>

</dependency>

</dependencies>

</project>

And i verified cassandra.yaml settings also...

分享给朋友:
您可能感兴趣的文章:
随机阅读: