简体   繁体   中英

Can I use Eclipse XQDT to debug Marklogic modules/xquery?

Hi Markloggers out there,

I am working now a coupe of months with Marklogic, developping xquery, modules, applications on the ML app server etc etc. I use eclipse a lot, I have XQDT up and running for several marklogic servers. We use the console also.

What I miss is a debug functionality... in Eclispe with XQDT I cannot get the debug function working?

What I need is a nice and clean way to quickly test and develop modelules and functions... This is my basic lib from the ML example documentation:

xquery version "1.0-ml";

module namespace lib = 'http://www.example.com/lib';

declare function lib:user()
{
xdmp:get-current-user()
};

I have this is my XQDT project in eclipse, I have setup a marklogic XDBC server locally and it works ok.

Now I want to use the above module from a file again in the XQDT project in eclipse. But without going to steps of uploading the module to the db etc etc...:

(: XQuery main module :)

import module namespace lib = 'http://www.example.com/lib' at 'lib.xq';

lib:user() 

Gives:

XDMP-MODNOTFOUND: (err:XQST0059) Module /lib.xq not found

Question 1: Is there a way to find the module without putting it in a module root? In the docs it says from a XQDT project I could source a module but I cannot get it to work...

Question 2: I can execute arbitrary xquery to the local Marklogic server but if I set a debug flag anywhere in a xgy file in the XQDT project and press the debug button I get a popup saying "The Debug Engine is not properly configured". Can anyone explain to me if it is possible to use the debug option in eclipse XQDT with Marklogic 7 ? Regards,

hugo

It's best to limit yourself to one question per SO post. After all you can only accept one answer.

Now I want to use the above module from a file again in the XQDT project in eclipse. But without going to steps of uploading the module to the db etc

That's a problem. You can evaluate an ad-hoc query directly. But if it references a library module, that library module needs to be available to the server. You're going to have to copy it to the server sooner or later anyhow, so do it sooner. I don't use an IDE myself, but can't you set it up to do that for you?

Question 1: Is there a way to find the module without putting it in a module root?

Not in the broadest sense of "module root", no. The docs at https://docs.marklogic.com/guide/app-dev/import_modules talk about how this works. Somehow or other, you need to make the library module available to MarkLogic.

I can't address your last question. I don't use an IDE, and even if I did I probably wouldn't use a debugger. Instead I xdmp:log messages to ErrorLog.txt , and occasionally I'll plant an breakpoint-like error() call in my code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM