I’m using: pengines and JavaPengines library latest version on Github
I want the code to: I want to send a sourceText and query to the pengines server using the JavaPengines library.
But what I’m getting is: However, from the extensive trial and error, it seems the JavaPengine library is somehow not compiling or executing the sourceText being sent.
My code looks like this:
PengineBuilder builder = new PengineBuilder();
try {
builder.setServer("http://localhost:3030/");
builder.setDestroy(false);
builder.setSrctext("cat(tom).");
builder.removeAsk();
pengine = builder.newPengine();
pengine.dumpStateDebug();
Query query = pengine.ask("cat(X).");
pengine.dumpStateDebug();
if ( !query.hasNext() )
fail("Query did not fetch result");
} catch (MalformedURLException
| CouldNotCreateException
| PengineNotReadyException e) {
e.printStackTrace();
fail("could not query server: " + e.getLocalizedMessage());
} finally {
if ( pengine != null && !pengine.isDestroyed() )
pengine.destroy();
}
FYI, tried to debug this with @ AnnieTheObscure already and raising it here as discussed with her. Thanks Annie for all the help and thanks to everyone here in advance for your help.