<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Dear Alex,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thank you for &#8220;discovering&#8221; another limitation on debugging a ML application. I am looking forward to the views of the ML people. You may put me in cc if you wish.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Meanwhile I will probably (partly) reassemble my code allowing me to debug the code more easily. In any event, I will try this weekend to see if your solution is workable and satisfactory from an efficiency point
 of view.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Frank<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></a></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB"> Alex Jitianu [mailto:alex_jitianu@sync.ro]
<br>
<b>Sent:</b> 07 January 2015 14:01<br>
<b>To:</b> Frank Mortier; oxygen-user@oxygenxml.com<br>
<b>Subject:</b> Re: [oXygen-user] Oxygen 16.1 - Marklogic debugging scenarios<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">Dear Frank,<br>
<br>
Your observation was right on target. The cause of the problem is the fact that the module is being invoked with xdmp:eval() instead of being explicitly imported and referred. We are using Marklogic's dbg:line() function [1] to get the expression ID on which
 to invoke dbg:break() [2]. It is this call to dbg:line() that throws the exception and complains about not finding the module. Another aspect is that you can't get into these modules with the debugger. If you try to Step In on such an xdmp:eval() call you
 will see that the debugger will just go over it. All these are limitations of the API provided by MarkLogic so I've wrote an email to their support list reporting the issue and asking for possible solutions. I will keep you informed about the resolution and
 if you want I can also put you on CC to the emails we exchange.<br>
