2017-11-28 6 views
0

グアバのバージョンが16以上になる必要がありますが、グアバを使用しています19.他に何かがあるかどうかを確認するツリーグアバ、しかし、そのバージョンだけです。マネージドBeanのカサンドラに接続しようとしているときにグアバエラーが発生する

@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ではなく、別のクラスに接続しようとすると、うまく動作します。

Caused by: com.datastax.driver.core.exceptions.DriverInternalError: Detected incompatible version of Guava in the classpath. You need 16.0.1 or higher. at com.datastax.driver.core.GuavaCompatibility.selectImplementation(GuavaCompatibility.java:138) at com.datastax.driver.core.GuavaCompatibility.(GuavaCompatibility.java:52)

事があり、私はグアバ、19.0使用しています、そして、それは以下の16を使用してイムを言って、私は以来、真実ではありません。

はしかし、管理対象Beanの内部で、私はこのエラーを取得します別のクラスのメインでそのコードを使用することができます。私はcassandra 3 btwを使用しています。

答えて

0

安全のためには、あなたのcassandra-driver-core依存関係と同じguavaバージョンを使用する必要があります。例えば。カサンドラ・ドライバ・コア3.0.0は16.0.1

をグァバを使用するエラーメッセージが、あなたのグアバのバージョンを推測 https://mvnrepository.com/artifact/com.datastax.cassandra/cassandra-driver-core

を参照してください。

関連する問題