Hallo,
ich habe die Aufgabe Daten aus Cassandra von unserem Server herauszuziehen.
Die Daten möchte ich später in Objekte speichern, vergleichen und bearbeiten.
Anschließend sollen die Daten wieder hochgeladen werden in Cassandra.
Die Sicherheitsrelevanten Daten habe ich mit xxx gekennzeichnet,
aber sie funktionieren. Kollegen arbeiten damit ich.
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
class Import {
public static void main(String[] args) {
String serverIp = "xxx.xxx.xxx.xxx";
String keyspace = "xxx";
String user = "xxx";
String password = "xxx";
Session session;
String cqlStatement;
Cluster cluster = Cluster.builder()
.addContactPoints(serverIp)
.withCredentials(user, password)
.build();
session = cluster.connect(keyspace);
cqlStatement = "SELECT * FROM lieferantendb";
for (Row row : session.execute(cqlStatement)) {
System.out.println(row.toString());
}
}
}
Ich bekomme allerdings folgende Fehlermeldungen:
"C:\Program Files\Java\jdk-9.0.1\bin\java" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\lib\idea_rt.jar=50967:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\Micha\IdeaProjects\Lieferantendatenbank\out\production\Lieferantendatenbank;C:\Program Files\Java\jdk-9.0.1\lib\src.zip;C:\Program Files\Java\jdk-9.0.1\lib\deploy.jar;C:\Program Files\Java\jdk-9.0.1\lib\javaws.jar;C:\Program Files\Java\jdk-9.0.1\lib\jrt-fs.jar;C:\Program Files\Java\jdk-9.0.1\lib\plugin.jar;C:\Program Files\Java\jdk-9.0.1\lib\java.jnlp.jar;C:\Program Files\Java\jdk-9.0.1\lib\ant-javafx.jar;C:\Program Files\Java\jdk-9.0.1\lib\javafx-swt.jar;C:\Program Files\Java\jdk-9.0.1\lib\jdk.deploy.jar;C:\Program Files\Java\jdk-9.0.1\lib\jdk.javaws.jar;C:\Program Files\Java\jdk-9.0.1\lib\jdk.plugin.jar;C:\Program Files\Java\jdk-9.0.1\lib\guava-16.0.1.jar;C:\Program Files\Java\jdk-9.0.1\lib\plugin-legacy.jar;C:\Program Files\Java\jdk-9.0.1\lib\jdk.plugin.dom.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-api-1.7.5.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-api-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-ext-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\netty-3.9.0.Final.jar;C:\Program Files\Java\jdk-9.0.1\lib\metrics-core-3.0.2.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-jdk14-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\jul-to-slf4j-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\jcl-over-slf4j-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-migrator-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\osgi-over-slf4j-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\log4j-over-slf4j-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-api-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-ext-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-jcl-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-nop-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-jdk14-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\cassandra-driver-core-2.0.2.jar;C:\Program Files\Java\jdk-9.0.1\lib\jul-to-slf4j-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-simple-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-android-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-log4j12-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\jcl-over-slf4j-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\osgi-over-slf4j-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\log4j-over-slf4j-1.7.25-sources.jar" Import
Jan. 03, 2018 10:31:19 VORM. com.datastax.driver.core.FrameCompressor$SnappyCompressor <clinit>
WARNUNG: Cannot find Snappy class, you should make sure the Snappy library is in the classpath if you intend to use it. Snappy compression will not be available for the protocol.
Jan. 03, 2018 10:31:19 VORM. com.datastax.driver.core.FrameCompressor$LZ4Compressor <clinit>
WARNUNG: Cannot find LZ4 class, you should make sure the LZ4 library is in the classpath if you intend to use it. LZ4 compression will not be available for the protocol.
Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.TransportException: [/127.0.0.1:9042] Cannot connect))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:196)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1104)
at com.datastax.driver.core.Cluster.init(Cluster.java:121)
at com.datastax.driver.core.Cluster.connect(Cluster.java:198)
at com.datastax.driver.core.Cluster.connect(Cluster.java:226)
at Import.main(Import.java:21)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.netty.util.internal.ByteBufferUtil (file:/C:/Program%20Files/Java/jdk-9.0.1/lib/netty-3.9.0.Final.jar) to method java.nio.DirectByteBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of org.jboss.netty.util.internal.ByteBufferUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Process finished with exit code 1
Ich weiß nicht genau wo das Problem liegt.
Hat Jemand vielleicht eine Idee was ich machen soll?
ich habe die Aufgabe Daten aus Cassandra von unserem Server herauszuziehen.
Die Daten möchte ich später in Objekte speichern, vergleichen und bearbeiten.
Anschließend sollen die Daten wieder hochgeladen werden in Cassandra.
Die Sicherheitsrelevanten Daten habe ich mit xxx gekennzeichnet,
aber sie funktionieren. Kollegen arbeiten damit ich.
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
class Import {
public static void main(String[] args) {
String serverIp = "xxx.xxx.xxx.xxx";
String keyspace = "xxx";
String user = "xxx";
String password = "xxx";
Session session;
String cqlStatement;
Cluster cluster = Cluster.builder()
.addContactPoints(serverIp)
.withCredentials(user, password)
.build();
session = cluster.connect(keyspace);
cqlStatement = "SELECT * FROM lieferantendb";
for (Row row : session.execute(cqlStatement)) {
System.out.println(row.toString());
}
}
}
Ich bekomme allerdings folgende Fehlermeldungen:
"C:\Program Files\Java\jdk-9.0.1\bin\java" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\lib\idea_rt.jar=50967:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\Micha\IdeaProjects\Lieferantendatenbank\out\production\Lieferantendatenbank;C:\Program Files\Java\jdk-9.0.1\lib\src.zip;C:\Program Files\Java\jdk-9.0.1\lib\deploy.jar;C:\Program Files\Java\jdk-9.0.1\lib\javaws.jar;C:\Program Files\Java\jdk-9.0.1\lib\jrt-fs.jar;C:\Program Files\Java\jdk-9.0.1\lib\plugin.jar;C:\Program Files\Java\jdk-9.0.1\lib\java.jnlp.jar;C:\Program Files\Java\jdk-9.0.1\lib\ant-javafx.jar;C:\Program Files\Java\jdk-9.0.1\lib\javafx-swt.jar;C:\Program Files\Java\jdk-9.0.1\lib\jdk.deploy.jar;C:\Program Files\Java\jdk-9.0.1\lib\jdk.javaws.jar;C:\Program Files\Java\jdk-9.0.1\lib\jdk.plugin.jar;C:\Program Files\Java\jdk-9.0.1\lib\guava-16.0.1.jar;C:\Program Files\Java\jdk-9.0.1\lib\plugin-legacy.jar;C:\Program Files\Java\jdk-9.0.1\lib\jdk.plugin.dom.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-api-1.7.5.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-api-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-ext-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\netty-3.9.0.Final.jar;C:\Program Files\Java\jdk-9.0.1\lib\metrics-core-3.0.2.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-jdk14-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\jul-to-slf4j-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\jcl-over-slf4j-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-migrator-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\osgi-over-slf4j-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\log4j-over-slf4j-1.7.25.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-api-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-ext-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-jcl-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-nop-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-jdk14-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\cassandra-driver-core-2.0.2.jar;C:\Program Files\Java\jdk-9.0.1\lib\jul-to-slf4j-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-simple-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-android-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\slf4j-log4j12-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\jcl-over-slf4j-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\osgi-over-slf4j-1.7.25-sources.jar;C:\Program Files\Java\jdk-9.0.1\lib\log4j-over-slf4j-1.7.25-sources.jar" Import
Jan. 03, 2018 10:31:19 VORM. com.datastax.driver.core.FrameCompressor$SnappyCompressor <clinit>
WARNUNG: Cannot find Snappy class, you should make sure the Snappy library is in the classpath if you intend to use it. Snappy compression will not be available for the protocol.
Jan. 03, 2018 10:31:19 VORM. com.datastax.driver.core.FrameCompressor$LZ4Compressor <clinit>
WARNUNG: Cannot find LZ4 class, you should make sure the LZ4 library is in the classpath if you intend to use it. LZ4 compression will not be available for the protocol.
Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.TransportException: [/127.0.0.1:9042] Cannot connect))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:196)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1104)
at com.datastax.driver.core.Cluster.init(Cluster.java:121)
at com.datastax.driver.core.Cluster.connect(Cluster.java:198)
at com.datastax.driver.core.Cluster.connect(Cluster.java:226)
at Import.main(Import.java:21)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.netty.util.internal.ByteBufferUtil (file:/C:/Program%20Files/Java/jdk-9.0.1/lib/netty-3.9.0.Final.jar) to method java.nio.DirectByteBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of org.jboss.netty.util.internal.ByteBufferUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Process finished with exit code 1
Ich weiß nicht genau wo das Problem liegt.
Hat Jemand vielleicht eine Idee was ich machen soll?