I am trying to use JPL for the interaction of Java programs and YAP Prolog.
In my java file, this line is throwing an exception:
Query query = new Query("consult", new Term[] { new Atom("test.pl") });
The exception is shown below:
Exception in thread "main" jpl.JPLException: this Query's engine is not that which is attached to this thread
at jpl.Query.close(Query.java:511)
at jpl.Util.textToTerm(Util.java:165)
at jpl.Query.Query1(Query.java:183)
at jpl.Query.<init>(Query.java:176)
at Test.main(Test.java:12)
Although I did not find someone reporting the same problem in YAP, some people were having this problem with SWI, and they were advised to verify that SWI was compiled with multi-threading support. Just in case I compiled YAP with support for multithreading, but it did not help.
This problem is happening only in OS X, I tried in Ubuntu and everything works fine there.
Does someone know a workaround for this problem in OS X?
After updating Yap to 6.2.2 JPL is working correctly. Unfortunately I cannot be completely sure that the problem was indeed linked to the previous Yap version I was using (6.2.0) or it was related to something else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With