Sol,
Welcome. I hope you’ve been able to get up and running successfully. As you get 
acquainted with MarkLogic and XQuery/XSLT I’d encourage you to post questions 
to this list. (Geert will answer them!)

As Geert indicated, it sounds like you’re trying to insert your document into a 
forest that’s not attached to the database running your code. If you’re in CQ, 
double-check the database drop-down. In general, you should not need to specify 
a forest when you load documents. MarkLogic automatically assigns documents to 
forests for the database against which your code runs. It does a pretty good 
job of distributing content in order to parallelize queries and even out 
storage. In some cases, based on application requirements or specifics of the 
content it makes sense to override this behavior and put content directly into 
a particular forest, hence the <forests> option. Without knowing more about 
what you’re trying to do, I’d suggest you leave out this option and just let 
the Server assign documents to a forest automatically. 

Justin

--
Justin Makeig
Senior Product Manager
MarkLogic Corporation


On Feb 13, 2011, at 12:39 PM, Sol Lederman wrote:

> Hi,
> 
> I'm new to MarkLogic.
> 
> I'm trying to create a service that imports a bunch of documents into ML. 
> I've created an HTTP application and I've created a .xqy script that calls 
> xdmp-document-load like this:
> 
> for $x in tokenize($urls," ")   
>   return
>    xdmp:document-load($x,
>    <options xmlns="xdmp:document-load" xmlns:http="xdmp:http">
>       <repair>none</repair>
>       <permissions>{xdmp:default-permissions()}</permissions>
>       <format>xml</format>
>       <http:authentication>
>           <http:username>xxxxxxxxx</http:username>          
>          <http:password>xxxxxxxx</http:password>      
>       </http:authentication>   
>       <forests>      
>            <forest>{xdmp:forest("MyForest")}</forest>
>       </forests>
>    </options>)
> 
> I then do a POST to the URL where the .xqy script is and I get this error:
> 
> <html xmlns="http://www.w3.org/1999/xhtml";>
>   <head>
>     <title>500 Internal Server Error</title>
>     <meta name="robots" content="noindex,nofollow"/>
>     <link rel="stylesheet" href="/error.css"/>
>   </head>
>                                                                               
>                                                                               
>                                                                               
>                                                                               
>                                                                               
>                                                                               
>                                               <body>
>     <span class="error">
>       <h1>500 Internal Server Error</h1>
>       <dl>
>         <dt>XDMP-FORESTNID: Specified forest 12171438460380643660 not in 
> database</dt>
>         <dd></dd>
>         <dt> [1.0-ml]</dt>
>         <dd></dd>
>       </dl>
>     </span>
>   </body>
> </html>
> 
> I believe the forest is there because cq loads the document just fine with 
> the exact same function call. Also, if I list the forests with the admin tool 
> that forest is there.
> 
> What am I missing?
> 
> Thanks.
> 
> Sol
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to