Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > is possible capture InputStream Process to javaws application from another?

Reply
Thread Tools

is possible capture InputStream Process to javaws application from another?

 
 
Nicola Turri
Guest
Posts: n/a
 
      03-03-2007
Hello i have simple problem when launch java web start application to
another java program.


I do not succeed to capture the system.out of the application javaws.

what is problem?

this is my simple example.


import java.io.*;

public class Demo {
static void Demo()throws IOException {

// start the ls command running

Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("javaws
http://localhost:7080/myapp/myapp.jnlp" );

// put a BufferedReader on the ls output

InputStream inputstream =
proc.getInputStream();

InputStreamReader inputstreamreader =
new InputStreamReader(inputstream);
BufferedReader bufferedreader =
new BufferedReader(inputstreamreader);


// read the ls output

String line;
while ((line = bufferedreader.readLine())
!= null) {
System.out.println(line);
}

// check for ls failure

try {
if (proc.waitFor() != 0) {
System.err.println("exit value = " +
proc.exitValue());
}
}
catch (InterruptedException e) {
System.err.println(e);
}
}



public static void main(String[] args)
{

try
{

Demo();
}
catch(Exception ex)
{
ex.printStackTrace();

}

}
}


 
Reply With Quote
 
 
 
 
Joshua Cranmer
Guest
Posts: n/a
 
      03-03-2007
Nicola Turri wrote:
> Hello i have simple problem when launch java web start application to
> another java program.
>
>
> I do not succeed to capture the system.out of the application javaws.
>
> what is problem?


The javaws tool, by default, exits the application before the
application finishes, so there is no output to capture. If you ran the
command as javaws -wait it should work.
 
Reply With Quote
 
 
 
 
Nicola Turri
Guest
Posts: n/a
 
      03-04-2007
I have tried with cmd /c javaws -wait my.jnlp

but it does not work unfortunately



 
Reply With Quote
 
Joshua Cranmer
Guest
Posts: n/a
 
      03-04-2007
Nicola Turri wrote:
> I have tried with cmd /c javaws -wait my.jnlp
>
> but it does not work unfortunately
>
>
>

The answer is probably yes, but are you sure it actually produces output
on the output stream and not the error stream?
 
Reply With Quote
 
Nicola Turri
Guest
Posts: n/a
 
      03-05-2007
Hello, they are sure because the escape of the System.out.println , i see it
in java the java console .

perhaps it exists is a bugs with javaws.exe ?

Thanks


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      03-06-2007
On Mar 4, 1:01 am, "Nicola Turri" <ntu...@selin.it> wrote:
> Hello i have simple problem when launch java web start application to
> another java program.


What are you actually attemtping to achieve here?
Do you control the code for both apps., and will
they be coming of the same domain?

(You might look to using the persistence service
fo the JNLP API - if both the above are 'yes', or
sockets, to communicate between the two apps.)

Andrew T.

 
Reply With Quote
 
Nicola Turri
Guest
Posts: n/a
 
      03-06-2007
Thanks for the answer,

me remain always the doubt of because this not functions.

also on the forum of the Sun they have not known give me of the answers.

http://forum.java.sun.com/thread.jspa?threadID=5143600

I have uncovered that also other persons have the same problem .







 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Output from javaws Process Andrew Thompson Java 4 02-10-2009 07:23 AM
Javaws.exe Roedy Green Java 2 06-24-2005 01:39 PM
confused: Socket InputStream != ServerSocker InputStream R Java 5 03-13-2005 07:26 AM
javaws.jar or jnlp.jar? Ahmed Moustafa Java 0 07-14-2004 04:54 AM
Where is javaws.exe?? Roedy Green Java 51 10-29-2003 06:29 PM



Advertisments