# Pengine issue

**URL:** <https://swi-prolog.discourse.group/t/pengine-issue/527>\
**Category:** Help!\
**Created:** [April 12, 2019, 12:15am UTC](https://swi-prolog.discourse.group/t/pengine-issue/527 "2019-04-12T00:15:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sighosh2](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sighosh2](https://swi-prolog.discourse.group/u/sighosh2)\
**Post date:** [April 12, 2019, 12:15am UTC](https://swi-prolog.discourse.group/t/pengine-issue/527/1 "2019-04-12T00:15:08Z")

</div>

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:

```prolog
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**](https://twitter.com/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.

---

<div class="post-metadata">

**Author:** ![anniepoo](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/anniepoo/32/12_2.png) [@anniepoo](https://swi-prolog.discourse.group/u/anniepoo)\
**Post date:** [April 12, 2019, 12:27am UTC](https://swi-prolog.discourse.group/t/pengine-issue/527/2 "2019-04-12T00:27:07Z")

</div>

Since bitrot in the JavaPengines libs is already a candidate, you might try running the tests. If you have JavaPengines running already should be trivial to do.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [April 12, 2019, 7:53am UTC](https://swi-prolog.discourse.group/t/pengine-issue/527/3 "2019-04-12T07:53:53Z")

</div>

I don’t think there has been renaming in the Prolog part or the JavaScript part. Git log might help.

---

<div class="post-metadata">

**Author:** ![anniepoo](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/anniepoo/32/12_2.png) [@anniepoo](https://swi-prolog.discourse.group/u/anniepoo)\
**Post date:** [April 12, 2019, 8:32pm UTC](https://swi-prolog.discourse.group/t/pengine-issue/527/4 "2019-04-12T20:32:41Z")

</div>

Jan - at one point didn’t the x-prolog script tag support go away, or some such? My memory is hazy here, but remember some interaction with you and Torbjorn when writing JavaPengines.

---

<div class="post-metadata">

**Author:** ![Ian](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ian/32/1026_2.png) [@Ian](https://swi-prolog.discourse.group/u/Ian)\
**Post date:** [April 14, 2019, 9:21pm UTC](https://swi-prolog.discourse.group/t/pengine-issue/527/5 "2019-04-14T21:21:19Z")

</div>

I’ve been writing a Pengine plugin for Netbeans (my preferred IDE), and have playing with the Java Pengines library, and noted a few issues.  
@anniepoo There is currently a bug in the JavaPengines java library. It is sending Srctext with the name ‘srctext’, whereas it should be ‘src\_text’, similarly, srcurl maybe should be src\_url (not tested).  
When using the library, the ask query should not end with a period since behind the scenes the query is embedded inside an ask() prolog term!  
Hopefully this should get you kickstarted.

---

<div class="post-metadata">

**Author:** ![anniepoo](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/anniepoo/32/12_2.png) [@anniepoo](https://swi-prolog.discourse.group/u/anniepoo)\
**Post date:** [April 14, 2019, 10:01pm UTC](https://swi-prolog.discourse.group/t/pengine-issue/527/6 "2019-04-14T22:01:41Z")

</div>

Hey, thanks!  
if you’ve patched your version, could you send a PR? if not, sighosh, sounds like a fix - anyway, if somebody sends pr that’d be cool.
