Hi nashorn-dev,
I'm relatively new to Nashorn.
I work on a java 8 application that needs to run server side javascript scripts 
using Nashorn. The java code runs the scripts at certain points using nashorn's 
eval function, like this:

SimpleBindings simpleBinding= new SimpleBindings();
              simpleBinding.put(....);
...
ScriptEngineManager factory = new ScriptEngineManager();
            engine = factory.getEngineByName("nashorn");
engine.eval("load('"+scriptpath+"');", simpleBinding);

In addition, I need to provide a way to debug those scripts.
The only option I could find was using Netbeans debugger (remote attach).
The scripts work fine.
The debugger, though, fails to stop at the breakpoints inside the scripts in 
the following scenario:
1-        Server started
2-        The script is running once
3-        Open Netbeans, attach remote debugger
4-        Run script again

It will stop at the breakpoints inside the scripts in the following scenario:
1-        Server started
2-        Open Netbeans, attach remote debugger
3-        Run the script

So, what am I doing wrong?
What can cause such behavior?
Is there a reasonable workaround?

Thanks in advance,
Dina

Reply via email to