<br>
Until markLogic offers a solution it means that you will have to break the debugging session. For example when you reach an xdmp:eval() call you should decide if the result of this call is correct or it needs debugging. You can do that by:<br>
- put a breakpoint on the xdmp:eval() line and run to breakpoints<br>
- copy and paste the entire xdmp:eval() inside the XWatch View (when the debugger has reach it in the execution)<br>
<br>
After deciding that you want to debug the xdmp:eval() call you must get the actual query from xdmp:eval() For a query like this:<br>
<br>
xdmp:eval(fn:concat($import-declaration, $function-call),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;options xmlns=&quot;xdmp:eval&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;isolation&gt;different-transaction&lt;/isolation&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;prevent-deadlocks&gt;true&lt;/prevent-deadlocks&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/options&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>
<br>
you can use the XWatch View and evaluate there <i>fn:concat($import-declaration, $function-call)</i>. You will obtain something like this:<br>
<br>
import module namespace xqmvc-ctrlr = <a href="http://scholarsportal.info/xqmvc/controller">
&quot;http://scholarsportal.info/xqmvc/controller&quot;</a> at &quot;/application/controllers/welcome.xqy&quot;;xqmvc-ctrlr:index()<br>
<br>
Copy and paste it in a new XQuery editor and start the debugger over it directly from Oxygen. I know that this is a lot more complicated then it should be but until we get word from MarkLogic there isn't much we can do in this matter.<br>
<br>
[1] <a href="http://docs.marklogic.com/dbg:line">http://docs.marklogic.com/dbg:line</a><br>
[2] <a href="http://docs.marklogic.com/dbg:break">http://docs.marklogic.com/dbg:break</a><br>
<br>
<br>
<span style="font-size:12.0pt;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<pre>Best regards,<o:p></o:p></pre>
<pre>Alex<o:p></o:p></pre>
<pre>-- <o:p></o:p></pre>
<pre>Alex Jitianu<o:p></o:p></pre>
<pre>&lt;oXygen/&gt;&nbsp; XML Editor, Schema Editor and XSLT Editor/Debugger<o:p></o:p></pre>
<pre><a href="http://www.oxygenxml.com">http://www.oxygenxml.com</a> <o:p></o:p></pre>
<p class="MsoNormal">On 1/5/2015 7:51 PM, Frank Mortier wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:windowtext">Dear Alex,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">Thank you for taking the time to look at this.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">I am using 7.0-2.2 server version on a desktop windows 8.1. and the attached version of xqmvc 0.1.3 build. Sample test files are included in the build.
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">I have indeed tried a remote HTTP debugging session in accordance with your instructions and set breakpoints in the xqmvc.xqy file, the application controller files and application modules files. These module
 were opened from data source.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">Note that the files containing a breakpoint are not invoked by the main module but by intermediary modules (a hierarchical structure). Debugging seems only to work on files directly invoked by the main module,
 at least it does so on the xqmvc.xqy file, which is invoked by the main module (index.xqy).</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext">Frank</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">&nbsp;</span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB">
<a href="mailto:oxygen-user-bounces@oxygenxml.com">oxygen-user-bounces@oxygenxml.com</a> [<a href="mailto:oxygen-user-bounces@oxygenxml.com">mailto:oxygen-user-bounces@oxygenxml.com</a>]
<b>On Behalf Of </b>Alex Jitianu<br>
<b>Sent:</b> 05 January 2015 15:46<br>
<b>To:</b> <a href="mailto:oxygen-user@oxygenxml.com">oxygen-user@oxygenxml.com</a><br>
<b>Subject:</b> Re: [oXygen-user] Oxygen 16.1 - Marklogic debugging scenarios</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<div>
<p class="MsoNormal">Hello Frank,<br>
<br>
Could you please tell me what MarkLogic Server version are you using? Also what xqmvc build? I want to test it myself and see what happens. It would help if you have any XQuery sample files that I could test with this framework.<br>
<br>
You are trying to do a remote HTTP debugging session, right? Attach from Oxygen and debug an HTTP request that was already started probably using the browser?<br>
<br>
I see that you've already studied in depth our resources about how to debug in MarkLogic but just in case it might help, the steps required for remote HTTP debugging are:<br>
- create a connection in Oxygen using an XDBC App server that has the same module configuration as the HTTP one<br>
- put the HTTP server in debug mode using the Data Source Explorer, right click on the HTTP App server and &quot;Enable debug mode&quot;<br>
- return to the browser and initiate the request<br>
- return to Oxygen and from the &quot;Requests&quot; container of the HTTP App server right click on the request and choose &quot;Debug&quot;<br>
<br>
After these steps the debugger will be up and running and no breakpoints are yet added.&nbsp; Do you get this far? The warning you are receiving complains about some breakpoints. Have you set any breakpoints? If you have, are they in the main module or in a library
 module? And if they are in a library module how was this library module opened? From the Data Source Explorer?<br>
<br>
I've tested the previous procedure on the Shakespeare Demo [1] application.<br>
<br>
Thank you for taking the time to help us shed some light on this situation.<br>
<br>
PS: A transformation scenario is used to transform/execute an XQuery file. A validation scenario is used to configure what engine should be used to validate an XQuery file (for example while you work on it - automatic validation). A validation scenario also
 help when working on library modules because you can specify the main module from which the validation can start.<br>
<br>
[1] <a href="http://developer.marklogic.com/code/bill">http://developer.marklogic.com/code/bill</a>
<o:p></o:p></p>
<pre>Best regards,<o:p></o:p></pre>
<pre>Alex<o:p></o:p></pre>
<pre>-- <o:p></o:p></pre>
<pre>Alex Jitianu<o:p></o:p></pre>
<pre>&lt;oXygen/&gt;&nbsp; XML Editor, Schema Editor and XSLT Editor/Debugger<o:p></o:p></pre>
<pre><a href="http://www.oxygenxml.com">http://www.oxygenxml.com</a> <o:p></o:p></pre>
<p class="MsoNormal">On 1/4/2015 9:15 AM, Frank Mortier wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Dear all:<o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">I acquired Friday Oxygen 16.1 in order to debug a Marklogic application. I have encountered the same problem as Jacob in
<a href="http://www.oxygenxml.com/pipermail/oxygen-user/2013-June/004698.html">http://www.oxygenxml.com/pipermail/oxygen-user/2013-June/004698.html</a>.<o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">The ML application uses the xqmvc framework whereby the main file is index.xqy, but the routing is provided by another module xqmvc.xqy, importing controller files which import modules.<o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">See e.g.: <a href="http://www.marklogic.com/blog/founders-online-lesson-performance/">
http://www.marklogic.com/blog/founders-online-lesson-performance/</a> and <a href="https://code.google.com/p/xqmvc/">
https://code.google.com/p/xqmvc/</a><o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">I have been unsuccessfully testing various debugging scenarios yesterday, amongst others including all xqy files.<o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">I was also not able to debug a module in the basic framework.<o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">Related: what is the difference between using a validation scenario or a transformation scenario. I notice a difference between the documentation and the demo at
<a href="http://www.oxygenxml.com/demo/XQueryDebuggerforMarkLogic.html">http://www.oxygenxml.com/demo/XQueryDebuggerforMarkLogic.html</a><o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">Any suggestions? <o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">Frank<o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><br>
<br>
<br>
<br>
</span><o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>oXygen-user mailing list<o:p></o:p></pre>
<pre><a href="mailto:oXygen-user@oxygenxml.com">oXygen-user@oxygenxml.com</a><o:p></o:p></pre>
<pre><a href="http://www.oxygenxml.com/mailman/listinfo/oxygen-user">http://www.oxygenxml.com/mailman/listinfo/oxygen-user</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt">&nbsp;</span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,serif;mso-fareast-language:EN-GB"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>