Runtim exec() method not working.....giving Exception

whts the code to use exec() method. i m using it as follows and also catching exception.
Runtime r=Runtime.getRuntime();
Process p=r.exec("java A");
code is giving IOException at runtime with error=2.

Here is an example I used when I first needed to test the runtime.exec
import java.util.*;
import java.lang.*;
import java.io.*;
public class TestRuntime {
    public static void main(String args[])
        try
            Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec("java A");
            InputStream stderr = proc.getErrorStream();
            InputStreamReader isr = new InputStreamReader(stderr);
            BufferedReader br = new BufferedReader(isr);
            String line = null;
            System.out.println("<ERROR>");
            while ( (line = br.readLine()) != null)
                System.out.println(line);
            System.out.println("</ERROR>");
            int exitVal = proc.waitFor();
            System.out.println("Process exitValue: " + exitVal);
        } catch (Throwable t)
            t.printStackTrace();
}Are you waiting for the process to end before exiting your program?

Similar Messages

  • Runtime.exec does not work for commands with lengthy outputs

    I need to use Runtime.exec to run some custom commands on a Unix box. I have been doing this for quite some time now and had begun to feel comfortable when recently I started facing a problem. The thing is, whenever there is a command which prints a lot of data on to the console, the program is not able to exit from the waitFor method. Is there some thing that can be done about this?
    Following is a part of the code I use:
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec (command);
    System.out.println ("Got the process");
    int exitValue = p.waitFor();
    System.out.println ("Exit value: " + exitValue);When the output of the "command" is lengthy, it hangs after printing "Got the process".
    PS: By lengthy output, I mean that the command results in printing lines to the console which might be more than 100 in number. Say, something like what "ls -R /" would do in Unix / Linux.

    From java.lang.Process API doc:
    The Runtime.exec methods may not work well for special processes on certain native platforms, such as native windowing processes, daemon processes, Win16/DOS processes on Microsoft Windows, or shell scripts. The created subprocess does not have its own terminal or console. All its standard io (i.e. stdin, stdout, stderr) operations will be redirected to the parent process through three streams (Process.getOutputStream(), Process.getInputStream(), Process.getErrorStream()). The parent process uses these streams to feed input to and get output from the subprocess. Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.
    So you need to consume the process' output. Check the StreamGobbler example from this article.
    Hope it helps.

  • Runtime.exec() does not work?

    I'm trying to invoke a C++ executable from java using the Runtime.exec() method. The C++ application accepts a filename as a command line argument & opens the file. This C++ app is unicode enabled i.e. it can accept UTF-16 (wide char) parameters. Howevere, when i invoke this application using Java's Runtime.exec() and specify a japanese file name as an argument, the japanese characters get converted to '?' characters by the time they are received in the C++ application. I'm running this application on Windows 2K, default i.e. English version.
    Looking at the source code of Runtime class, it seems that the exec()
    function makes use of a native helper function - execInternal(). Does
    this function support the entire unicode range?
    Is there any way we can avoid the conversion of japanese characters to '?' characters? Also, is there any other alternative for invoking an external application with Unicode (Say, japanese) arguments?
    Please reply ASAP.
    Thanks!

    >
    I'm trying to invoke a C++ executable from java using
    the Runtime.exec() method. The C++ application accepts
    a filename as a command line argument & opens the
    file. This C++ app is unicode enabled i.e. it can
    accept UTF-16 (wide char) parameters. Howevere, when i
    invoke this application using Java's Runtime.exec()
    and specify a japanese file name as an argument, the
    japanese characters get converted to '?' characters by
    the time they are received in the C++ application. I'm
    running this application on Windows 2K, default i.e.
    English version.
    Looking at the source code of Runtime class, it seems
    that the exec()
    function makes use of a native helper function -
    execInternal(). Does
    this function support the entire unicode range?I don't know because I've never tested this case specifically.
    You didn't show your code though. How are you reading in the String? You mentioned that you passed a Japanese character String as a filename argument. I also read that you are running on an English Win2K platform. How did you read that argument in? It may just be that you read the argument in your default encoding(English) and you needed to specify an alternate one.

  • Runtime.exec() does not work under Linux

    Hi,
    I have a generic application runner class that runs an external
    program and redirects stdout/stderr to a buffer/file.
    While everythings works just fine under Windows, I get the
    following exception under Linux trying to run the Java interpreter
    'java':
    java.io.IOException: "/usr/lib/SunJava2-1.3.1/jre/bin/java": not found
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:139)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:546)
    at java.lang.Runtime.exec(Runtime.java:413)
    I have checked that the file /usr/lib/SunJava2-1.3.1/jre/bin/java
    exists.
    Any help appreciated!
    Marc

    can I ask how you solved it? I am having a problem
    with quotes just now to and it might help me!I simply tested what the current platform is and
    only used quotes under Windows.
    Marc

  • Runtime.exec() does not work normally

    I try to wrapper the oracle connect command on unix using this function:
    runtime.exec("sqlplus username/password@dbinstance")
    it is ok on windows, but on unix, after runing the class, I get nothing. what is the problem?
    Please help me. thanks

    There are several traps with runtime.exec(). The most important one is that you should read
    the output stream of the launched program. Otherwise it will stop running when the console buffer overflows. The size of the buffer differs for various OSes.
    Look at this article:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    It it does not answer your problem, try to search the forums:
    http://search.java.sun.com/Search/java?qt=%2B%22exec%22+-%22Replies%3A+0%22&col=javafrm&rf=0&qp=%2Bforum%3A31
    This problem has been asked hundreds of times.
    Hope, this helps.

  • The Runtime.exec methods doesn't work well on Solaris ???

    I have two threads and I set the different running time.
    I use Runtime.exec to a run the command and use Process to get the process.
    It works properly in the windows2000 platform.
    However, when I transfer the platform to Solaris...and run the program...
    Two threads always at the same time....It is very wired....I always debug
    for 2 days....
    (at first I run "vmstat 1 2" command, later I change to "ls","rmdir"....etc,
    all of them don't work.....
    If I close the Runtime.exec..........Everything works well......)
    And I study the API. I found this message...
    The Runtime.exec methods may not work well for special processes on certain
    native platforms, such as native windowing processes, daemon processes,
    Win16/DOS processes on Win32, or shell scripts. The created subprocess does
    not have its own terminal or console.
    Could someone share her/his experience.....:(
    And if any other way I can run command inside java code instead of
    Runtime.exec.....???
    Please reply my mail to [email protected] I do appreciate your kindly &
    great help!!!!!!!!
    This is my code.......
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    * <p>ServerThread1</p>
    * <p>??�X???��?�D???�X???, "Vmstat 1 2".</p>
    class ServerThread1 extends Thread{
    private ServerAgent Sa;
    public ServerThread1 (String Name, ServerAgent Sa){
    super(Name);
    this.Sa = Sa; file://Assign ServerAgent reference Sa
    public void run(){
    while(true){
    try{
    Thread.sleep(5000);
    catch (Exception e){
    System.out.println("ServerThread1 fails");
    System.out.println("Thread1 is running.");
    try {
    Runtime rt1 = Runtime.getRuntime();
    Process proc1 = rt1.exec("mkdir"); ------>If I close
    rt1.exec , two threads works seperately...........:(
    catch (Exception e) {
    System.out.println("Thread1 Error");
    class ServerThread2 extends Thread{
    private ServerAgent Sa;
    public ServerThread2 (String Name, ServerAgent Sa){
    super(Name);
    this.Sa = Sa;
    public void run(){
    while(true){
    try{
    Thread.sleep(15000);
    catch (Exception e){
    System.out.println("ServerThread2 fails");
    System.out.println("Thread2 is running.");
    try {
    Runtime rt2 = Runtime.getRuntime();
    Process proc2 = rt2.exec("vmstat 1 2"); ----->If I don't run
    the rt2.exe, two threads work seperately....
    catch (Exception e) {
    System.out.println("Thread2 Error");
    public class ServerAgent{
    private Vector v1 = new Vector();
    private Vector v2 = new Vector();
    private Hashtable currentData = new Hashtable();
    private static String startUpSwap = null;
    private static String startUpMem = null;
    public static void main(String[] arg) {
    ServerAgent s = new ServerAgent();
    ServerThread1 st1 = new ServerThread1("Thread1",s);
    ServerThread2 st2 = new ServerThread2("Thread2",s);
    st1.start();
    st2.start();

    If I close the Runtime.exec..........Everything works
    well......)You don't empty the output of the command, that blocks the process.
    A citation from
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Why Runtime.exec() hangs
    The JDK's Javadoc documentation provides the answer to this question:
    Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.
    Try out something like this:
    String s;
    try {
       Process myProcess =
       Runtime.getRuntime().exec("ls -l"));
       DataInputStream in = new DataInputStream(
              new BufferedInputStream(myProcess.getInputStream()));
        while ((s = in.readLine()) != null) {
            out.println(s);
    catch (IOException e) {
        out.println("Error: " + e);
    }Another source of trouble under Unix is not having the correct permission for that user that executes the Java VM, which will be the permissions for the spawned subprocess. But this probably not the case, as you see something after exit.
    Regards,
    Marc

  • Runtime.exe() is not working from within a jar file.

    Hi All,
    I have a jar file which have classes and a package in it.
    One of these classes is calling another class which is present in the package.
    The code i am using it is as follows:
    Runtime r=Runtime.getRuntime();
    Process p=null;
    p=r.exec("java deep.slideshow.PlayShow");It is working fine when i am executing it without making jar file.
    But when i make a jar file of all these things , this exec() is not working.
    I have tried a lot.
    If any body has any idea suggest me.
    Thanks

    thanks a lot for your reply friend.
    I tried the same you tell me to do by using the cmd;
    java -cp my.jar package.class  And then tried to make the jar file with the help of eclipse,
    after adding my jar file into classpath of my project in eclipse.
    Its working fine on my local system.
    But when i put this jar file on some other system it does not call my jar file(obviously bcz it will not the find the jar file according to the classpath set on my local system. )
    Is there any way that i can keep this jar into my project and then can give the classpath dynamically
    so that it can pick the file from my project automatically.?
    Later on i will pack this whole thing into a full jar file and it will work on a single click.
    Is it possible or not ?
    Please suggest me.
    Thanks

  • EXEC SP_EXECUTESQL not working in sql server 2014

    EXEC SP_EXECUTESQL not working in sql server 2014

    EXEC SP_EXECUTESQL not working in sql server 2014
    Hi Amar,
    What's the error when executing this stored procedure?
    I have tested it on my local environment, we can run this SP without any problems.
    Please provide us more information, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Java's Runtime.exec() method

    When you shell out to java's Runtime.exec() method, are the process name and arguments the same for the child process that is spawned.
    We see duplicated processes about the time when our logs tell us this command was run. However, we cannot seem to reproduce this. Has anyone else seen anyone this before?

    That's what I though too. But check this out . . .
    Our code looks as follows:
    private Runtime rt;
    private Process p;
    rt = Rutime.getRuntime();
    p = rt.exec(command);
    This exec() call creates a new process, which is a child of the java process that runs this command. The final process looks like the "command" string that is passed to the exec() method call. In our case, the command is a call to the /usr/bin/mail utility to send out faxes and emails.
    We ran a very tight loop executing the rt.exec() call over and over. What we found was that for a minor fraction of a second, the newly created process looks just like the original process including the same arguments. However, the PID's indicated that one process was the child of the other. This is why it looked like we had 2 of the same processes. WILD!
    Thanks guys!

  • After Method not work

    Hello guys,
    I need your help.
    In activity step I added one method in "Methods AFTER Work Item Execution (Modal Call)", but this method not work after complete the workitem.
    This method run in background, and insert data in one table.
    My workflow use BUS1001006 object type, and this method too.
    Any idea?
    Thanks!!!
    Kleber

    Hi Arghadip!!!
    Now it's work fine!!! Thanks!!!
    Please... more one question...
    In my method, I need the value of the element <b>_Workitem.WorkitemStatus</b>.
    It's possible:
    ===========================================================
    swc_get_element container '<b>_Workitem.WorkitemStatus</b>' vl_status.
    ===========================================================
    or
    ===========================================================
    swc_get_element container '<b>_Workitem-WorkitemStatus</b>' vl_status.
    ===========================================================
    How I do this?
    Thank a lot!!!
    Kleber

  • Runtime.exec ignores the working directory argument

    Hi Folks,
    I need to run a batch file in a particular directory, from a Java program.
    Here, I want to run "startMySQL.bat" from the ./bin directory.
    I used the following code to do so.
         String commandToExecute = "startMySQL.bat";
         File file = new File("bin");
    Process sqlPrcs = Runtime.getRuntime().exec(commandToExecute, null, file);     
    When I run these lines in a program, I get the following exception:
    java.io.IOException: CreateProcess: startMySQL.bat error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Unknown Source)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at com.aperto.ems.packetmax.AuthenticationScreen.startDB(AuthenticationScreen.java:603)
    at com.aperto.ems.packetmax.AuthenticationScreen.validateUserAndReinitialize(AuthenticationScreen.java:479)
    at com.aperto.ems.packetmax.AuthenticationScreen.access$0(AuthenticationScreen.java:468)
    at com.aperto.ems.packetmax.AuthenticationScreen$OnOKButtonPress.actionPerformed(AuthenticationScreen.java:628)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener$ReleasedAction.actionPerformed(Unknown Source)
    at javax.swing.SwingUtilities.notifyAction(Unknown Source)
    at javax.swing.JComponent.processKeyBinding(Unknown Source)
    at javax.swing.JComponent.processKeyBindings(Unknown Source)
    at javax.swing.JComponent.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    "error=2" in Windows mean "not able to find the file".
    Any clues on how I can run the batch file from a particular working directory?
    Thanks!

    Hi,
    I changed the code to print the user.dir output and the absolute path of the file. It looks like this:
    String commandToExecute = "startMySQL.bat";
    File fl = new File("bin");
    System.out.println(fl.getAbsolutePath());
    System.out.println(System.getProperty("user.dir"));
    Process sqlPrcs = Runtime.getRuntime().exec(commandToExecute, null, fl);
    Below is the output I get:
    C:\Program Files\Aperto\WaveCenter\Back-End_Server_2.0_build8\bin
    C:\Program Files\Aperto\WaveCenter\Back-End_Server_2.0_build8
    java.io.IOException: CreateProcess: startMySQL.bat error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Unknown Source)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at com.aperto.ems.packetmax.AuthenticationScreen.startDB(AuthenticationScreen.java:604)
    at com.aperto.ems.packetmax.AuthenticationScreen.validateUserAndReinitialize(AuthenticationScreen.java:479)
    at com.aperto.ems.packetmax.AuthenticationScreen.access$0(AuthenticationScreen.java:468)
    at com.aperto.ems.packetmax.AuthenticationScreen$OnOKButtonPress.actionPerformed(AuthenticationScreen.java:629)
    I assure you, "startMySQL.bat" is there under "bin"
    Thanks,
    Sandeep

  • Runtime.exec does not execute my program, but executes "ls"

    I am trying to run an exe from a Java program.
    The program that I want to run is an output of a gcc -o ICDDATA ICDdata.c
    Now when I use the Runtime.exec() and execute "ls", "cat" it is working fine without any errors.
    But when i try to give the file(ICDDATA) that was created with the gcc, it generates an error code of "11" or "10" and exits the process.
    Could anyone please let me know the reason why this is happenig and suggest and appropiate solution for this.

    When I give ICDDATA at the prompt, it is executing perfectly fine.
    But only when it is run inside the Java program its giving the error code 10.
    Here is the source code:
    ======================================
    public class InvokeInterface {
         This method takes two parameters and accordingly invokes one of the
         interface (ICD / Value).
         @Input : String, String
         @Return : void
         static void executeInterface(String processName, String debugOption)
         throws java.io.IOException     {
              String commandToExecute=". / ";
                   // The command that has to be passed to the Shell.
              if(processName.equals("ICD"))
                   commandToExecute="ICDDataRefresh";
              if(processName.equals("VALUE"))
                   commandToExecute="ValueDataRefersh";
              commandToExecute += " "+debugOption;
              System.out.println("..."+commandToExecute);
              Runtime runtime = Runtime.getRuntime();
              Process proc = runtime.exec(commandToExecute);
                   try {
                        if (proc.waitFor() != 0) {
                        System.err.println("exit value = " +
                        proc.exitValue());
              catch (InterruptedException e) {
                   System.err.println(e);
    ==========
    Thanks in Advance
    Ram

  • SSRS CatalogItem method not working for deploying a shared data source

    I have been working with the SSRS CreateCatalogItem method to deploy reports to a SSRS 2012 in SharePoint integrated mode with SharePoint Server Enterprise 2013. I am using Powershell. The CreateCatalogItem method works fine when I deploy RDL files,
    but fails when I deploy an RDS. I get an rsInvalidXML1400 error, whatever that is. Here is a cut-down version of my code to establish the bare essentials:
        [String] $reportserver = "server20";
        [String] $url = "http://$($reportserver)/sites/AdventureWorks/_vti_bin/reportserver/reportservice2010.asmx?WSDL";
        [String] $SPFolderPath = "http://server20/sites/AdventureWorks/BICenter/Data%20Connections/";
        [String] $fileFolder = "C:\SiteBackups\BIReports\BIReports\";
        [String] $itemName = "AdventureWorksCube.rds";
        $ssrs = New-WebServiceProxy -uri $url -UseDefaultCredential;       
        $warnings = $null; 
        $itemPath= $($fileFolder + $itemName);
        $definition = get-content $itemPath -encoding byte;      
        try
            $ssrs.CreateCatalogItem("DataSource", $itemName, $SPFolderPath,$False,$definition,$null, [ref] $warnings);
        catch [System.Web.Services.Protocols.SoapException]
            $msg = $_.Exception.Detail.InnerText;
            Write-Error $msg;
    I have a workaround whereby I read the XML of the data source file directly and extract the ConnectString and Extension elements then use the text within them to create the data source using the DataSourceDefinition class. My point is not to get a workaround.
    I want to establish that the CreateCatalogItem method indeed does not work when used with the ItemType "DataSource". In the code above, if I change the itemType i.e. first parameter of CreateCatalogItem to "Report" and change the $itemName
    to the name of an RDL file, it deploys correctly. Has anyone else encountered this behavior or am I doing something wrong here?
    Charles Kangai, MCT
    author of the following Microsoft Business Intelligence courses:
    http://www.learningtree.co.uk/courses/139/sql-server-analysis-services-for-business-intelligence/
    http://www.learningtree.co.uk/courses/134/sql-server-integration-services-for-business-intelligence/
    http://www.learningtree.co.uk/courses/140/sql-server-reporting-services/
    http://www.learningtree.co.uk/courses/146/sharepoint-business-intelligence/
    Charles Kangai, MCT

    Hello,
    We can invoke the SSRS proxy endpoint (ReportService2006.asmx)from PowerShell to publish report definitions (.rdl) and report models (.smdl) to a SharePoint library, but this does not apply to data source (.rds) files.
    In order to deploy .rds to SharePoint library without using SSDT, you should convert the .rds file to its .rsds counterpart which is pretty contains same content but in different schema.
    If you want to fully automate your deployment, you should write your own converter and perform the deployment by utilizing SharePoint feature framework and SSRS proxy endpoint (ReportService2006.asmx).
    Please refer to the following blog about this issue:
    PowerShell:Deploying SSRS Reports in Integrated Mode
    Deploying Reports in Integrated Mode
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click
    here.
    Fanny Liu
    TechNet Community Support

  • Spawn a java process using runtime.exec() method

    Hi,
    This is my first post in this forum. I have a small problem. I am trying to spawn a java process using Runtime.getRuntime().exec() method in Solaris. However, there is no result in this check the follwoing program.
    /* Program Starts here */
    import java.io.*;
    public class Test {
    public static void main(String args[]) {
    String cmd[] = {"java", "-version"};
    Runtime runtime = Runtime.getRuntime();
    try{
    Process proc = runtime.exec(cmd);
    }catch(Exception ioException){
    ioException.printStackTrace();
    /* Program ends here */
    There is neither any exception nor any result.
    The result I am expecting is it should print the following:
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
    Please help me out in this regard
    Thanks in advance
    Chotu.

    Yes your right. It is proc.getInputStream() or proc.getErrorStream(). That is what I get for trying to use my memory instead of looking it up. Though hopefully the OP would have seen the return type of the other methods and figured it out.

  • ADF JS API methods not working for the newly created rows in table

    Hi All,
    We need to make sure the focus goes back to the newly created rows first column's first component.
    Used findComponent and findComponentByAbsoulteId and even hard coded the id, but still the methods are returning null.
    Even tried ADFRichTable.getRowKey(index), by passing index as 0 for the first row, still the method is returning null.
    Tried ADFUITable.findComponent(Object scopedId, Object rowKey), but unable to pass client side rowKey as the above method is returning null.
    All our requirement is to make the focus back to the first row's component when the user clicks on the cancel button instead of save button. Appreciate your help. Thanks.
    P.S.: Rows will be created using CreateInsert method.
    JDEV Version: 11.1.2.0.0 and Table is in a region and we are using UI Shell Tab Template to launch regions.
    Raja.
    Edited by: RajaRamasamy on Feb 10, 2013 4:30 PM
    Edited by: RajaRamasamy on Feb 10, 2013 4:30 PM

    Thanks Frank,
    But some times even we use findComponentByAbsoulteLocator, its not working. So i followed the approach where you will get the rowID like the below and construct the client ID and pushing the JS to client using Service class. And it worked.
    String rowId = table.getClientRowKeyManager().getClientRowKey(facesContext, table, rowKey);
    But i am worried that even though we hard coded the client and executing the js function from the command button by keeping client listener's type as click, the focus is not setting. And i tried giving the id as tableId[rowIndex]:componentId in the findComponentByAbsoulteLocator.
    Can you let me know is there another way to make focus only using JS on click of command button, where the button does not have any action or actionListener.
    Raja.

Maybe you are looking for

  • Hide all tabs in Personal Number Search Help

    Hi Experts, In Assest Master AS01, there is a personal number field. When user click on search icon from this field, system has to show only newly added elementary search help tab and hide all standard elementary search helps tabs tagged to Collectiv

  • How to get tv shows and movies backed up on external sata drive?

    I realised a couple of days ago that several of my movies and tv shows that I purchased are no longer downloaded on my computer but are stored on the cloud. Now how do I get a backup on my drobo external disk? I don't want to fall or be without wifi

  • Purchasing and iphone

    +I've been thinking about getting an iphone, I like the ability to have the internet access when I'm away from home or on vacations. With my work schedule and not always having access to e-mail I thought it would be a good idea. But I'm still of the

  • Internet is working very slow through ISA 2006 Srever

    Hi, We are using isa server 2006 for accessing internet service, but internet is working is very slow. When we ping the public DNC its show the lot of delay time. And in ISA alerts its display the following error messages:- 1."ISA Server is no longer

  • HT4108 Getting sonos wifi speaker to play audible books

    How to do this when the audible books were bought  using the iPad via iTunes.?