【发布时间】:2017-11-28 22:47:18
【问题描述】:
它说我需要 guava 的版本超过 16,但我使用的是 guava 19。我什至做了 mvn dependency:tree 来检查是否有其他东西正在使用 guava,但只有那个版本。
@Named(value = "glicoseChart")
@Dependent
public class GlicoseChart implements Serializable{
private LineChartModel glicoseModel;
public LongTermPersistence longTerm;
@PostConstruct
public void init() {
createLineModels();
}
public LineChartModel getGlicoseModel() {
return glicoseModel;
}
private void createLineModels() {
glicoseModel = initLinearModel();
}
private LineChartModel initLinearModel()
{
LineChartModel model = new LineChartModel();
longTerm = new LongTermPersistence();
// VVVVVVVVVVVVV
longTerm.connectB();
尝试连接时出错。以及连接代码:
public void connectB()
{
this.cluster = Cluster.builder()
.addContactPoint("127.0.0.1")
.withPort(9042)
.build();
session = cluster.connect();
}
尝试构建集群时出错。但是,如果我尝试在另一个类中连接,而不是在托管 bean 中,它就可以正常工作。
但是,在托管 bean 中,我得到了这个错误:
原因:com.datastax.driver.core.exceptions.DriverInternalError:在类路径中检测到不兼容的 Guava 版本。您需要 16.0.1 或更高版本。在 com.datastax.driver.core.GuavaCompatibility.selectImplementation(GuavaCompatibility.java:138) 在 com.datastax.driver.core.GuavaCompatibility.(GuavaCompatibility.java:52)
问题是,我使用的是 guava-19.0,它说我在下面使用 16,这是不正确的,因为我可以在另一个类的 main.js 中使用那段代码。我正在使用 cassandra 3 顺便说一句。
【问题讨论】:
标签: java jsf primefaces managed-bean cassandra-3.0