title: Debugging Sling/Sightly server-side JavaScript
body: <p>I am trying to debug JavaScript that is stored in the JCR and run on the server with Rhino, by the Sightly templating language's <a href="http://docs.adobe.com/docs/en/aem/6-0/develop/sightly/use-api-in-javascript.html" rel="nofollow">JavaScript UseAPI</a>.</p>
  
  <p>As per the instructions provided in <a href="https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.launchpad.base-2.3.0/src/main/resources/sling.properties" rel="nofollow">sling.properties</a>:</p>
  
  <pre><code># To enable the current server side debugging in the Rhino interpreter
  # set the org.apache.sling.scripting.javascript.debug property to true.
  # This will open a Swing window for Rhino JavaScript debugging on the
  # server platform.
  </code></pre>
  
  <p>When I do this, I can see the Swing window for Rhino. However, if I try to set a breakpoint on a JavaScript file, or trigger the debugger by adding a <code>debugger;</code> line, the debugger breaks but does not show me the correct file.</p>
  
  <p>Similarly, if I select 'Break on function enter' from the Debug menu, the debugger will break but using 'Step Into/Over/Out' seems to jump to random points in the code.</p>
  
  <p>Is this working for anyone else? I'm using v2.0.14 of org.apache.sling.scripting.javascript which seems to be the latest.</p>