'com.datastax.oss.driver.api.core.AllNodesFailedException' exception
All 1 node(s) tried for the query failed (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=localhost/127.0.0.1:9142, hostId=4e8b27ae-79f5-496a-a4ed-8ce0cb7bbb32, hashCode=aa1d75e): [com.datastax.oss.driver.api.core.servererrors.ServerError: java.lang.UnsupportedOperationException: can't get field offset on a hidden class: private final org.apache.cassandra.db.ClusteringComparator org.apache.cassandra.db.ClusteringComparator$$Lambda$143/0x0000000800d87768.arg$1]
使用 Java 14 可以正常工作。
那么Java 15真的不能与EmbeddedCassandraServerHelper一起正常工作吗?代码示例:
public CqlSession cqlSession;
@Before
public void setUp() throws Exception {
EmbeddedCassandraServerHelper.startEmbeddedCassandra();
cqlSession = EmbeddedCassandraServerHelper.getSession();
new CQLDataLoader(cqlSession)
.load(new ClassPathCQLDataSet("people.cql"));
PreparedStatement ps = cqlSession.prepare("INSERT INTO person(id, name) values(?,?)");
BoundStatement bs = ps.bind("1234","Mike");
cqlSession.execute(bs);
}
people.cql:
CREATE TABLE person(
id varchar,
name varchar,
PRIMARY KEY(id));
任何人都可以帮忙解决这个问题,我在任何文档中都遇到了同样的问题,或者我应该降级我正在使用 java 17 的版本