1

I had installed ML 9.0.3 and followed this document for setting up in my local and I edited config.properties to my requirement

# properties to configure the examples
example.admin_password=x
example.host=localhost
example.port=9963
example.authentication_type=digest

When I ran the first program in the console it is throwing error like this :

example: com.marklogic.client.example.tutorial.Example_01_CreateJSON
Exception in thread "main" java.lang.IllegalArgumentException: No user provided
    at com.marklogic.client.impl.JerseyServices.connect(JerseyServices.java:186)
    at com.marklogic.client.impl.JerseyServices.connect(JerseyServices.java:165)
    at com.marklogic.client.DatabaseClientFactory.newClient(DatabaseClientFactory.java:156)
    at com.marklogic.client.DatabaseClientFactory.newClient(DatabaseClientFactory.java:125)
    at com.marklogic.client.example.tutorial.Example_01_CreateJSON.main(Example_01_CreateJSON.java:37)

How can i resolve this issue?

1 Answer 1

2

The error message seems to indicate that no username was specified when it is attempting to connect on line 37:

DatabaseClient client = DatabaseClientFactory.newClient(Config.host, Config.port, Config.user, Config.password, Config.authType);

I don't see a username property in the properties that you provided. The tutorial shows the config.properties (which are missing from the properties you posed):

example.admin_user=rest-admin
example.writer_user=rest-writer
example.writer_password=x

The code for the Example_01_CreateJSON references the Config.user, which is obtained from the example.writer_user property:

protected static String user = props.getProperty("example.writer_user");

Your properties file must have an example.writer_user value defined, in order to know who to login as.

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

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.