To get InputStream of a Process

Hi i am trying to run a java program using Process class here is the code
Runtime p =Runtime.getRuntime();     
String a1= "java \"C:\\Program Files\\Java\\jdk1.6.0_07\\bin\\First\" ";
Process r=p.exec(a1);
BufferedReader bread= new BufferedReader(new InputStreamReader(in));     
String st;
while((st=bread.readLine())!=null)
System.out.println(st);
First is a compiled java code i want to run the file instead of printing the output of the program i want to store it in a String
now the problem is it goes to infinite loop just waiting
help

1. You don't specify the full path to the Java class. That won't work. You have to give the fully-qualified classname, and that has to reflect a path relative to some classpath root. This is always the case with Java, whether you're doing runtime.exec or not.
2. To get the streams of a process you launch, see this: [http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html]
3. Consider using ProcessBuilder, rather than Runtime.exec.

Similar Messages

  • HOW CAN I GET MY CHANGE IN PROCESSING(got it)?

    Hi all....
       please understand my requiement and get back with your valueble answers...
    iam having one table control in one of my screen....
    in that....table control it contains three fields.... so as we know three columns...
    middle column is for second field...
      here i am changing first entry ( 1st row of second column) manually... and clicking one push button of my screen to do some caluclation part combine with table control entries...
    ex: table controls looks like.....(before)
         1   100 ab
         2   200 gh
         3   300 vf
         4   400 fh
         .. .... ......  etc
    now manual i changed above like....(after)
         1   150 ab       <------ only change
         2   200 gh
         3   300 vf
         4   400 fh
         .. .... ......  etc
    So... here my problem is iam getting my caluculation part with that field as 100 only.... not as 150,
    even i debug this variable with defferent conditions like......
       READ TABLE ITAB WHERE ITAB-F1 = 1.
    SO HOW CAN I GET MY CHANGE IN PROCESSING? WHERE I HAV TO MODIFY MY PROGRAM?
    (edited: prevoius ly this value is capturing correctly...because that calculation part is in the module which is added between chain and endchain)
    Expect Max marks,
    Thanks,
    Naveen
    Edited by: Naveen Inuganti on May 27, 2008 11:57 AM
    dont worry guys i got the answer.... we have to catch that varible in the chain and endchain operater.... by using module.....
    thank you all...
    bye...
    Edited by: Naveen Inuganti on May 27, 2008 3:41 PM
    Edited by: Naveen Inuganti on May 27, 2008 4:00 PM
    Edited by: Naveen Inuganti on Jun 13, 2008 11:44 AM

    Hi,
    I think f2 is a key field in table.So 150 considered as new entry.this case you have to keep 100 for delete from table then add 150 entry.i think you are getting update in itab.But not in table.If you  are not getting itab, post your code to check

  • I am getting an error in process chain in bw 3.5?

    Hi all,
    I am getting an error in process chain in bw 3.5?
    @5D@     A type "Activate ODS Object Data" process cannot precede process "Execute InfoPackage" var. ZPAK_4GT51KCFLGM9VPY80NI7UPCFJ in th     @35@
    I was just executing an initial ods -> activate ods as well as -> further update ods is getting generated and then 2nd ods-> activate ods -> further update ods too.
    Why does further update ods gets selected automatically?
    Thanks
    pooja

    Hi Pooja
    Are you talking about update ods object data?
    Please check this http://help.sap.com/saphelp_nw70/helpdata/en/12/43074208ae2a38e10000000a1550b0/content.htm
    Edited by: Chandamita Sarmah on Feb 11, 2010 4:43 PM
    Edited by: Chandamita Sarmah on Feb 11, 2010 4:46 PM

  • TO Get  Ensuring Exactly Once Processing data from sender soap adapt

    To XI Specialists
    Now Im trying to get Ensuring Exactly Once Processing data from sender soap adapteter.
    My plan is that send data from Receiver adapter, to Sender adapter by SOAP.
    (1st interface is ABAP to Soap "BE", 2nd interface is Soap to File "EO")
    Sender SOAP adapter will returun Ensuring Exactly Once Processing data.
    (see SAP HELP, http://help.sap.com/saphelp_nw70/helpdata/en/69/a6fb3fea9df028e10000000a1550b0/frameset.htm )
    AND I want to get Ensuring Exactly Once Processing data, I want to determine what to do in ABAP proxy.
    SO I made and tested 2interface. but error occuered.
    I checked the error, and Now I know what is the cause.
    The cause is that Ensuring Exactly Once Processing data didnt enter the payload, at Receiver Adapter.
    1st interface coulnt get the payload data, so mapping error occuered....
    Please give me help,
    <b>"How to get Ensuring Exactly Once Processing data From Sender SOAP ADAPTER"</b>
    or
    <b>"How to enter Ensuring Exactly Once Processing data into Payload of Receiver SOAP ADAPTER"</b>
    and more excelent way....
    our XI is version7.0 and SP10
    Please teach me your wisdom!
    Naoki Kurihara

    I seeked and I noticed that
    maybe I catched the message but the message dont have payload.
    so I got no_payload error.
    I checked SAP note.
    I noticed, no_payload error will be managed to nomal message at SP13....
    my XI is SP12....
    I ll seek for another way!!
    Thank you! noaki

  • How to get InputStream of uploaded file from request?

    The situation:
    Client is uploading xml file to server.
    <form METHOD=POST ENCTYPE = "multipart/form-data" action="SendFile" accept="text/xml">
              <input type="file" name="SentFile" />
              <input type="submit" value="go"/>
    </form>Then I need to parse data from file.
    I want to use method javax.xml.parsers.DocumentBuilder.parse(InputStream is)
    But, how to get InputStream of uploaded file from request?

    You cannot get the InputStream of the uploaded file directly. The InputStream you can obtain from request.getInputStream() contains a lot of other data as well as the uploaded file. You will have to parse the data in the InputStream to find the data that belongs to the file.
    A short cut is to use the HTTP Multipart File Upload available from www.jenkov.com. It simplifies file upload and makes it easy to obtain an InputStream for only the uploaded file. It also handles upload of multiple files. It is free, open source, Apache license, so if it doesn't fit your needs, you can always read the code and see how it works. Then write your own upload servlet.

  • How to get InputStream from String ?

    Hi !
    I want to get InputStream object from String.
    String str = "balabalabala";
    InputStream stream = getInputStream(str);
    How to realize getInputStream(str) function ?
    Thanks!

    The preferred method nowadays is to use Readers and Writers for String data - hence StringReader(String). If you're going to operate on the InputStream directly, then I'd modify your code to use the Reader calls and go that route.
    If, however, you need to pass the InputStream to some other piece of API that requires an InputStream instead of a Reader, then the ByteArrayInputStream is probably your best bet. StringBufferInputStream is deprecated because it doesn't work reliably in the face of many character encodings.
    Speaking of encodings - never call Strng.getBytes() - always use the getBytes(character-encoding) version, so you KNOW what encoding you're getting!
    Grant

  • Updates getting stuck in V2 processed state

    Hi,
    In our ERP production system EP0, update entries are getting stuck
    in 'V2 Processed' state.
    Details of the same show that the collective run state is in initial
    state for functional module 'MCEX_UPDATE_03'.
    Please find the attached screenshot of details.
    These updates are gettin stuck for specific transactions like MIGO.
    We have already tried running the report RSM13005 but it has not helped.
    Please look into it urgently as the system is a production system.
    Thanks in advance.
    Regards,
    Suresh
    Edited by: suresh k on Sep 26, 2008 2:38 PM

    Hi
    As you checked in transaction SM13 they are stucked in Initial state. There was various states associated with the update like INIT and ERR.
    What is INIT status:
    Update records which have not yet been processed have the status INIT or AUTO. INIT refers to a complete update record (header, function module call of update and data elements are present), which has not yet been processed however.
    What to do: SM13 -> Update records -> Update -> All records/Single
    you can set the update administration so that all records with the status 'INIT' or AUTO' (all update records which have not yet been updated) are processed (as far as possible).
    Warnings: please check with the user who posted the updates in the first place - make sure that they have not already reposted the update manually. If you are in doubt, please re-enter the data manually rather than using this update function.
    Hope this helps!!
    Kind Regards
    Esha
    Edited by: Esha Rajpal on Sep 30, 2008 5:06 AM

  • PAPI: Get processId of subflow process from Activity list of parent process

    Using PAPI or PAPI-WS how can I get the processId of the related process of a subflow activity?
    Specifically, I want to get the processId of all the subflow processes of a parent process provided I only have the parent process ID.
    For example, lets say my project has three processes with the following ID's:
    MainID1
    SubflowID1
    SubflowID2
    Assume my main process is MainID1 and that is only made up of two activities:
    1) a subflow activity that has SubflowID1 as the related process.
    2) a subflow activity that has SubflowID2 as the related process
    So in my case I need to get back "SubflowID1" and "SubflowID2" provided that initially I only know the ID of the main process MainID1.
    With PAPI/PAPI-WS I can get the list of activities of a process. So I can get back a list of two activities of type "SUBFLOW" for MainID1. However the activity object only gives me the ID of the activity itself and of the activity's parent process. It doesn't contain the ID of the subflow related process. Is there a way to do this?
    Please let me know if this needs further explanation. I know it's somewhat convoluted. Thanks!

    So you need a way to traverse through a process hierarchy even though instances may not be in the process? Sounds like you've created some type of recursive process topology and want to find related activities in the sub-process structure even though instances are not in the structure. If so, I've never seen a use case for this and so I wouldn't know how to do it. FindInstanceByFilter is your closest thing you have. But not having instances in the sub-processes to get information about the process hierarchy prohibits this. Perhaps you can plant tracer instances that you can normally filter out from normal work-flow. When you need to obtain a process hierarchy then you just look for these tracers.
    Interesting problem. Sorry I don't have a good answer.
    Edited by: Mark Peterson on Feb 18, 2010 6:08 AM

  • I keep getting "Problem during delivery processing" messages

    This morning I started getting "Problem during delivery processing" messages like this one...

    Same problem here. And i can't fine apple support contact for submit this problem. Bad bad bad bad support page appe .

  • HT1212 i have lost my password and been trying to restore but don't understand way it never get completed(my ipad3 gets on between the process and itunes reminds me that the device is passcode protected so it can't be connected and then the download also

    after attempting many worng passwords my ipad atlast ask me to connect to the itunes and there is't any other option it is showing on it , and don't have the backup of my ipad on my pc so search the net and got the answer to restore it ......
    i have lost my password and been trying to restore but don't understand way it never get completed(my ipad3 gets on between the process and itunes reminds me that the device is passcode protected so it can't be connected and then the download also stops) some times at 500mb and even at 700mb
    please if some one know the sloution
    help me
    thanks
    its ipad 3

    Follow these instructions to resolve a forgotten passcode:
    http://support.apple.com/kb/HT1212

  • HT4623 i have downloaded and installed the new ios7 software on my iphone 4s but im having trouble getting through the activation process i keep getting the message "iphone could not be activated because the activation server cannot be reached"? help??

    I have downloaded and installed the new ios7 software on my iphone 4s but im having trouble getting through the activation process i keep getting the message "iphone could not be activated because the activation server cannot be reached"? any suggestions?

    The activation servers are probably overloaded with everyone trying to update to iOS 7 today.  You might need to wait and try again later. 

  • Direct linking from Premiere gets stuck at post processing

    Hi Guys,
    I have a huge project from Premiere. It's a feature about 1hr 32mins that i tried to direct link to speed grade. Speed grade loads up and it gets stuck at post processing. I read that people recommend exporting as an EDL but you only have 1 track of video? and I have like 9 tracks. What do you guys recommend doing?
    heres the setup I have.
    Macbook Pro Retina 15".
    256gb SSD
    16gb Ram
    Adobe CC
    Project sits on 2 thunderbolt drives.

    i turned off the intel gpu and only ran on the 1gb card. still nothing. left it alone for 5 hours while it was in "post processing" and didn't load. im getting nervous, even if I got it to work and it crashes on me; I cant afford to wait on it.
    I went ahead and exported my project to quicktime and currently working in Resolve 10 Lite. The scene detection was a lot faster than speedgrades. Im not here to knock on adobe/speed grade. hopefully you guys can fix this soon?
    thanks
    P-

  • [pppacker] ERROR: Failed to pack public part: Failed to get InputStream fo

    Dear Friends,
                  I have downloaded the ECC_PURCHASEORDER002QR from HU2 system (wadmin)  & saved on Local PC with extension as .xml.
    I have created External Service by picking up this WSDL from Local pc.
    When i try to build this its giving me packing error
    error text
    [pppacker] ERROR: Failed to pack public part: Failed to get InputStream for resource C:\Documents and Settings\chandra.dasari\.dtc\LocalDevelopment\t\8A377BFE144E14E551EDE29FADD14317\classes\com\sap\es_po\extsrv\purchaseorderbyidqueryresponse__in\input\Ns1_parameters$Ns1_PurchaseOrderByIDQueryMessage__sync$PurchaseOrderSelectionByID$Ns1_PurchaseOrderID.class
    We are currently using NWDS v7.0.07 with java SP 12.
    Any pointers to resolve this issue.
    Regards shekar chandra

    just out of curiosity why don't you use the RFC connection instead of web service? you seem to be calling an abap system.
    anyway, just to be sure i guess you mean importing a web service into CAF Core as external service. Right?
    what's the nature of your import parameters and your table definitions?
    See there're limitations using complex types with web services. you have less problems if you're importing RFC into CAF Core. My guess is that you're using complex types in your RFC definition that cause problems when translated into WSDL. Can you try at least to the tutorial 85 "Using RFCs as External Services (Service)" https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b3529fea-0c01-0010-76a5-cf1239e38fd9?

  • Unable to get notifications thru BPEL process

    Hi,
    I am trying to develop a simple email notification process thru BPEL.
    I have set up a notification to send to my email id.
    While execution, I am getting the following error (process is in faulted state)
    InvokeNotificationService (faulted)
    [2006/06/09 06:45:58] "{http://xmlns.oracle.com/ias/pcbpel/NotificationService}NotificationServiceFault" has been thrown. less
    <NotificationServiceFault>
    <part name="faultInfo" >
    <faultInfo>500 'HELO batoleti-PC': command not understood. </faultInfo>
    </part>
    </NotificationServiceFault>
    the ns_email.xml content is:
    <EmailAccounts xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <EmailAccount>
    <Name>Default</Name>
    <GeneralSettings>
    <FromName>Oracle BPM</FromName>
    <FromAddress>[email protected]</FromAddress>
    </GeneralSettings>
    <OutgoingServerSettings>
    <SMTPHost>dlsun4254.us.oracle.com</SMTPHost>
    <SMTPPort>21</SMTPPort>
    </OutgoingServerSettings>
    <IncomingServerSettings>
    <Server>dlsun4254.us.oracle.com</Server>
    <Port>21</Port>
    <Protocol>IMAP</Protocol>
    <UserName>bpm1</UserName>
    <Password ns0:encrypted="false" xmlns:ns0="http://xmlns.oracle.com/ias/pcbpel/NotificationService">welcome</Password>
    <UseSSL>false</UseSSL>
    <Folder>Inbox</Folder>
    <PollingFrequency>1</PollingFrequency>
    <PostReadOperation>
    <MarkAsRead/>
    </PostReadOperation>
    </IncomingServerSettings>
    </EmailAccount>
    Can you please help me on how to reslove the NotificationServiceFault?
    Thanks in advance.
    Bala.

    you use the wrong port ..
    21 is for telnet, smtp is 25
    hth clemens

  • Cant get inputstream in servlet

    Hi,
    I am using tomcat 5.0 and trying to get inputstream in servlet to print the content which i got from client..
    Here is the code of my doGet()
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         System.out.println("In Doget");
         try
              InputStream in = request.getInputStream();
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String line = br.readLine();
              System.out.println("Line :"+line);
              while (line != null)
                   System.out.println("Line :"+line);
                   line=br.readLine();
         catch (Exception e)
              System.out.println("Exception occured in doGet:");
              e.printStackTrace();
         System.out.println("End of doGet :::");
    When it try to invoke above servlet with this URL( http://localhost:8080/USUResetPasswordServlet?afadfasfd ), it is suppose to print me "afadfasfd" in the server console..But is not..Any idea, why it is failing...
    Thanks in advance
    Satya

    Hi,
    Thanks for the response..
    It is some thing confusing..Let me put it this way..I
    am trying to contact the servlet from a java
    program..Here is the code for it..
    URL servlet = new
    URL("http://127.0.0.1:8080//USUResetPasswordServlet");
    String xmlStr = "<hai>hasafd</hai>";
    URLConnection connect = servlet.openConnection();
                   connect.setDoOutput(true);
                   connect.setDoInput(true);
                   //connect.connect();
                   OutputStream outStr = connect.getOutputStream();
                   //PrintWriter out = new PrintWriter(outStr);
                   outStr.write(xmlStr.getBytes());
                   outStr.flush();
                   outStr.close();
    InputStream is = connect.getInputStream();
    Any idea, why it is not priting content in servlet
    console??
    SatyaThat would cause your servlet's doPost method to be invoked, not doGet. So what is your doPost doing?

Maybe you are looking for

  • How to read pricing conditions on sales order

    Hi i need to retrive pricing conditions of sales order but before posting sales order any user exit avialable ...? also i hv found one user exit in that there is FM EXIT_SAPMV45A_003 But i am not able to read pricing conditions values also no data is

  • QOS configuration - Is there a way to prevent marking SIP signaling as media

    I have configured QOS for Lync 2013 per all the documenation, blogs, etc. While reviewing network captures to make sure it is working, I noticed something:  normal SIP signaling traffic from the Lync servers to port 5067 uses random source ports, and

  • Why am I not able to see my iPhone movies in my photo stream?

    I noticed that all of my pics are being uploaded to my computer via icloud, but none of my movies are. What should I be doing differently?

  • Converting MS word & excel to Appleworks?

    I have just purchased Appleworks 6.2.9 in hope of being able to leave MS Office for Mac:2004 behind. To my dismay Appleworks does not convert MS Office 2004 documents. Is there a solution for this? Will purchasing MacLinkPlus do the trick? It looks l

  • Role and synonym issue

    Hi friends i create one role CREATE ROLE UPDATE_ROLE; we have three schema(a,b,c) three schema depend to all three schema but unique objects . i create public synonym CREATE OR REPLACE PUBLIC SYNONYM CTL_RC_PROCESS FOR a.CTL_RC_PROCESS; CREATE OR REP