Cannot connect java client to Marklogic database

I just installed the MarkLogic nosql database out of the box on a windows machine. I wrote a simple javaclient to enter data into a database, but I get this error:

 org.apache.http.conn.HttpHostConnectException: Connection to http://my.caci.local:8003 refused
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)

The Marklogic database is launched. This is the code:

DatabaseClient client = DatabaseClientFactory.newClient("localhost", 8003, "admin", "admin", Authentication.DIGEST);

   XMLDocumentManager docMgr = client.newXMLDocumentManager();    BinaryDocumentManager binMgr = client.newBinaryDocumentManager();

   DOMHandle handle = new DOMHandle();    for (int i = 0; i < AANT_PERSONEN; i++)    {
      Document document = createDocument(i);
      String docId = "/zaak/" + 20;
      handle.set(document);
      docMgr.write(docId, handle);    }

....

The Marklogic console reports the following ports that will be active on my.caci.local:

Default :: Admin : 8001 [HTTP]
Default :: App-Services : 8000 [HTTP]
Default :: HealthCheck : 7997 [HTTP]
Default :: Manage : 8002 [HTTP]

I am new to marklogic and this is my question: - which port should I use to connect to my java client?

+4
source share
2 answers

In agreement with MystyxMac, I notice that the console is not reporting a REST server on 8003.

Here's the documentation for setting up a REST server:

http://docs.marklogic.com/guide/rest-dev/intro#id_97899

rest-reader, rest-writer rest-admin.

, ,

+3

, , 8000.

:

MarkLogic Server, REST API 8000. "" .

8000 , .

http://docs.marklogic.com/guide/rest-dev/service#id_15309

0

All Articles