I made a mistake, everything works fine using this code :)

        try {

            Runtime runtime = Runtime.getRuntime();
            Process pipelineProcess;


            String EXEC_CMD[] = {
                "C:\\Documents and
Settings\\vince\\Bureau\\ftp.daisy.org\\pipeline-lite-ms-20090312\\pipeline-lite.exe",
                "-x",
                "-q",
                "-s",
                "C:\\Documents and
Settings\\vince\\Bureau\\ftp.daisy.org\\pipeline-lite-ms-20090312\\scripts\\DAISY
Pipeline TTS Narrator.taskScript",
                "-p ",
                "input="+dtbookFile,
                "outputPath="+outputDir,
                "bitrate=32"
            };

            String EXEC_ENV[] = null;
            String EXEC_DIR = "C:\\Documents and
Settings\\vince\\Bureau\\ftp.daisy.org\\pipeline-lite-ms-20090312";

            System.out.println("PATH" + System.getProperty("java.class.path"));
            System.out.println("pipeline path:" + EXEC_CMD);
            System.out.println("Can execute pipeline ?:" + new
File(EXEC_CMD[0]).canExecute());
            pipelineProcess = runtime.exec(EXEC_CMD, EXEC_ENV, new
File(EXEC_DIR));

            InputStream stderr = pipelineProcess.getErrorStream();
            InputStreamReader isr = new InputStreamReader(stderr);
            BufferedReader br = new BufferedReader(isr);
            String line = null;
            System.out.println("<ERROR>");
            while ((line = br.readLine()) != null) {
                System.out.println(line);
            }
            System.out.println("</ERROR>");


            System.out.println("Wait for ...");
            int code = pipelineProcess.waitFor();
            System.out.println("exit value: " + code);


        } catch (Exception ex) {
            Logger.getLogger(UnoGUI.class.getName()).log(Level.SEVERE,
null, ex);
        }


On Tue, Mar 17, 2009 at 1:18 PM, Stephan Bergmann
<[email protected]> wrote:
> On 03/17/09 11:29, Vincent Spiewak wrote:
>>
>> Dear developers,
>> I'm trying to execute an external application (pipeline-lite.exe)
>> inside a Java Uno Extension.
>> OpenOffice.org crash without any additionnals informations.
>>
>> Do I need to make my runtime.exec() in another Thread ?
>
> No idea why OOo crashes, but two things to note from
> <http://java.sun.com/javase/6/docs/api/java/lang/Process.html>: "Because
> some native platforms only provide limited buffer size for standard input
> and output streams, failure to promptly write the input stream or read the
> output stream of the subprocess may cause the subprocess to block, and even
> deadlock." and "There is no requirement that a process represented by a
> Process object execute asynchronously or concurrently with respect to the
> Java process that owns the Process object."
>
> -Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Regards,

-----------------------------------------------------------------------
- Vincent Spiewak - odt2dtbook.sourceforge.net -
-----------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to