0

I have a problem when accessing arangodb using Java driver. When i run my application, it runs but neither it shows any response and nor it throws any error. Then i think it must be something on my connection to the remote arangodb server, and i tried to connect using Python arangodb, and it's success to connect.

Anyone knows what's the problem with my arangodb Java application? Is there any difference between java connector and python to arango? I'm using java driver arango 5.0.1

Here's what I've tried:

Java Driver :

public static void main(String[] args) {
        // TODO Auto-generated method stub

        @SuppressWarnings("deprecation")
        ArangoDB arangodb = new ArangoDB.Builder().timeout(100).host("10.22.21.70",8599).user("xxx").password("xxx").useProtocol(Protocol.VST).build(); 
        System.out.println("Test Start");
        ArangoDatabase db = arangodb.db("data");

        boolean tes = db.exists();

        System.out.println("success");
        arangodb.shutdown();
    }

This program continues to run like this, without being terminated and throwing an error : enter image description here

Using Python Arango :

import json
from arango import ArangoClient
from pyArango.connection import *


USER = 'xxx'
PASS = 'xxx'
HOST = '10.22.21.70'
DATABASE = 'data'
PORTT = 8599

client = ArangoClient(host=HOST,port=PORTT)
db = client.db(DATABASE,username=USER,password=PASS)

query = 'FOR s IN Email FILTER s.date>= "2018-11-07" LIMIT 0,2 RETURN s'
queryResult = db.aql.execute(query,batch_size=2,count=True)
res = queryResult.batch()


print(res)

And also i've tried to use telnet to the remote server, and it shows blank screen, which means no problem with the connection between my local host with the remote host.

Thanks

2
  • Possible duplicate of Remote access to ArangoDB through Java Interface Commented Nov 8, 2018 at 6:58
  • I think my question is quite different. Because i've tried to use telnet and it shows blank screen which tells the connection is OK. Commented Nov 8, 2018 at 7:09

2 Answers 2

0

I'm using java driver arango 5.0.1

I had the same issue. Using v4.2.2 solved the problem. If someone could explain why drivers are not compatible, that would be great.

Sign up to request clarification or add additional context in comments.

Comments

0

You are setting a timeout of 100ms, maybe you have higher network latencies while connecting to the remote server? To double check if this is the problem you can try without setting the timeout.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.