Communicate with process � what am I doing wrong?

Hi,
I able to Execute a process, to read and to write to the application ( using the JVM).
My problem is that when I tray to send to the process another String, and to read the results,
The process isn�t receiving or displaying the results back .
In the example below: by typing the word 'HELP' I am receive a menu items. But when I send once again this String (or any other) noting happens.
The results is that only the first 'write' to the stream buffer work � the second word that I am sending is not getting to the process.
I will be very happy to get any help
Thank in advanced.
package com.surf.process;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import junit.framework.*;
public class PrcInt {
     protected BufferedReader is;
protected BufferedWriter bw;
     PrintWriter pw;
     private String prcPath="";
     private int prcDelay;
     private String prcData="";
     private Process p;
     public void openPrc()throws IOException, InterruptedException{
     String prcWin="";
     Runtime r = Runtime.getRuntime();
     String[] nargs = {prcPath};
     p = r.exec(nargs);
     Thread.sleep(prcDelay);      
     is = new BufferedReader(new InputStreamReader(p.getInputStream()));
     bw=new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
     public void write(String wData) throws InterruptedException, IOException{
               Thread.sleep(prcDelay);
          //      bw=new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
               bw.write(wData);
               bw.flush();
          Thread.sleep(prcDelay);
     public String read() throws IOException, InterruptedException{
          String line="";
          String prcWin="";
     //     is = new BufferedReader(new InputStreamReader(p.getInputStream()));
          while (is.ready())     {
               line=is.readLine();     
               prcWin=prcWin+line+"\n\r";
                    return prcWin;
     public void close() throws IOException{
          is.close();
          bw.close();
          p.destroy();
     public void setPrcDelay(int prcDelay) {
          this.prcDelay = prcDelay;
     public void setPrcPath(String prcPath) {
          this.prcPath = prcPath;
     public void clearR() throws IOException{
          is.close();
package com.surf.process;
import java.io.IOException;
import com.surf.process.C64Cmd.C64C;
public class PrcTest extends PrcInt implements C64C {
public static void main(String[] sd)throws IOException, InterruptedException{
          PrcInt ma =new PrcInt();
          ma.setPrcPath("C:\\D.exe");
          ma.setPrcDelay(500);     
          ma.openPrc();
          String g=ma.read();     
          System.out.println(g);
          ma.write("HELP"+Enter);
          String f=ma.read();
          System.out.println(f);
          ma.write("HELP"+Enter);
          String k=ma.read();
          System.out.println(k);
          ma.close();
}

In the settings in itunes, Info > Advanced all the small "boxes" should be unmarked. Then it should sync both ways.

Similar Messages

  • My ipod touch 2 no longer recognizes or syncs new playlists from my computer.  But it does takes the playlists from the ipod and syncs to the computer.  This is a reverse process - what am I doing wrong?  It always synced the correct way in the past.

    Why doesn't my ipod touch 2 recognize or sync new playlists from my computer?  It did in the past, but now the syncing process goes in reverse; the
    playlists on the ipod touch 2 sync to my computer!

    Was the iPod previous synced to another iTunes library/computer?
    Have you successfully synced from this iTunes library/computer before?
    If so have you done anything like update iTunes on the computer since it last successfully synced?
    Do the songs play in iTunes?          
    Does any media now sync to the iPod?
    Do you have the right boxes checked to sync?
    iTunes: Syncing media content to iOS devices and iPod       
    Try syncing using the manual method                
    Managing content manually on iPhone, iPad, and iPod
    - Backup and then restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       

  • Batch processing - what am I doing wrong?

    I am trying to batch process 30 or so fireworks PNGs in Fireworks 8.
    They are all similar. I want to alter their appearence by applying a hue/saturation filter.  I copy the filter command from history and save it with a name.  I select all the files I want batched and click the command name I saved.  What seems to happen is that one of the files gets filtered 30 or so times over and the others stay the same.  The same things happens whether I select the files by picking from a folder or clicking the 'include currently open files' checkbox.
    Any ideas please?

    Hi Steve,
    It looks like the command is not closing the current document and applying the filter on current document only.
    You will need to check once a document has been closed, a new document from the selected list should also open after it to apply the filters on it.
    ..Sarthak

  • Help!      On-Demand-Process - What am I doing wrong..

    I have a 3 select that works great! BUT, I'm trying to create a second one and have brought down to real basics and am missing something because it just won't hit my ODP.
    In a HTML Text region I have the following Javascript:
    <script language="JavaScript1.1" type="text/javascript">
    function f_call_odp() {
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=ODP_SERVICE',0);
    alert('In Javascript');
    </script>
    In a select list "HTML Form Element Attributes"
    I have :
    onChange="javascript:f_call_odp();"
    for my ODP I have:
    Name:
    ODP_SERVICE
    Process Text:
    BEGIN
    insert into debugtab values ('odp:', sysdate); commit;
    END;
    The table:
    CREATE TABLE "DEBUGTAB"
    (     "INPUT" VARCHAR2(4000),
         "TIMESTAMP_DTTM" TIMESTAMP (6)
    RESULTS:
    Alert pops up - so it hits the JS
    BUT no insert - so it isn't hitting the ODP
    ???? BILL

    The application that it is not working in is the Issue Tracker...
    We are using the results of the issue tracker to create a work order application..
    I went to the initial version and it doesn't work in it either.
    3 steps (if the debug table is created)
    1.) Add the Javascript to an HTML TEXT region.
    2.) Add the onchange JS to the select list
    3.) Create the ODP in the Application Processes.
    The simple code is below:
    1.)
    <script language="JavaScript1.1" type="text/javascript">
    function f_call_odp() {
    var gReturn = null;
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value ,'APPLICATION_PROCESS=odp_1',0);
    gReturn = get.get();
    alert(gReturn);
    alert('In Javascript');
    get = null;
    </script>
    2.)
    onChange="javascript:f_call_odp();"
    3.)
    BEGIN
    insert into debugtab values ('odp: TEST', sysdate); commit;
    END;
    Works great in a new app!
    But I can do the above in a NEW PAGE in my existing Issue Tracker app and it does not work.

  • I can't sync my calendar with outlook, what am i doing wrong

    I am trying to sync my new iphone 3GS & the calendar only seems to copy 1 way ie: from PC to phone thereby deleting info already in the phone.
    Where am I going wrong - please help if you can
    Thnks

    In the settings in itunes, Info > Advanced all the small "boxes" should be unmarked. Then it should sync both ways.

  • Help with HashMap - what am I doing wrong?!?!

    I'm hoping to create multiple instances of an object and identify each one differently. On an earlier thread, someone recommended I use a hashmap to do this. I'm trying but failing. The following code is intended to allow me to ask for 1 and get apple and ask for 2 and get banana. Instead, when I ask for either I get banana, which is making me think that I'm just rewriting over my object and putting two of the same instances in the hashmap.
    Thanks in advance!
    import java.util.HashMap;
    import java.util.Map;
    public class HashMapTest {
         private static Map <Integer, Bids> map;
         public static void main (String[] args) {
              Map map = new HashMap<Integer, Bids>();
              Bids myBids = new Bids("apple", 1.5, 1);
              map.put(1, myBids);
              myBids = new Bids("banana", 2.0, 2);
              map.put(2, myBids);
              Bids aBids = (Bids) map.get(1);
              String cat = aBids.getProductCategory();
              System.out.println(cat);
    Bids code:
    public class Bids {
         static String productCategory;
         private static Double price;
         private static int id;
         public Bids(String myProductCategory, Double myPrice, int myId) {
              productCategory = myProductCategory;
              price = myPrice;
              id = myId;
         public String getProductCategory(){
              return productCategory;
         public Double getPrice(){
              return price;
         public int getId(){
              return id;
    }

    jverd wrote:
    You have to override equals() and hashCode() in your Bids class.I'm not questioning the desirability of that, but is it mandatory? This works fine, without overriding either.import java.util.HashMap;
    import java.util.Map;
    public class HashMapTest {
      public static void main(String[] args) {
        Map<Integer, Bids> map = new HashMap<Integer, Bids>();
        Bids myBids = new Bids("apple", 1.5, 1);
        map.put(1, myBids);
        myBids = new Bids("banana", 2.0, 2);
        map.put(2, myBids);
        Bids aBids = map.get(1);
        System.out.println("1: " + aBids.getProductCategory());
        aBids = map.get(2);
        System.out.println("2: " + aBids.getProductCategory());
    class Bids {
      private String productCategory;
      public Bids(String myProductCategory, Double myPrice, int myId) {
        productCategory = myProductCategory;
        price = myPrice;
        id = myId;
      public String getProductCategory() {
        return productCategory;
    }db
    Edited by: DarrylBurke - I hate a laptop keyboard!

  • After attempting to process my movie, I get the following message. "The project could not be prepared for publishing because an error occurred. (OpWrErr: file already open with with write permission). Any ideas what I'm doing wrong?

    After attempting to process my movie, I get the following message. "The project could not be prepared for publishing because an error occurred. (OpWrErr: file already open with with write permission). Any ideas what I'm doing wrong?

    Hi
    Error -49 opWrErr  File already open with write permission
    Trash the preference files while application is NOT Running.
    from Karsten Schlüter
    Some users notice on exporting larger projects from within iMovie that this operation is aborted with an 'error -49'
    This issue occours only on MacOs machines using 10.7x
    try switching-off the Local Mobile Backup
    in Terminal copy/paste
    sudo tmutil disablelocal
    Re-launch Mac
    Yours Bengt W

  • Using my apple ID and password on Mobile Me, I get the message  "Verification Failed"  .  Could not communicate with the server.  What am I doing wrong?

    Using my Apple ID and password on Mobile Me, I get the message "Verification Failed".  Could not communicate with the server"  What am I doing wrong?

    There is a MobileMe forum.  You might have better luck their.

  • I set up iCloud on my iPad so I could sync with my iMac and now I cannot open documents on my iPad. What am I doing wrong?

    I have an iPad two running iOS 8.2, with pages 2.5.2
    Late 2012 21.5 inch iMac running Yosemite, with Pages 5.5.2
    Yesterday,following directions in iMac Magazine on my iPad I turned on iCloud for Pages.
    My documents disappeared from my iPad. After finding out how to locate them in iCloud I am unable to open them to edit or even read them for that matter.
    What am I doing wrong.
    Can I get my documents back on my iPad?

    Thanks.  That was indeed the problem.  A few hints for others with this problem.  You can only find out that you need to upgrade, and upgrade, by cabling your iPad to your computer.  Then the next Tricky part is making sure you have your iPad purchases saved on your computer.  Then you download the new OS upgrade and you will get a "start up" type of screen on your iPad with a few questions.  Nowhere is there a very good explanation that you want to then go back to your computer and restore your iPad.  I finally did that because there were no other obvious alternatives, though all the warnings made me very nervous.  After the restore command, I synched my iPad and I seem to have everything back, and I can now access iCloud.  maybe I missed some instructions somewhere, but I found this process much more obscure than the usual Apple directions. Thanks for your help!

  • What am I doing wrong with Export  w/ Action?

    OK, I am starting to love "stacking and virtual copys" of a combination of DNG,PSD,JPG ... all in the same folder.
    So, now I want to "stack" everthing that is generated from the original DNG file ... virtual copys, PSD & JPG. Much cleaner (thank's adobe!) and the Ctrl+E/stacking works like a charm, even with CS3 beta.
    Now, that I am loving "stacks" and having everything in a Day's shoot Folder (with NO sub-folders)... this is my problem:
    In CS3 I created a Action (converted to Droplet and put in LR actions folder) ... it's my usual Portrait plug-in and USM action ... the GOAL is to select all the DNG's in a Folder of the days shoot ... and Export it to PSD,16bit and RUN the action.
    In theory I should end up with all the PSD's in the same folder ... and be able see and "stack" these to the matching DNG's.
    * But, nooo ... when I run the export ... the PSD are in the same folder ... but, I cannot import it back into the Libary??? strange.
    LR tells me it's there ... but shows me the DNG (not the PSD)
    * What am I doing wrong?
    fyi: if you want to know what my goal is ... well, all I want to do is run the action ... and end up with a "stacked"
    1) DNG original
    2) PSD after the action is done (I have got to this point ... but it is not stacked and is not viewed in the LRv1 Library. (nor can it be imported) ... guess this is my biggest problem, right now.
    3) JPG that is converted to my Lab ICC profile .. generated from the PSD. (what I was going to do here is just select all the PSD files and Export and run another action)
    4) WEB JPG from my PSD.
    * note: after I generate a PSD ... I really want to get all my jpg's from the PSD files ... at that point.
    Since Adobe LR has got me HOOKED on using "Stacks" and virtual copys in LR ... I would like to run ALL my actions from LRv1 and after the Export+action is done, have the results back in the same folder "STACKED" to it's DNG file.
    * Now, THAT'S what I call POWERFUL! ... running an export+action and having the "result" back in the same folder "stacked" to it's DNG!!!
    So, there's a great function that will make LR the "killer app" (for me) ... have LR "image process" from the DNG or PSD and have it come back to the same folder "STACKED"!
    (so now ... everyone that wants that power will need to buy both CS3 & LR ... sounds like it's good for me and good for Adobe)
    Did I make this post too long? lol HG

    Thanks H-G.
    It won't stack automatically but perhaps autostack by capture time might work for most of them. You may need to sort out a few but most should work given the right timing (like 1 sec or something maybe)
    I try with the site, but the problem is that Lightroom for most people is a completely new way of doing things and people don't want to get their heads around this. I've been in since I saw a post on B1 in the Rob Galbraith news page the day after it was released. So I've grown with it.
    It's not feature complete, but then neither is V10 of Photoshop! It's still really good for a v1 tool though. Like someone else said, it's not a religious icon, but if it works for us great. I'm happy with it. I still use both PS CS and PSE as well, just not as much.
    Keep looking at lightroom-news.com too. We've a bunch of stuff planned.

  • All my purchased song from iTunes are not playing complete (iPod and computer with Windows Vista), unexpectedly stops and continues with next song. What am I doing wrong?

    All my purchased song from iTunes are not playing complete (iPod and computer with Windows Vista), unexpectedly stops and continues with next song. What am I doing wrong?

    Are the songs playing whole in iTunes? if not download them again.
    else read this Apple Support Article on your problem
    Have a nice day!

  • I create a playlist with songs that I purchased from itunes and when I try to sync it to my iphone some of the songs are missing but when I go to the playlist in itunes the song is there.  What could be happening?  What am I doing wrong?

    I've created playlists with songs I've purchased from iTunes and also added songs I've purchased from iTunes to existing playlists.  Everytime I go to sync the playlist to my iPhone I find some of the new songs missing from the playlist.  I've deleted the playlist from the phone and reinstalled it.  I don't know what I"m doing wrong. Anyone have any idea what could be the problem?

    Wondering if you haven't been bitten by the new "feature" of iOS 5, as was my son. turingtest2 explained it very well in reply to my own query about "missing" songs in playlists.
    Here's that thread...
    https://discussions.apple.com/message/16903613#16903613

  • With iOS 6 on my 4th gen iTouch I am finding I no have to delete the playlist from my iTouch, not the when I sync. Now the paylist is being deleted from my library as well. What am I doing wrong?

    With the new iOS 6 I have to use on my old iTouch (4th gen) instead of deleting a playlist thru the sync, I was instructed to delete it on the device. Now when I sync I am finding the playlist has been deleted from the library as well. I just want it off teh device, not erased. What am I doing wrong?

    See these previous discussions:
    Waiting applications: Apple Support Communities
    Downloading apps stuck on waiting...: Apple Support Communities

  • I have an older Macbook pro with a dvi output and I want to watch movies on my tv. I have a dvi to hdmi cable but the only image I get on my TV is my desktop background. None of my movie players with appear on the TV screen. What am I doing wrong?

    I have an older Macbook pro with a dvi output and I want to watch movies on my tv. I have a dvi to hdmi cable but the only image I get on my TV is my desktop background. None of my movie players with appear on the TV screen. What am I doing wrong?

    Hi Maryan,
    Open System Preferences > Displays > select the window for you external monitor > click on the Arrangement tab and check the box next to Mirror Displays. It may be slightly different in Lion, but the idea is the same.

  • When I try to open version 5.0.1 I get an error message: Platform version 5.o.1 is not compatable with minVersion =5.o.1 maxVersion =5.0. What am I doing wrong?.1

    I have a desktop Windows XP computer. I have tried loading the new version of firefox, and when I try to open this new version of firefox, this message appears all of the time. I have tried shutting down and restarting. I'm not sure what I am doing wrong.

    The updater wasn't able to update all the files and some were left as older versions.
    You need to do a clean reinstall.
    If there are problems with updating then best is to download the full version and uninstall the currently installed version.
    Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 5.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Uninstall your current Firefox version.
    * Do not remove personal data when you uninstall the current version.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    * http://kb.mozillazine.org/Profile_backup

Maybe you are looking for

  • Ipod will not play

    ok. everything is fine on my ipod, except when i go to play a song, no sound comes out and the timer doesnt move. i have the latest version of itunes and i have reset the ipod. also when i move the timer myself it goes black and the apple appears. pl

  • How do I re-install my address book application?

    While trying to import my contacts from my Hotmail account, I melted my Address Book application and had to send it to the trash. How do I re-install it? Can I re-install it? Do I have to re-install the whole operating system? Please help, I'm trying

  • E-Mailing in OBIEE - URGENT

    Hello, I am trying to schedule Answers and Publisher reports to be e-mailed to a set of recipients based on the below criteria. The recipients for the reports will be stored in tables (and available in the RPD) as explained below. Can I send e-mails

  • When I scan a document to my computer,it tells me my LCD list needs to be updated. What is this?

    I have an HP photosmart printer wirelessly conected to HP computer,with windows 7. Error message LCD list needs to be updated.

  • Reg: STACK 16 Problems

    Hi Folks, I know that SAP is going to release Stack 16 for Netweaver 2004s in 27th Week of this year, that would be July First week as per SAP Support Package Stack Schedule. We want to go for this Stack 16 as soon as it is released. So can you guys