[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave from java
From: |
George Kousiouris |
Subject: |
Re: octave from java |
Date: |
Fri, 15 Apr 2011 12:18:37 +0300 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 |
Hi,
are you sure you are capturing output and error streams efficiently?
There are many ways to do that, the most stable (we have tested it for
hours of execution of octave through Java) is raising threads in order
to capture output and error streams. You can find more info in the
following link:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
You can also use java to octave library
(http://kenai.com/projects/javaoctave/downloads), for parsing some info
from java to octave.
We have also made a stable service oriented implementation of octave
execution through web services and java. You can find an initial version
of the code here:
http://irmosserviceeng.svn.sourceforge.net/viewvc/irmosserviceeng/trunk/Mapping/src/
that illustrates the usage of threads in order to raise octave
executions and capture efficiently output and error streams.
hope it helps,
George
On 4/15/2011 11:47 AM, frank buloup wrote:
Hello,
I'm trying to use Octave from java but I'm facing a strange problem
that have already
been encountered. From java program, I'm using Runtime exec to start
an external
process, getting back input, output and error streams; sending command
using
output stream and parsing the result from input stream. Everything is
working fine
until a bad command is sent to Octave (a command containing a call to
a function
from a package that has not been installed for instance) : octave
seems to crash
and I 've not found any log file that could help me to debug something.
This problem has already been encountered, please see thread :
http://octave.1599824.n4.nabble.com/Octave-from-Java-td1630041.html#a1630055
Two points are mentioned from this thread :
1) Something has already been done in python using pipes or sockets -
At the begining of the thread
2) Using Runtime exec approach, you must use "--interactive" option
and read data in bytes - At the end of the thread
My questions :
1) Is anybody know how to use pipes or sockets and can give me some
links, starting points
that could help me ?
2) I did not understood the read "data in bytes". There is no
ByteBufferedReader class and
from a BufferedReader there exist only a read(char[],offset,length)
method, but it reads chars,
not bytes !!! Must we use a BufferedInputStream instead ?
Thanks a lot for your help,
frank
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
--
---------------------------
George Kousiouris
Electrical and Computer Engineer
Division of Communications,
Electronics and Information Engineering
School of Electrical and Computer Engineering
Tel: +30 210 772 2546
Mobile: +30 6939354121
Fax: +30 210 772 2569
Email: address@hidden
National Technical University of Athens
9 Heroon Polytechniou str., 157 73 Zografou, Athens, Greece
- Problem using fscanf, Utherr13, 2011/04/14
- Re: Problem using fscanf, Doug Stewart, 2011/04/14
- Re: Problem using fscanf, Bård Skaflestad, 2011/04/14
- Re: Problem using fscanf, Utherr13, 2011/04/15
- Re: Problem using fscanf, Bård Skaflestad, 2011/04/15
- octave from java, frank buloup, 2011/04/15
- Re: octave from java,
George Kousiouris <=
- Re: octave from java, Kim Hansen, 2011/04/15
- Re: octave from java, Utherr13, 2011/04/15
- Re: octave from java, frank buloup, 2011/04/15
- Re: octave from java, Kim Hansen, 2011/04/17
- Re: Problem using fscanf, Utherr13, 2011/04/15
- Re: Problem using fscanf, Bård Skaflestad, 2011/04/15
- Re: Problem using fscanf, Bård Skaflestad, 2011/04/15
- Re: Problem using fscanf, Jordi Gutiérrez Hermoso, 2011/04/15