Am I using proc:exec wrong?
Hello -- This is with BaseX 10.1 on a linux box: 18:02 graydon % java -version openjdk version "17.0.4" 2022-07-19 OpenJDK Runtime Environment (Red_Hat-17.0.4.0.8-1.fc36) (build 17.0.4+8) OpenJDK 64-Bit Server VM (Red_Hat-17.0.4.0.8-1.fc36) (build 17.0.4+8, mixed mode, sharing) I'm trying to invoke CoffeePot, https://coffeepot.nineml.org/ which is an ixml processor. In the BaseX GUI, proc:execute('/usr/bin/java','-version') gives me the expected version information as an error, despite a return code of zero: <result><error>openjdk version "17.0.4" 2022-07-19 OpenJDK Runtime Environment (Red_Hat-17.0.4.0.8-1.fc36) (build 17.0.4+8) OpenJDK 64-Bit Server VM (Red_Hat-17.0.4.0.8-1.fc36) (build 17.0.4+8, mixed mode, sharing) </error><code>0</code></result>
From a console, /usr/bin/java -cp /home/graydon/bin/coffeepot-package/coffeepot-1.99.8/coffeepot-1.99.8.jar org.nineml.coffeepot.Main
works fine, in as much as I get the list of coffeepot usage information I expect if it's run without arguments. proc:execute('/usr/bin/java','-cp /home/graydon/bin/coffeepot-package/coffeepot-1.99.8/coffeepot-1.99.8.jar org.nineml.coffeepot.Main') returns <result><error>Unrecognized option: -cp /home/graydon/bin/coffeepot-package/coffeepot-1.99.8/coffeepot-1.99.8.jar org.nineml.coffeepot.Main Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. </error><code>1</code></result> I suspect I'm doing something wrong, but it's not at all clear to me what. Anyone have suggestions? Thanks! Graydon
Hey Graydon - I'm on mobile and can't verify, but what about proc:execute($path-to-java, ('-cp', 'home/graydon/bin/coffeepot- package/coffeepot-1.99.8/coffeepot-1.99.8.jar', ' org.nineml.coffeepot.Main')) Multiple args need to be in a sequence, as I recall but I haven't had a chance to try this with v10.1. HTH! Bridger On Fri, Sep 2, 2022, 6:18 PM Graydon Saunders <graydonish@gmail.com> wrote:
Hello --
This is with BaseX 10.1 on a linux box: 18:02 graydon % java -version openjdk version "17.0.4" 2022-07-19 OpenJDK Runtime Environment (Red_Hat-17.0.4.0.8-1.fc36) (build 17.0.4+8) OpenJDK 64-Bit Server VM (Red_Hat-17.0.4.0.8-1.fc36) (build 17.0.4+8, mixed mode, sharing)
I'm trying to invoke CoffeePot, https://coffeepot.nineml.org/ which is an ixml processor.
In the BaseX GUI, proc:execute('/usr/bin/java','-version')
gives me the expected version information as an error, despite a return code of zero: <result><error>openjdk version "17.0.4" 2022-07-19 OpenJDK Runtime Environment (Red_Hat-17.0.4.0.8-1.fc36) (build 17.0.4+8) OpenJDK 64-Bit Server VM (Red_Hat-17.0.4.0.8-1.fc36) (build 17.0.4+8, mixed mode, sharing) </error><code>0</code></result>
From a console, /usr/bin/java -cp /home/graydon/bin/coffeepot-package/coffeepot-1.99.8/coffeepot-1.99.8.jar org.nineml.coffeepot.Main
works fine, in as much as I get the list of coffeepot usage information I expect if it's run without arguments.
proc:execute('/usr/bin/java','-cp /home/graydon/bin/coffeepot-package/coffeepot-1.99.8/coffeepot-1.99.8.jar org.nineml.coffeepot.Main')
returns <result><error>Unrecognized option: -cp /home/graydon/bin/coffeepot-package/coffeepot-1.99.8/coffeepot-1.99.8.jar org.nineml.coffeepot.Main Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. </error><code>1</code></result>
I suspect I'm doing something wrong, but it's not at all clear to me what.
Anyone have suggestions?
Thanks! Graydon
On Fri, Sep 02, 2022 at 06:55:36PM -0400, Bridger Dyson-Smith scripsit:
Hey Graydon -
Hi Bridger --
I'm on mobile and can't verify, but what about
Your memory was correct!
Multiple args need to be in a sequence, as I recall but I haven't had a chance to try this with v10.1.
They do. And I should have read "$args as xs:string*" that way. Sigh. But at least it runs! -- Graydon Saunders | graydonish@gmail.com Þæs oferéode, ðisses swá mæg. -- Deor ("That passed, so may this.")
participants (3)
-
Bridger Dyson-Smith -
Graydon -
Graydon Saunders