Stuck with problem using waitFor()

Hi,
I wrote a program which will run in a loop like this
for(int i=0;i<theme_caseidVec.size();i++)
String proj_theme="",proj_case_id="",repository_name ="";
String[] Details=new String[2];
Details=(String[])theme_caseidVec.get(i);
proj_theme = Details[0];
proj_case_id = Details[1];
repository_name = (String)CVSRepoHash.get(proj_theme);
path = properties.getProperty(proj_case_id);
if(proj_theme!= null && proj_case_id!= null && repository_name!= null && !repository_name.equals("0") && path!= null)
System.out.println("repository_name: "+repository_name+"proj_theme: "+proj_theme+"proj_case_id :"+proj_case_id);
res = checkoutByProj(repository_name,proj_theme,path);
and i will be invoking the following method each time for more than 200 times.
public synchronized int checkoutByProj(String repository_name,String proj_theme,String proj_path)
String cmd = "";
int i=0;
cmd = "bash /home/abc/cvsCheckoutProj.sh ";
cmd = cmd.concat(repository_name.trim());
cmd = cmd.concat(" ");
cmd = cmd.concat(proj_theme.trim());
cmd = cmd.concat(" ");
cmd = cmd.concat(proj_path.trim());
File workDir = new File("/home/abc");
try
System.out.println("Command:" + cmd);
Process p = Runtime.getRuntime().exec(cmd, null, workDir);
i = p.waitFor();
catch(Exception e)
System.out.println(e);
cmd = "";
return i;
But i am not able to fully execute this code till the end.
Its geting hanged and nothing is displayed in the console.
Can any one suggest me the solution for this problem.

String[] cmd = {"bash", "-c", "/home/abc/cvsCheckoutProj.sh", repository_name.trim()), proj_theme.trim(), proj_path.trim()};
File workDir = new File("/home/abc");
Process p = Runtime.getRuntime().exec(cmd, null, workDir);Make sure you handle the Process stdout and stderr as recommended in http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html .

