Hi Jan,

Encouraged by your partial success, I gave this a try and after a little debugging of my own, I was able to make it work! The trick is related to the fact that Eclipse doesn't deal with "files" but rather "resources", and sometimes the relationship between a file and its corresponding resource can get a little unclear. If you're willing to live with one more modification to your program, then the debugger will work transparently. What you have to do is use the full filesystem path as your argument to "batch" or however you invoke the Jess code. Use the file that's in your Eclipse workspace -- i.e., for me, on my MacBook, I needed to use

engine.batch("/Users/ejfried/workspace/DebugExperiment/code.clp");

This, together with the steps below, then works like a charm. Knowing that, I think I can improve the next version of the debugger so that this dodge is unnecessary.

Good luck!

On Jun 4, 2010, at 8:26 AM, Jan Willem Lokin wrote:

Ernest,

It sort of works. That is, I can see in my log output that execution
stops at the breakpoint. However, the Debugger does not get notified
of this, i.e. the Resume button stays disabled, and no information is
displayed in the Variables view.

I'm wondering if it has to do with the fact that I now have to specify
my .clp file twice, both in my Java code and in the Debug launch
configuration.

-+- JW -+-

2010/6/3 Ernest Friedman-Hill <ejfr...@sandia.gov>:
If your program is a Java application and you can modify main(), then it's possible that the following will work. I've never tried it, or explained this to anyone else before, so please do let us know if it works for you.

In your main() routine, do this:

import jess.Main;
import jess.Rete;

public static void main(String[] args) {
   Rete engine = new Rete();
   Main main = new Main();
   main.initialize(args, engine);

   // Then use "engine" in your program
}

In the JessDE, use "Debug..." to create a Jess debug configuration, and
modify the main program class name to point to the main class of your
application. When the debugger launches your program, it will pass some
arguments to it, including

-debugPorts x y

where x and y are integers. That call to Main.initialize() should see those flags and open sockets to connect to those ports in background threads.
Breakpoints in the debugger should then work.



On Jun 3, 2010, at 8:24 AM, Jan Willem Lokin wrote:

Hi,

My setup is a Java program which loads Jess code using
jess.Rete.batch().  I am developing my program in Eclipse using
JessDE.  Is there a way to fool the JessDE Debugger so that it will
actually break on a breakpoint that I set in my .clp files? Any
pointers as to how it could be achieved are appreciated.

-+- JW -+-


---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs
PO Box 969, MS 9012                            ejfr...@sandia.gov
Livermore, CA 94550                             http://www.jessrules.com





--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users y...@address.com '
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov .
--------------------------------------------------------------------






--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov .
--------------------------------------------------------------------

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
--------------------------------------------------------------------

Reply via email to