Hi Erik, Your example looks right -- but that account looks like an Operating System account... You need to use the database credentials, which you were prompted for when you set up MarkLogic.
Charles On 02/06/2014 01:08 PM, Geert J. wrote: Hi Erik, So, you used instructions similar to the ones described at below page to create this ‘Administrator’ user inside MarkLogic Admin interface? http://developer.marklogic.com/learn/java/setup#create-rest-users Kind regards, Geert Van: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] Namens Erik van der Hoeven Verzonden: donderdag 6 februari 2014 22:00 Aan: MarkLogic Developer Discussion Onderwerp: Re: [MarkLogic Dev General] Java API error Hi Geert, As i mentioned, i use the Administrator account. The same account which i use for the installation of Marklogic. DatabaseClient client = DatabaseClientFactory.newClient("localhost", 8010,"Administrator", "<PASSWORD>", Authentication.DIGEST); // Make a document manager to work with text files. TextDocumentManager docMgr = client.newTextDocumentManager(); // Define a URI value for a document. String docId = "/example/text.txt"; // Create a handle to hold string content. StringHandle handle = new StringHandle(); // Give the handle some content handle.set("A simple text document"); // Write the document to the database with URI from docId // and content from handle docMgr.write(docId, handle); // release the client client.release(); }} Thanks a lot ? Met vriendelijke groet, Erik van der Hoeven Consultant Business Intelligence DIKW CONSULTING BV Einsteinbaan 12 3439 NJ Nieuwegein M: 06-43029943 E: [email protected]<mailto:[email protected]> Op 6 feb. 2014 21:39 schreef "Geert J." <[email protected]<mailto:[email protected]>>: Hi Erik, Can you provide a bit more details about which example, and how you executed it? The error sounds like you provided invalid credentials. You need to provide valid credentials for a user you created in MarkLogic. Typo perhaps? The other option is that you are using a user with insufficient privileges, e.g. needs more roles. But I’d expect a different message for that.. Kind regards, Geert Van: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] Namens Erik van der Hoeven Verzonden: donderdag 6 februari 2014 21:31 Aan: [email protected]<mailto:[email protected]> Onderwerp: [MarkLogic Dev General] Java API error Gentlemen, When i tried to execute the example of Marklogic JAVA API. Whith my administrator account. I have installed the complete lib directory of the Marklogic JAVA API. But now i get the following error: Exception in thread "main" com.marklogic.client.FailedRequestException: Local message: write failed: Unauthorized. Server Message: Unauthorized at com.marklogic.client.impl.JerseyServices.putPostDocumentImpl(JerseyServices.java:1093) at com.marklogic.client.impl.JerseyServices.putDocument(JerseyServices.java:904) at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:345) at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:280) at com.marklogic.client.impl.DocumentManagerImpl.write(DocumentManagerImpl.java:240) at tweetapi.DBClient.main(DBClient.java:41) Java Result: 1 I hope you can help me out Met vriendelijke groeten, Erik van der Hoeven Consultant Business Intelligence DIKW CONSULTING BV Einsteinbaan 12 3439 NJ Nieuwegein M: 06-43029943 E: [email protected]<mailto:[email protected]> _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general -- Charles Greer Senior Engineer MarkLogic Corporation [email protected]<mailto:[email protected]> Phone: +1 707 408 3277 www.marklogic.com<http://www.marklogic.com>
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