Similar Messages

  • Stuck with problems and no help

    hi,
    We are stuck with the following set of problems. Repeated entries to this forum have not fetced any response. If anybody can help us on any of these issues, please reply -
    1. We are not able to define any custom validator. We made our own validator that extends CompareValidor, but when we try to apply this rule to an attribute in the validation tab, we get the error - "no properties defined". Do i need to do something else besides creating a new class that extends CompareValidator and then writing my own code in the vlaidate method.
    2. While deploying our jspApplication on java web server, we are getting the message "error - null". The details are as mentioned in the Topic 'can anyone help!!!' that has been posted by Prabhdeep ().
    3. I have two tables, Customer and address. There is no FK between them (there cannot be because address is shared between many entities). In the address, i have 2 fields, BpType and BpId. BpType will contain 'C' to identity that this address is for a customer and id will have the customer id. In jdev 3.1, i have created entity and view objects for the 2 tables. also, i have made a view link. i need to put the condition Address.bpid = customer.customeid and address.bptype = 'c'. but it is not letting me put the second part of the condition. the chk on id works fine. as soon as i add a chk on type and test the application module, then while insertion of address i get the following error - "set method for BpType cannot be resolved".
    4. I have made a jsp appl based on bc4j. now, i need to put a check on any entity in such a manner that if the check fails, my jsp should ask the user that an exception is occuring and does he want to save even with the exceptional data. if he says yes, i want that the same entity should now save the data without giving an exception. How do i achieve this interaction between my entity and my jsp.
    Thanks a lot for any help,
    Aparna.

    I will answer Question #3:
    I'm not sure if I understand exactly what is
    happening. At first I thought you meant that you couldn't even add the second part of the association clause. But, later it sounds like you were able to add the second part of the clause (namely "address.bptype =
    'c'") and that you are experiencing some runtime error.
    Assuming the latter (that it is a RT problem), I take it this
    "...cannot be resolved" error is the error with code 27020.
    Under normal error conditions, you shouldn't get this error. Something "unusual" (or unforeseen by us) is happening if you are getting this error. Anyway, if you wrote your own client code, you should wrap a try/catch block around it, pick out the detail exception, and see what's going
    on. See the example code below:
    try
    ... make call that causes the exception ...
    catch(oracle.jbo.AttrSetValException ex)
    // Print stack trace for the outer ex
    ex.printStackTrace();
    // Get the inner exception
    Object[] details = ex.getDetails();
    if (details.length > 0)
    Exception innerEx = (Exception) details[0];
    // Now, print the inner exception's
    // stack.
    innerEx.printStackTrace();
    This will help shed some light on the exception and the cause of it.
    John - JDeveloper Team

  • Need help with problem using sound and vibration examples. question repost

    I am generating a wav file using the sound and vibration example vi "SVXMPL_Wav Recorder(DAQmx)" using a ni 7422 board.  Then, using the example vi SVXMPL_Getting started with SVT(Simulated)" attempting to play back that file.  the wav file will load and play back on the graphs fine but when I click the "Play Wav File" which sends the audio to the computers speaker,  I get the error "Cannot recognise sound Format".  It plays the shipped example files fine.  I can also play the wav files I generate on a Windows audio player.  Don't know a lot about the sound and vibration toolkit or wav file formats but need to get these two to work together.  Using LV 8.5 and sound and vibration toolkit 4.0.  This is a bit of a repost of the same question ask last week but not answered.  Thanks

    Did you see Coq Rouge's reply in your original thread? Which thread are you going to continue?

  • I am really stuck with JCheckBox using it as a JTable cell editor...

    i need to focus next table cell, when user press a key on JcheckBox used in JTable as a cell editor.
    Especially i need to bind "ENTER" key with this action. I tried to addKeyListener do checkbox, tried to add action into input maps of jatble, and also to input map of checkbox. But really nothing works. Please help....
    Mathew, HSIGP

    and yes your code works well with any key, but when i want to assign something to "ENTER", it doesnt work. F.ex. if i assign something to "A" key
    like>
    InputMap m=table.getInputMap(WHEN_ANCETSTOR...);
    m.put(KeyStroke.get("A"),m.get(KeyStroke.get("TAB"));
    it works fine, and when i press "a" key it work as a "tab" key in table.
    But when i am doing same with "enter" instead of "a" it doesnt work.
    btw. there is action "actionselectNextCollumn..." assigned by default to enter
    why??

  • History links no longer auto-open when selected. Running 33.0 (beta channel); is there a known fix, or am I stuck with troubleshoot using safe mode? :\ Tnx!

    Additional: I've searched about:config but can't find a setting that would appear to apply. Am I missing something?

    Extensions:
    * LastPass Plugin
    * Shockwave Flash 15.0 r0
    * Adobe PDF Plug-In For Firefox and Netscape 11.0.9
    * Google Update
    * iTunes Detector Plug-in
    * Next Generation Java Plug-in 10.55.2 for Mozilla browsers
    * NPRuntime Script Plug-in Library for Java(TM) Deploy
    * The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    * 5.1.30214.0
    * Garmin Communicator Plug-In 4.1.0.0
    * Citrix Online App Detector Plugin
    * Adobe Shockwave for Director Netscape plug-in, version 12.0.4.144
    * ActiveTouch General Plugin Container Version 105
    * Amazon MP3 Downloader Plugin 1.0.17
    * NPWLPG
    * The plug-in allows you to open and edit files using Microsoft Office applications
    * Office Authorization plug-in for NPAPI browsers

  • I need to switch a 12V relay using USB6211.i am stuck with programming

    i need to switch a 12V relay using USB6211.i am stuck with programming  using daq assistant. i am doing hardware implementation also..can anyone give some help...

    You can create tasks with individual lines and ports and then have multiple tasks all running for the same device.  I would highly recommend the DAQmx VI API.  It gives a little better control and is easier to see exactly what is happening.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • TS3694 hi i recently updated into ios 7.0.4 now i want to fully restore my ipad to resell but when i restore it it got stuck with apple logo and progress bar with 45% completed as firware file is downloaded using ipad 4 wifi itunes 11.3.8

    hi i rescently updated my ipad 4 in ios 7.0.4 and for resell purpose i want to restore my ipad via itunes but it got stuck at apple logo and progress bar of 45% completed i tried it 50 times but it stuck on that exact point for hours i cant able to restore it and had no errors it just like freezes at one point i also uses dfu mode but got stuck at same problem using windows 7 32 bits itunes 11.3.8 ipad 4 wifi please help

    My iPhone 5 wouldn't start after I turned it off a few minutes after writing this. It went into recovery mode and I had no choice but to connect to iTunes on PC and restore.
    I restored to factory setting first, just to validate my phone was okay. For a second consecutive iOS update, the  iPhone 5 did not update smoothly while connected to PC and iTunes - I had to retry two times before the progress bar for the update showed. (The exact same problem with the restart occured when I updated to 7.0.4.)
    The good news is that I was ultimately able to restore the iPhone 5 to factory settings while running iOS 7.0.6. I did have a backup from about a month ago lying around and was able to successfully restore with that as well, so the damage done is almost negligible since I had my contacts, notes, mail, etc. backed up to iCloud.
    Once I completed both restores, the sync with iTunes worked fine.

  • Still stuck with the same old producer consumer weight problem need help

    Hello All,
    This is the problem I am stuck with right now.
    I have two array lists one producer array list and one consumer array list denoted by a and b
    P1 P2 P3 P4 P5
    5 6 7 8 9
    C1 C2 C3 C4 C5
    2 3 4 5 6
    Now we find all those producer consumer pairs which satisfy the criteria Pi>=Ci
    We have the following sets
    (5,2)(6,2)(7,2),(8,2),(9,2)
    (5,3)(6,3)(7,3),(8,3),(9,3)
    (5,4)(6,4)(7,4),(8,4),(9,4)
    (5,5)(6,5)(7,5),(8,5),(9,5)
    (6,6)(7,6)(8,6),(9,6)
    Let us done each of them with Si
    so we have S1,S2,S3,S4,S5
    we assign a third parameter called weight to each element in Si which has satisfied the condition Pi>=Ci;
    so we we will have
    (5,2,ai),(6,2,bi),(7,2,ci)....etc for S1
    similarly for S2 and so on.
    We need to find in each set Si the the pair which has the smallest weight.
    if we have (5,2,3) and (6,2,4) then 5,2,3 should be chosen.We should make sure that there is only one pair in every set which is finally chosen on the basis of weight.
    Suppose we get a pair (5,2,3) in S1 and (5,2,3) in S2 we should see that (5,2,3) is not used to compare to compare with any other elements in the same set S2,
    Finally we should arrive at the best element pair in each set.They should be non repeating in other sets.
    Given a problem
    P0 P1 P2 P3 P4
    9 5 2 2 8
    6 5 4 5 3
    C0 C1 C2 C3 C4
    we have So as (P0,C0) and (P4,C0)
    assuming that the one with the smaller index has lesser weight PO is selected.In the program I have used random weights.from set S1 we select the pair PO,CO
    S1 =(P0,C1),(P1,C1) and (P4,C1)
    since P0 and P4 are already used in previous set we dont use them for checking in S1 so we have (P1,C1) as best.
    S2=(P0,C2),(P1,C2) and (P4,C2) so we dont use P0,C2 and P1 and C2 because PO and P1 are already used in S1.
    So we choose P4,C2
    in S3 and S4 ae have (P0,C3),(P1,C3),(P4,C3) so we dont choose anything
    and same in S4 also.
    So answer is
    (P0,C0),(P1,C1) and (P4,C2).
    My program is trying to assign weights and I am trying to print the weights along with the sets.It doesnt work fine.I need help to write this program to do this.
    Thanks.
    Regards.
    NP
    What I have tried till now.
    I have one more question could you help me with this.
    I have an array list of this form.
    package mypackage1;
    import java.util.*;
    public class DD
    private  int P;
    private  int C;
    private int weight;
    public void set_p(int P1)
    P=P1;
    public void set_c(int C1)
    C=C1;
    public void set_weight(int W1)
    weight=W1;
    public int get_p()
    return P;
    public int get_c()
    return C;
    public int get_x()
    return weight;
    public static void main(String args[])
    ArrayList a=new ArrayList();
    ArrayList min_weights_int=new ArrayList();
    ArrayList rows=new ArrayList();
    ArrayList temp=new ArrayList();
    Hashtable h=new Hashtable();
    String v;
    int o=0;
    DD[] d=new DD[5];
    for(int i=0;i<4;i++)
    d=new DD();
    for(int i=0;i<4;i++)
    d[i].set_p(((int)(StrictMath.random()*10 + 1)));
    d[i].set_c((int)(StrictMath.random()*10 + 1));
    d[i].set_weight(0);
    System.out.println("Producers");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_p());
    System.out.println("Consumers");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_c());
    System.out.println("Weights");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_x());
    for(int i=0;i<4;i++ )
    int bi =d[i].get_c();
    ArrayList row=new ArrayList();
    for(int j=0;j<4;j++)
    if( d[j].get_p() >=bi)
    d[j].set_weight((int)(StrictMath.random()*10 + 1));
    row.add("(" + bi + "," + d[j].get_p() + "," +d[j].get_x() + ")");
    else
    d[j].set_weight(0);
    row.add("null");
    rows.add(row);
    System.out.println(rows);
    int f=0;
    for(Iterator p=rows.iterator();p.hasNext();)
    temp=(ArrayList)p.next();
    String S="S" +f;
    h.put(S,temp);
    String tt=new String();
    for(int j=0;j<4;j++)
    if(temp.get(j).toString() !="null")
    // System.out.println("In if loop");
    //System.out.println(temp.get(j).toString());
    String l=temp.get(j).toString();
    System.out.println(l);
    //System.out.println("Comma matches" + l.lastIndexOf(","));
    //System.out.println(min_weights);
    f++;
    for(Enumeration e=h.keys();e.hasMoreElements();)
    //System.out.println("I am here");
    int ii=0;
    int smallest=0;
    String key=(String)e.nextElement();
    System.out.println("key=" + key);
    temp=(ArrayList)h.get(key);
    System.out.println("Array List" + temp);
    for( int j=0;j<4;j++)
    String l=(temp.get(j).toString());
    if(l!="null")
    System.out.println("l=" +l);
    [\code]

    In your example you selected the pair with the greatest
    distance from the first set, and the pair with the least
    distance from the second. I don't see how the distance
    function was used.
    Also it's not clear to me that there is always a solution,
    and, if there is, whether consistently choosing the
    furthest or the closest pairs will always work.
    The most obvious approach is to systematically try
    all possibilities until the answer is reached, or there
    are no possibilities left. This means backtracking whenever
    a point is reached where you cannot continue. In this case
    backtrack one step and try another possibility at this
    step. After all possible choices of the previous step,
    backtrack one more step and so on.
    This seems rather involved, and it probably is.
    Interestingly, if you know Prolog, it is ridiculously
    easy because Prolog does all the backtracking for you.
    In Java, you can implement the algorithm in much the same
    way as Prolog implementations do it--keep a list of all the
    choice points and work through them until success or there
    are none left.
    If you do know Prolog, you could generate lots of random
    problems and see if there is always a solution.

  • I erased my windows partition using disk utility then realized I should have used boot camp, because now I can't resize the original partition and seem to be stuck with a ghost unusable space. Boot Camp now doesn't give me the option to install or re

    I erased my windows partition using disk utility then realized I should have used boot camp, because now I can't resize the original partition and seem to be stuck with a ghost unusable space. Boot Camp now doesn't give me the option to install or remove windows partition.

    Hi, Ralph,
    The problem is that I did erase the partition, using disk utility, but I can't go back to my original disk size pre-partition, as disk utility won't let me do it and gives the message "Couldn’t modify partition map because file system verification failed." When I try to use Boot Camp Assistant it won't let me select the third option to remove windows.

  • HT1933 Tried iTunes Store directive for reporting a problem. Got an ERROR message every time. Stuck with a NY Times app that won't recognize my subscription.

    Tried iTunes Store directive for reporting a problem. Got an ERROR message every time. Stuck with a NY Times app that won't recognize my subscription.called Apple and was told by an automated message to...use the ITunes Store directive.
    Can someone point me in the right direction.

    Hello atransient,
    Thanks for the question, that definitely sounds frustrating to encounter errors at the most important times.
    Let's see if the online Report a Problem works any better for you:
    http://reportaproblem.apple.com
    Thanks,
    Matt M.

  • Problem in creating client side PDF with image using flex and AlivePD

    I need a favor I am creating client side PDF with image using flex and AlivePDF for a web based application. Images have been generated on that pdf but it is creating problem for large size images as half of the image disappeared from that pdf.I am taking the image inside a canvas . How do i control my images so that they come fit on that pdf file for any image size that i take.
    Thanks in advance
    Atishay

    I am having a similar and more serious problem. It takes a
    long time to execute, but even attaching a small image balloons the
    pdf to 6MB plus. After a few images it gets up to 20MB. These are
    100k jpeg files being attached. The resulting PDF is too large to
    email or process effectively. Does anyone know how to reduce
    size/processing?

  • ICloud backup is unable to access the account, because email I used for iCloud account is been deleted. And my iPad is stuck with this note on a screen, can't go Settings. How do I delete my account?

    iCloud backup is unable to access my account, because email I used for iCloud account is been deleted. And my iPad is stuck with this note on a screen, can't go Settings. How do I delete or edit my iCloud account?

    You can eirther I think go on ITunes or if you can get to settings you would just go to iCloud.

  • Calendar Server 3.5: Problem using user's ID with uniuser -mod command

    When there are two users who have the same Common Name (CN) in LDAP but
    different User ID's (uid
    field), I have a problem using the uid
    field as an argument to
    uniuser -mod in Netscape Calendar
    Server (NCS) 3.5. For example, there may be two users, User1 and User2, who
    both have the CN "John Smith."<BR>
    <P>
    <B>User1</B>
    uid: jsmith2
    sn: Smith
    givenname: John
    nscalxitemid: 10001:00314
    <B>User2</B>
    uid: jsmith
    sn: Smith
    givenname: John
    nscalxitemid: 10001:00213
    <P>
    Let's say I want to change the value for nsCalOrgUnit2
    for User1 to "jsmith." In NCS 4.0,
    I can specify the uid as
    an argument to uniuser -mod
    . However, in NCS 3.5, if I specify the
    uid as an argument to
    uniuser -mod, the entry
    for the user does not get changed.<BR>
    <P>
    <B>Calendar Server 4.0</B><BR>
    <P>
    %uniuser -mod "ID=00314" -m "OU2=jsmith/OU3=People" -n 10001
    <BR>
    uniuser: modified "Smith, John"<BR>
    <P>
    (The LDAP entry for User1 also reflects this change.)
    <P>
    <B>Calendar Server 3.5</B><BR>
    <P>
    %uniuser -mod "ID=00314" "OU2=jsmith/OU3=People" 10001
    <BR>
    uniuser: no need to modify "Smith,John"<BR>
    <P>
    (The LDAP entry for User1 does not reflect the change.)<BR>
    <P>
    %uniuser -mod "S=Smith/G=John/ID=00314" "OU2=jsmith/OU3=People"
    10001<BR>
    uniuser: no need to modify "Smith,John"<BR>
    <P>
    (The LDAP entry for User1 does not reflect the change.)<BR>
    <P>
    If I use the command uniuser -mod "S=Smith/G=John"
    "OU2=jsmith/OU3=People" 10001
    in NCS 3.5, the script will change the entry of the first "John Smith" in the
    database and will cause the LDAP entry for this user to be updated as well.
    However, the entry modified may or may not be the correct one. So, in
    NCS 3.5, is there a way to specify a particular uid
    to ensure that the correct LDAP entry
    is modified?
    <P>
    To modify a user's information using the uid
    field in Calendar Server 3.5, change
    the user.ini file. The
    following steps show how to change a user's information by modifying the
    .ini file:<BR>
    <P>
    <OL>
    <LI>Open the user.ini
    file, which is in the path /users/unison/misc/user.ini
    <P>
    <LI>Add a section containing the desired changes. For example,<BR>
    <P>
    [Test]<BR>
    OU2 = jsmith<BR>
    OU3 = People<BR>
    <P>
    <LI>Run uniuser with
    the following options:<BR>
    <P>
    % uniuser -mod "ID=00314" -s Test 10001
    </OL>

    It turns out to be a problem with the user Keychain. It has some weird entry that was sending the wrong password. I delete all entries to the server and that corrected the problem

  • HT1335 My ipod classic have no software and I am stuck with it. It was formatted for apple but I use windows 8.  Please help. Thanks in advance.

    My ipod classic have no software and I am stuck with it. It was formatted for apple but I use windows 8.  Please help. Thanks in advance.

    Hello there, DrDhillon.
    The following Knowledge Base article goes over the steps that will help you resolve your issue:
    Restoring iPod to factory settings
    http://support.apple.com/kb/HT1339
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Can somebody help me install IOS 6.1.3 back to my iPhone 4. IOS 7 is not smooth enough as perfect as IOS 6.1.3. I am stuck with this OS, every app gives a break for 4-5 seconds to open up. And playing games in this OS using iPhone 4 is really crazy

    Can somebody help me install IOS 6.1.3 back to my iPhone 4. IOS 7 or 7.0.4 is not smooth enough as perfect as IOS 6.1.3. I am stuck with this OS, every app gives a break for 4-5 seconds to open up. And playing games in this OS using iPhone 4 is really crazy. Very much disappointed that I am not able to use IOS 7 and cant go back to what I need.

    Mani Dinesh wrote:
    Can somebody help me install IOS 6.1.3 back to my iPhone 4.
    Downgrading is not supported by Apple.
    Mani Dinesh wrote:
    ...every app gives a break for 4-5 seconds to open up. ...
    See this discussion...
    https://discussions.apple.com/message/23731048#23731048

Maybe you are looking for

  • Import file question

    Can you import a .wmv file into FCP5 or iDVDhd? Any suggestions! I haven’t had any luck but I’m a beginner. Thanks for yall’s help!

  • Play Button Broken... songs wont play??!!!

    My itunes usually works fine.. but now when i go to hit the play button, nothing plays. Not my own music or bought offline music. And no the volume isnt turned off, the wierd thing is that the videos ive purchased play fine. But when i hit a song and

  • Get a French online number from an Italian Skype M...

    Hi, in order to get a French online number is a proof of residence required in any case (individual vs Skype manager)? I have an Italian Skype Manager and would like to set up a French online number. Do I need a proof of Residence in France? If yes,

  • Passing table back to FM

    Hi I am writing a RFC FM. I am passing order no to the subroutine and I  need to get back all the components for that Production order from RESB table. Perform get_next_component_list using l_aufnr based on the AUFNR passed to subroutine I have to ge

  • PPCC 2014 is not showing up for download

    in fact, a LOT is not showing up at the cloud menu for download, nor is it listing my currently downloaded products. what's up?