Ich möchte den Java-Treiber für ArangoDB in einem Maven-Projekt auf Eclipse verwenden. Ich versuche, das Tutorial für den Java-Treiber für ArangoDB here zu erhalten, aber ich kann nicht einmal die einfachere Anwendung zu arbeiten, auch von einem sauberen Projekt zu starten."nicht berechtigt, diese Anfrage auszuführen" mit dem Arangodb-Java-Treiber
main.java:
package test;
import com.arangodb.ArangoDB;
public class main {
public static void main(String[] args) {
ArangoDB arangoDB = new ArangoDB.Builder().build();
arangoDB.createDatabase("myDatabase");
}
}
pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.arangodb</groupId>
<artifactId>arangodb-java-driver</artifactId>
<version>4.2.0</version>
</dependency>
</dependencies>
</project>
ich folgende Fehlermeldung erhalten, wenn Sie den Code ausgeführt wird:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" com.arangodb.ArangoDBException: Response: 401, Error: 11 - not authorized to execute this request
at com.arangodb.internal.velocystream.VstCommunication.checkError(VstCommunication.java:106)
at com.arangodb.internal.velocystream.VstCommunicationSync.execute(VstCommunicationSync.java:134)
at com.arangodb.internal.velocystream.VstCommunicationSync.execute(VstCommunicationSync.java:46)
at com.arangodb.internal.velocystream.VstCommunication.execute(VstCommunication.java:96)
at com.arangodb.internal.velocystream.VstProtocol.execute(VstProtocol.java:46)
at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:58)
at com.arangodb.ArangoDB.createDatabase(ArangoDB.java:437)
at test.main.main(main.java:12)
Ich habe versucht, andere grundlegende Operationen, keine Arbeit (auch eine einfache arangoDB.getVersion();
).
Wenn ich die folgende Abhängigkeit der pom.xml hinzufügen, entfernt es Warnungen aber nicht die Fehler:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.22</version>
</dependency>
Ergebnis:
Exception in thread "main" com.arangodb.ArangoDBException: Response: 401, Error: 11 - not authorized to execute this request
at com.arangodb.internal.velocystream.VstCommunication.checkError(VstCommunication.java:106)
at com.arangodb.internal.velocystream.VstCommunicationSync.execute(VstCommunicationSync.java:134)
at com.arangodb.internal.velocystream.VstCommunicationSync.execute(VstCommunicationSync.java:46)
at com.arangodb.internal.velocystream.VstCommunication.execute(VstCommunication.java:96)
at com.arangodb.internal.velocystream.VstProtocol.execute(VstProtocol.java:46)
at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:58)
at com.arangodb.ArangoDB.createDatabase(ArangoDB.java:437)
at test.main.main(main.java:12)
In meinem Verständnis eine 'Antwort zu erhalten: 401' zeigt an, dass die Anmeldeinformationen zur Verfügung gestellt (oder nicht) nicht ausreichen, um das auszuführen Abfrage auf der Zieldatenbank. – Tome