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]
Op 6 feb. 2014 21:39 schreef "Geert J." <[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]] *Namens *Erik van der Hoeven
> *Verzonden:* donderdag 6 februari 2014 21:31
> *Aan:* [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]
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general