获取错误线程中的异常" main" java.lang.NoClassDefFoundError:io / netty / util / concurrent / DefaultThreadFactory,同时运行下面的代码。请告诉我我错过的罐子。使用NetBeans并手动添加jar,没有Maven。
setTimeout(function(){ $('#myModal2').modal('show') }, 500);
$('#myModal1').modal('hide');
我已经有以下罐子了。
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Session;
import java.lang.*;
import java.io.*;
public class Cassandra {
public static void main(String args[]){
//Query
String query = "CREATE KEYSPACE tp WITH replication "
+ "= {'class':'SimpleStrategy', 'replication_factor':1};";
//creating Cluster object
Cluster cluster = Cluster.builder().addContactPoint("localhost").build();
//Creating Session object
Session session = cluster.connect();
//Executing the query
session.execute(query);
//using the KeySpace
session.execute("USE tp");
System.out.println("Keyspace
}
}
答案 0 :(得分:0)
netty-3.9.0.Final.jar应该在class / lib路径中
答案 1 :(得分:0)
您需要在类路径中拥有netty-all-4.0.4.Final.jar。可以从这里下载:https://mvnrepository.com/artifact/io.netty/netty-all/4.0.4.Final
答案 2 :(得分:0)
确定你有以下所有罐子。我使用maven和copy-dependencies插件来提取所有jar
asm-5.0.3.jar
asm-analysis-5.0.3.jar
asm-commons-5.0.3.jar
asm-tree-5.0.3.jar
asm-util-5.0.3.jar
cassandra-driver-core-3.2.0.jar
guava-19.0.jar
jffi-1.2.10-native.jar
jffi-1.2.10.jar
jnr-constants-0.9.0.jar
jnr-ffi-2.0.7.jar
jnr-posix-3.0.27.jar
jnr-x86asm-1.0.2.jar
metrics-core-3.1.2.jar
netty-buffer-4.0.44.Final.jar
netty-codec-4.0.44.Final.jar
netty-common-4.0.44.Final.jar
netty-handler-4.0.44.Final.jar
netty-transport-4.0.44.Final.jar
slf4j-api-1.7.7.jar