I couldn't fix the issue, so I abandoned Play for Scalatra. I used the exact same code as above, and I'm now connecting to Cassandra fine. It must have been some Play dependency that didn't agree with the datastax driver.
Cassandra Connection Error: await*() in I/O thread causes a dead lock
-
22-07-2023 - |
문제
I'm trying to set up Cassandra and I'm following the cassandra setup here: http://www.datastax.com/documentation/developer/java-driver/2.0/java-driver/quick_start/qsSimpleClientCreate_t.html, but everytime I try to connect, I get the error:
java.lang.IllegalStateException: await*() in I/O thread causes a dead lock or sudden performance drop. Use addListener() instead or call await*() from a different thread.
Based off of this issue https://datastax-oss.atlassian.net/browse/JAVA-38, it looks like it may be a Netty conflict, but I don't know how to fix it. I'm using Play 2.2.3 for scala,the Datastax java driver 2.0.2, and Cassandra 2.0.3.
My code:
class SimpleClient {
private var cluster: Cluster = null
def connect(node: String): Unit = {
cluster = Cluster.builder().addContactPoint(node).build();
val metaData = cluster.getMetadata();
println(s"########## connected to cluster: ${metaData.getClusterName}")
}
def close() = {
cluster.close
}
}
해결책
제휴하지 않습니다 StackOverflow