0

I'm executing a KNIME workflow in batch mode from Java.

The output seems to indicate success, but the process never returns (I have to use a timeout parameter to kill it).

Question: Does anyone have an idea why the process never returns?

Executing [C:\Program Files\KNIME\KNIME.exe, -noexit, -nosplash, -nosave, -reset, -application, org.knime.product.KNIME_BATCH_APPLICATION, -workflowFile="C:\...\workflow.knwf", -workflow.variable=template.sdf,C:\...\template.sdf,String, --launcher.suppressErrors]  [main] at AntBuildLogger.messageLogged()
KNIME.exe stdout: CompilerOracle: exclude javax/swing/text/GlyphView.getBreakSpot                            [Thread-2] at AntBuildLogger.messageLogged()
KNIME.exe stdout: INFO   main BatchExecutor  ===== Executing workflow C:\...\workflow.knwf =====  [Thread-2] at AntBuildLogger.messageLogged()
...
KNIME.exe stdout: INFO   main BatchExecutor  Workflow execution done Finished in 3 secs (3937ms)             [Thread-2] at AntBuildLogger.messageLogged()
KNIME.exe stdout: INFO   main BatchExecutor  ============= Workflow executed sucessfully ===============     [Thread-2] at AntBuildLogger.messageLogged()

I'm using Windows 10 and KNIME 3.2.1.

I'm using the Ant Exec task programmatically, so I'm pretty confident that all the in/out/err streams are handled correctly (also I'm using that code to invoke many other executables).

Reto Höhener
  • 5,419
  • 4
  • 39
  • 79

2 Answers2

2

It is caused by the -noexit parameter (it is useful on Windows when manually started) as it prevents closing the process after finishing the execution.

Gábor Bakos
  • 8,982
  • 52
  • 35
  • 52
0

Windows requires the -consoleLog -noexit to keep a DOS window open to see the console output. Once you've tested the Knime batch run you can remove the -consoleLog -noexit parameters so it will not hang while waiting for the user to exit the process.

To see additional options you can run the following in a DOS window. knime.exe -consoleLog -noexit -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION

Ebrahim Jakoet
  • 307
  • 2
  • 13