Invoking python program from java

I want to execute a parser program(which is in python) that parses log file from java interface.The design of Java user interface has to be such that the log file is obtained from the user into a text field.The file name has to be read from the text field and this has to be taken by the python log parser program.How can this be implemented?

You can invoke an external program using:
Runtime.getRuntime().exec("bla.exe");
See: http://java.sun.com/j2se/1.4.1/docs/api/

Similar Messages

  • Invoke external programs from Java

    I am running a Java program which will be used to invoke other command line programs in Windows.
    However, it seems Java has problem in checking the termination state of command line programs in Windows. In the example below, the pp.waitFor() will keep waiting even if the command completed execution. I try the same code below in Unix and it works without problem. Is there anyone has come across the same problem before ?
    I am using JDK1.4.1.
    try {
    Process pp = null;
    BufferedInputStream bi = null;
    pp=Runtime.getRuntime().exec("dir");
    bi = new BufferedInputStream(pp.getInputStream());
    pp.waitFor();
    int size=bi.available();
    while (size>0) {
    byte[] buf = new byte[size];
    bi.read(buf);
    System.out.println(new String(buf));
    size=bi.available();
    } catch (Exception e) {
    System.out.println("Exceptions !!!");
    System.out.println(e.getMessage());

    I found this article rather helpful:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How to invoke dos shell from java program

    Hi,
    I'm not able to invoke dos shell from java.
    Can any one help me in this issue.
    I'm providing the source code below:
    try{
    Runtime.getRuntime().exec("cmd.exe")
    catch(IOException e) {
    System.out.println(e.getStackTrace());
    Thanks

    Does it throw a different exception?
    Or does it just do nothing at all?
    It does nothing at all[/b
    Is this a standalone Java app?
    Or a Java Applet running via a webbrowser? [b]It's a standalone application

  • Invoking Microsoft Word from Java code

    I want to invoke Microsoft word from Java code. How can i do this plz ............... Help

    do something along these lines.... here is an example with notepad
    create a .bat file with the commmand in to run notepad for example
    notpad c:\test.txtthis command calls notepad and passes it the argument C:\test.txt which is the file and it's location, that I want to open.
    The Java program
    import java.util.*;
    import java.io.*;
    public class Run
    public static void main(String args[])
        try
           //the name of the batch file with your commands in
           String command ="runprog.bat";
           //get the runtime 
           Runtime rt  = Runtime.getRuntime();
           //run the bat file  
           Process proc = rt.exec(command);
          //wait for the program to exit i.e notepad then get the return code
          int exitVal = proc.waitFor();
          //print out the exit value
          System.out.println(2THe Process exit value is: " + exitVal);
      catch(Throwable t)
         t.printStackTrace();
    }have a look at this
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    and this
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html

  • Invoke a CFC from Java

    Can you give me an example of where or why you would invoke a CFC from Java?  I have used CF to call Java and then having Java return "data" back to the CFC but not sure I know why I would want my Java to invoke a CFC.
    Thanks

    Hi,
    how to invoke a exe file from a java program. (
    operating system: windows )
    is it possible ?Yep.
    Navigate yourself around pitfalls related to the Runtime.exec() method

  • Invoking C programs from Weblogic

    OS: Solaris8
    Appserver:weblogic 8.1 sp2
    JRE:JRE1.4.1_05
    Issue: While invoking C executable programs from java The server hangs intermittently in Production. Here are the Thread Dump and Code
    Solution is highly appreciated
    Thread Dump
    ===========
    Full thread dump Java HotSpot(TM) Server VM (1.4.1_05-b01 mixed mode):
    "Thread-22933" daemon prio=5 tid=0xe9b9e8 nid=0x8699 runnable [e6701000..e67019bc]
         at java.io.FileInputStream.readBytes(Native Method)
         at java.io.FileInputStream.read(FileInputStream.java:191)
         at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:219)
         at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)
         at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:448)
         at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
         - locked <f1eef700> (a java.io.InputStreamReader)
         at java.io.InputStreamReader.read(InputStreamReader.java:167)
         at java.io.BufferedReader.fill(BufferedReader.java:136)
         at java.io.BufferedReader.readLine(BufferedReader.java:299)
         - locked <f1eef700> (a java.io.InputStreamReader)
         at java.io.BufferedReader.readLine(BufferedReader.java:362)
         at com.fedex.meteor.util.RunAsync$OutErrReader.run(RunAsync.java:153)
         at java.lang.Thread.run(Thread.java:536)
    "Thread-22934" daemon prio=5 tid=0x1b3b28 nid=0x8698 runnable [e6801000..e68019bc]
         at java.io.FileInputStream.readBytes(Native Method)
         at java.io.FileInputStream.read(FileInputStream.java:191)
         at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:219)
         at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
         - locked <f1ef57f0> (a java.io.BufferedInputStream)
         at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)
         at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:448)
         at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
         - locked <f1ef5868> (a java.io.InputStreamReader)
         at java.io.InputStreamReader.read(InputStreamReader.java:167)
         at java.io.BufferedReader.fill(BufferedReader.java:136)
         at java.io.BufferedReader.readLine(BufferedReader.java:299)
         - locked <f1ef5868> (a java.io.InputStreamReader)
         at java.io.BufferedReader.readLine(BufferedReader.java:362)
         at com.fedex.meteor.util.RunAsync$OutErrReader.run(RunAsync.java:153)
         at java.lang.Thread.run(Thread.java:536)
    "process reaper" daemon prio=5 tid=0xe7e3f8 nid=0x8697 runnable [e6901000..e69019bc]
         at java.lang.UNIXProcess.waitForProcessExit(Native Method)
         at java.lang.UNIXProcess.access$1000(UNIXProcess.java:20)
         at java.lang.UNIXProcess$3.run(UNIXProcess.java:84)
    "ExecuteThread: '5' for queue: 'JMS.TimerClientPool'" daemon prio=5 tid=0xcfb2a8 nid=0x41 in Object.wait() [e6a01000..e6a019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f17bb610> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f17bb610> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '4' for queue: 'JMS.TimerClientPool'" daemon prio=5 tid=0xa0d458 nid=0x40 in Object.wait() [e6b01000..e6b019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f17bb690> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f17bb690> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '3' for queue: 'JMS.TimerClientPool'" daemon prio=5 tid=0xa6e4f0 nid=0x3f in Object.wait() [e6c01000..e6c019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f17bb710> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f17bb710> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '2' for queue: 'JMS.TimerClientPool'" daemon prio=5 tid=0xd412e8 nid=0x3e in Object.wait() [e6d01000..e6d019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f17bb790> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f17bb790> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '1' for queue: 'JMS.TimerClientPool'" daemon prio=5 tid=0xf5e5e8 nid=0x3d in Object.wait() [e6e01000..e6e019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f17bb810> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f17bb810> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '0' for queue: 'JMS.TimerClientPool'" daemon prio=5 tid=0x10f2c58 nid=0x3c in Object.wait() [e6f01000..e6f019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f17bb890> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f17bb890> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '2' for queue: 'weblogic.socket.Muxer'" daemon prio=5 tid=0x2df4c8 nid=0x3b waiting for monitor entry [e7001000..e70019bc]
         at weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:91)
         - waiting to lock <f149b368> (a java.lang.String)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    "ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'" daemon prio=5 tid=0xa0ca98 nid=0x3a in Object.wait() [e7101000..e71019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f1499358> (a [Lweblogic.socket.PosixSocketInfo$FdStruct;)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:95)
         - locked <f1499358> (a [Lweblogic.socket.PosixSocketInfo$FdStruct;)
         - locked <f149b368> (a java.lang.String)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    "ExecuteThread: '0' for queue: 'weblogic.socket.Muxer'" daemon prio=5 tid=0x888688 nid=0x39 waiting for monitor entry [e7201000..e72019bc]
         at weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:91)
         - waiting to lock <f149b368> (a java.lang.String)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    "ListenThread.Default" prio=5 tid=0x391fe0 nid=0x38 runnable [e7301000..e73019bc]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
         - locked <f14a1588> (a java.net.PlainSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
         at java.net.ServerSocket.accept(ServerSocket.java:419)
         at weblogic.socket.WeblogicServerSocket.accept(WeblogicServerSocket.java:24)
         at weblogic.t3.srvr.ListenThread.accept(ListenThread.java:739)
         at weblogic.t3.srvr.ListenThread.run(ListenThread.java:292)
    "Thread-6" daemon prio=5 tid=0xe85358 nid=0x37 in Object.wait() [e7781000..e77819bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f133ce00> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <f133ce00> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "ExecuteThread: '0' for queue: 'JMS.TimerTreePool'" daemon prio=5 tid=0xe85810 nid=0x36 in Object.wait() [e7881000..e78819bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f13cb200> (a weblogic.jms.backend.BETimerTree)
         at weblogic.jms.backend.BETimerTree.execute(BETimerTree.java:146)
         - locked <f13cb200> (a weblogic.jms.backend.BETimerTree)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    "Thread-5" prio=5 tid=0xf901a0 nid=0x35 in Object.wait() [e8201000..e82019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f12da390> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <f12da390> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "weblogic.health.CoreHealthMonitor" daemon prio=5 tid=0x56f560 nid=0x34 waiting on condition [e8401000..e84019bc]
         at java.lang.Thread.sleep(Native Method)
         at weblogic.t3.srvr.CoreHealthMonitorThread.run(CoreHealthMonitorThread.java:127)
    "Thread-4" prio=5 tid=0x250aa0 nid=0x33 in Object.wait() [e8501000..e85019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f1023e90> (a java.util.TaskQueue)
         at java.util.TimerThread.mainLoop(Timer.java:429)
         - locked <f1023e90> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:382)
    "VDE Transaction Processor Thread" prio=2 tid=0x67c288 nid=0x31 in Object.wait() [e8601000..e86019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0f07f98> (a com.octetstring.vde.backend.standard.TransactionProcessor)
         at java.lang.Object.wait(Object.java:426)
         at com.octetstring.vde.backend.standard.TransactionProcessor.waitChange(TransactionProcessor.java:356)
         - locked <f0f07f98> (a com.octetstring.vde.backend.standard.TransactionProcessor)
         at com.octetstring.vde.backend.standard.TransactionProcessor.run(TransactionProcessor.java:212)
    "ExecuteThread: '2' for queue: 'weblogic.admin.RMI'" daemon prio=5 tid=0x4e9be0 nid=0x30 in Object.wait() [e8701000..e87019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7c9e8> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7c9e8> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '1' for queue: 'weblogic.admin.RMI'" daemon prio=5 tid=0x375dd0 nid=0x2f in Object.wait() [e8801000..e88019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7ca68> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7ca68> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '0' for queue: 'weblogic.admin.RMI'" daemon prio=5 tid=0x375c38 nid=0x2e in Object.wait() [e8901000..e89019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7cae8> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7cae8> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '1' for queue: 'weblogic.admin.HTTP'" daemon prio=5 tid=0x501998 nid=0x2d in Object.wait() [e8a01000..e8a019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7cb68> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7cb68> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '0' for queue: 'weblogic.admin.HTTP'" daemon prio=5 tid=0x3756a0 nid=0x2c in Object.wait() [e8b01000..e8b019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7cbe8> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7cbe8> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "weblogic.security.SpinnerRandomSource" daemon prio=5 tid=0x500068 nid=0x2b in Object.wait() [e8c01000..e8c019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7ccb0> (a java.lang.Object)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.security.SpinnerRandomBitsSource.run(SpinnerRandomBitsSource.java:60)
         - locked <f0e7ccb0> (a java.lang.Object)
         at java.lang.Thread.run(Thread.java:536)
    "weblogic.time.TimeEventGenerator" daemon prio=9 tid=0x2a6a48 nid=0x2a in Object.wait() [e8d01000..e8d019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7cd20> (a weblogic.time.common.internal.TimeTable)
         at weblogic.time.common.internal.TimeTable.snooze(TimeTable.java:271)
         - locked <f0e7cd20> (a weblogic.time.common.internal.TimeTable)
         at weblogic.time.common.internal.TimeEventGenerator.run(TimeEventGenerator.java:118)
         at java.lang.Thread.run(Thread.java:536)
    "ExecuteThread: '4' for queue: 'weblogic.kernel.System'" daemon prio=5 tid=0x79dd30 nid=0x29 in Object.wait() [e8e01000..e8e019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7cd98> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7cd98> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '3' for queue: 'weblogic.kernel.System'" daemon prio=5 tid=0x2bb1a0 nid=0x28 in Object.wait() [e8f01000..e8f019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7ce18> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7ce18> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '2' for queue: 'weblogic.kernel.System'" daemon prio=5 tid=0x2f7df0 nid=0x27 in Object.wait() [e9001000..e90019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7ce98> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7ce98> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '1' for queue: 'weblogic.kernel.System'" daemon prio=5 tid=0x2f7a40 nid=0x26 in Object.wait() [e9101000..e91019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7cf18> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7cf18> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '0' for queue: 'weblogic.kernel.System'" daemon prio=5 tid=0x2f6e90 nid=0x25 in Object.wait() [e9201000..e92019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7cf98> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7cf98> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '24' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x2f62e0 nid=0x24 in Object.wait() [e9301000..e93019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7d018> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7d018> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '23' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x2f5760 nid=0x23 in Object.wait() [e9401000..e94019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7d098> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7d098> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '22' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x79a978 nid=0x22 in Object.wait() [e9501000..e95019bc]
         at java.lang.Object.wait(Native Method)
         - waiting on <f0e7d118> (a weblogic.kernel.ExecuteThread)
         at java.lang.Object.wait(Object.java:426)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:145)
         - locked <f0e7d118> (a weblogic.kernel.ExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:164)
    "ExecuteThread: '21' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x293028 nid=0x21 runnable [e9600000..e96019bc]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at oracle.net.ns.Packet.receive(Unknown Source)
         at oracle.net.ns.DataPacket.receive(Unknown Source)
         at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.net.ns.NetInputStream.read(Unknown Source)
         at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:931)
         at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:375)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1141)
         - locked <f1aed700> (a oracle.jdbc.ttc7.TTC7Protocol)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2149)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2032)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2894)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:608)
         - locked <f1ef9ab0> (a oracle.jdbc.driver.OracleCallableStatement)
         - locked <f1aec400> (a oracle.jdbc.driver.OracleConnection)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:684)
         - locked <f1ef9ab0> (a oracle.jdbc.driver.OracleCallableStatement)
         - locked <f1aec400> (a oracle.jdbc.driver.OracleConnection)
         at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:68)
         at com.fedex.meteor.ejb.sessions.updatebeans.updatesession.UpdateSessionBean.getFirstLogin(UpdateSessionBean.java:1243)
         at com.fedex.meteor.ejb.sessions.updatebeans.updatesession.UpdateSessionBean_zsi8w_EOImpl.getFirstLogin(UpdateSessionBean_zsi8w_EOImpl.java:3114)
         at com.fedex.meteor.servlet.MaintenanceUpdateServlet.modifyLogOutTimeCard(MaintenanceUpdateServlet.java:2594)
         at com.fedex.meteor.servlet.MaintenanceUpdateServlet.doPost(MaintenanceUpdateServlet.java:477)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    =================================================
    CODE
    =====
    import java.io.File;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import org.apache.log4j.Logger;
    import com.fedex.meteor.data.*;
    public class RunAsync {
    //=============
    // Logger
    //=============
    private static final Logger m_logger = Logger.getLogger(RunAsync.class);
    //==============================
    // Class Variables
    //==============================
    private static final String CLASSNAME = "RunAsync:";
    private StringBuffer errorMessage = null;
    Process pro = null;
    InputStream error = null;
    InputStream output = null;
    public RunAsync()
    logDebug(" Instantiating RunAsync!!");
    public void executeCall(String args[]) throws Exception{
    errorMessage = new StringBuffer();
    try {
    boolean status = false;
    if (args.length > 1) {
    String prg = "";
    for(int i =0;i<args.length;i++)
    prg = prg+" "+args;
    logDebug(" C Command: "+prg);
    pro = Runtime.getRuntime().exec(args);
    else {
    logDebug(" C Command: "+args[0]);
    pro = Runtime.getRuntime().exec(args[0]);
    error = pro.getErrorStream();
    output = pro.getInputStream();
    Thread err = new Thread(new OutErrReader(error));
    Thread out = new Thread(new OutDebugReader(output));
    out.start();
    err.start();
    int exitValue = pro.waitFor();
    logDebug(" Program's exit value:"+exitValue);
    if(exitValue!=0)
    logError("IOException: "+errorMessage);
    throw new Exception("Process has failed: "+errorMessage);
    catch(java.io.IOException e) {
    logError("IOException");
    reset(pro,output,error);
    throw new IOException(CLASSNAME+" Process failed : "+e.getMessage());
    catch(java.lang.InterruptedException e) {
    logError("InterruptedException");
    reset(pro,output,error);
    throw new InterruptedException(CLASSNAME+" Process failed: "+e.getMessage());
    finally
    reset(pro,output,error);
    public void executeCallWithEnvironment(String[] args,String[] env) throws Exception{
    errorMessage = new StringBuffer();
    try {
    boolean status = false;
    logDebug(" C Commandd: "+args[0]);
    logDebug(" Environment:"+env[0]);
    pro = Runtime.getRuntime().exec(args);
    error = pro.getErrorStream();
    output = pro.getInputStream();
    Thread err = new Thread(new OutErrReader(error));
    Thread out = new Thread(new OutDebugReader(output));
    out.start();
    err.start();
    int exitValue = pro.waitFor();
    logDebug(" Program's exit value:"+exitValue);
    if(exitValue!=0)
    logError("IOException: "+errorMessage);
    throw new Exception("Process has failed: "+errorMessage);
    catch(java.io.IOException e) {
    logError("IOException");
    reset(pro,output,error);
    throw new IOException(CLASSNAME+" Process failed : "+e.getMessage());
    catch(java.lang.InterruptedException e) {
    e.printStackTrace();
    logError("InterruptedException");
    reset(pro,output,error);
    throw new InterruptedException(CLASSNAME+" Process failed: "+e.getMessage());
    finally
    reset(pro,output,error);
    * This method closes the database connection before the bean is garbage
    * collected.
    protected void finalize()
    throws Throwable
    logDebug("finalize() is being called: ");
    reset(pro,output,error);
    private void reset(Process process,InputStream output, InputStream error)
    try
    if(error != null)
    error.close();
    if(output != null)
    output.close();
    if(process != null)
    logDebug("Sub Process is being destroyed after usage!");
    process.destroy();
    process = null;
    }catch(Exception ex)
    logError("Error in resetting the Process"+ex.getMessage());
    process = null;
    class OutErrReader implements Runnable {
    InputStream is;
    public OutErrReader(InputStream is) {
    this.is = is;
    public void run() {
    try {
    BufferedReader in = new BufferedReader(new InputStreamReader(is));
    String temp = null;
    while((temp = in.readLine()) != null) {
    logError(temp);
    errorMessage.append(temp+"\n");
    is.close();
    catch(Exception e) {
    logError(e.getMessage());
    if(errorMessage != null)
    errorMessage.append(e.getMessage());
    class OutDebugReader implements Runnable {
    InputStream is;
    public OutDebugReader(InputStream is) {
    this.is = is;
    public void run() {
    try {
    BufferedReader in = new BufferedReader(new InputStreamReader(is));
    String temp = null;
    while((temp = in.readLine()) != null) {
    logDebug(temp);
    is.close();
    catch(Exception e) {
    logError(e.getMessage());
    //======================
    // Logging Methods
    //======================
    // Method: logError()
    * This method will log error messages using the log4J API.
    protected static void logError(String strMessage)
    getLogger().error(CLASSNAME+"Error: [" + strMessage + "]");
    // Method: logWarning()
    * This method will log warning messages using the log4J API.
    protected static void logWarning(String strMessage)
    getLogger().warn(CLASSNAME+"Warning: [" + strMessage + "]");
    // Method: logInfo()
    * This method will log informational messages using the log4J API.
    protected static void logInfo(String strMessage)
    getLogger().info(CLASSNAME+strMessage);
    // Method: logDebug()
    * This method will log informational messages using the log4J API.
    protected static void logDebug(String strMessage)
    getLogger().debug(CLASSNAME+strMessage);
    // Method: getLogger()
    * This method will log informational messages using the log4J API.
    protected static Logger getLogger()
    return m_logger;

    ]Hey
    Can u please tell me how to invoke a C function using BPEL....I mean how can i build a webservice using my C function.I appreciate ur help
    Swethaa...

  • How do I call a C++ program from Java?

    I've tried using Runtime.exec to call my C++ program from Java but I don't think I'm doing it correctly. Could someone explain how to properly use it? Here's what I'm trying (this is in an applet that is only going to be running on an intranet so only PCs in my LAN will be affected):
    Runtime runtime=runtime.getRuntime();
    Process proc =runtime.exec("mkdir C:\\Test");

    What do you expect your operating system should do with a command "mkdir"? It doesn't understand this. "mkdir" is a shell command, so you need to execute the shell:
    runtime.exec("cmd /c mkdir C:\\test");

  • How to Call abap functn/program from java layer

    Hi all,
        I have to develop a program which has to call abap function/program from java side or how to call a abap program through java ..
    pls send me related links or explanations.. dont send unrelated answers..
    Regards,
    Arivarasu S

    Hi,
    You mean accessing ABAP functions from J2EE perspective, then I think we can do this by using SAP Java Resource Adapter and also through webservices.
    SAP Java Resource Adapter (SAP JRA) can be used as an add-on for the SAP JCo SAP JRA enables the implementation of standard interfaces from diverse J2EE servers to the SAP JCo in the SAP Web AS. The SAP JRA thus simplifies
    communication with ABAP within heterogeneous J2EE landscapes.
    Go through the following links which has Good documentation on how to achieve this
    Accessing BAPIs Using the SAP Java Resource Adapter
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4]
    Connectivity and Interoperability
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/326d82e5-0601-0010-fca4-9caf27b89c26]
    Finally with WebServices. Accessing SAP Business Functions (ABAP) via Web Services
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/06adbf03-0a01-0010-f386-d8e45561a3c4]
    Regards
    Raghu

  • Startrfc - SAP utility to invoke ABAP programs from External systems

    We have used the startrfc uitlity that comes along with the SAP Presentation CD. This is bundled with the SAP RFC SDK kit. The startrfc utility can be used to invoke ABAP programs from external systems or servers.
    When using the startrfc from the SAP server using the parameters
    startrfc -h 10.60.0.31 -s 01 -c 100 -u USERNAME -p PASS -F <Function Module> -E TPPARAM=\usr\sap\trans\bin\tp_domain_<SID>.PFL -T LIST,300,w=list.txt
    the desired results are achieved.
    However when using the same startrfc with the exact parameters from another server we get the message " Incorrect user or password". If we use the SAP GUI from this server to connect to the SAP server using the same username and password we are able to connect to the SAP system.
    Has anyone encountered any similar issues with Startrfc? Any suggestion will be appreciated.
    Thanks,
    ~Nilesh

    Hi NIlesh,
    Did you check that the password and user ID entered are in capita letters?
    Thanks and Regards,
    RK

  • Can we run EXE file/ Another Java Program from Java Application? How?

    Can we run EXE file and another java program from java application?
    Thanks in advance

    Example running adobe acrobat
    String command = "C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe /t "+selectedDocument+" \\\\CONTROL\\HP LaserJet 4L";
    Runtime rn = Runtime.getRuntime();
    Process process = rn.exec(command);
    process.waitFor();rykk

  • Error in calling 'C'  Program from Java

    Hi,
    We developed a 'C' Program and during compilation, we got a couple of Incompatible Prototype warnings. Then we made a Jni call to 'C' program from Java Program. The program returned a "Unsatisfied Link Error - unreference Symbol not found" error.
    Does Jni call fails owing to warnings by compiler?
    We are using Sun Solaris 2.8.
    Request your assistance as this a urgent issue.
    Thanks
    Srini

    Did you try running your C program through g++? It sounds like something is broken, but GCC often will allow you to compile anyways.
    -Jason Thomas.

  • How to invoke BPEL process from JAVA API

    Hi Guys
    Any idea if you can tell me how to invoke BPEL process from JAVA API ?
    What to do in BPEL process manager to achieve that?
    Regards
    Deepak

    See http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.

  • Invoke beanshell methods from java

    Hello
    I'm learning beanshell and using it to write scripts that are ran in JDK 6.
    My question is how to invok beanshell methods from java source codes.
    My codes is:
    import javax.script.*;
    public class InvokeFunctions {
    public static void main (String[] args)throws ScriptException, NoSuchMethodException
    ScriptEngineManager sem = new ScriptEngineManager();
    ScriptEngine bshEngine = sem.getEngineByName("beanshell");
    String script = "public void sayHello()"+"{print (\"sayHello() is a method in bsh script\");}";
    bshEngine.eval(script);
    Invocable inbshEngine = (Invocable)bshEngine;
    inbshEngine.invokeFunction("sayHello");
    I defined a method "sayHello()" using beanshell, but i just can't invoke it in Java.
    I got an error msg said:
    Exception in thread "main" java.lang.IllegalAccessError: tried to access method bsh.NameSpace.getThis(Lbsh/Interpreter;)Lbsh/This; from class bsh.engine.BshScriptEngine
    Any one has any idea about it?
    Thanks

    Look at the Javadoc documentation of IllegalAccessError. It says:
    Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to.
    Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.
    Maybe recompiling all your sources (make sure you delete all existing *.class files) will help?

  • Call visual prolog program from java

    Hi friends,
    is there someone help me to call ( run) prolog program from java.
    i write a parser with Javacc parser generator and stored parsed information in prolog database and I want create some query in java that work in the prolog file.
    how can i combine java and prolog programs. i used visual prolog.
    Can someone help me?
    Thanks you in advance.
    yours sincerely,
    ksu

    Since visual prolog can produce dll's, you can use JNI:
    http://java.sun.com/j2se/1.4.2/docs/guide/jni/index.html

  • Invoking dos commands from java

    hi all,
    I just want to invoke dos prompt from java.I know it can be done using "Runtime.getRuntime()" command.But when i try to create a directory inside another directory,how can i specify the path of the destination directory.i googled as well as tried different things.But i failed to make it up.Please help me solve this problem.
    thanks in advance
    Regards

    Hai,
    Thanks for your respond.
    If I give "cmd" command only, I am getting dos command window, but I didn't get the prompt like
    c: or d:
    How can I do it?
    Expecting more helps
    Joseph

Maybe you are looking for

  • How to change default vertical page co-ordinates from center, to top?

    Hi There, We're having trouble understanding why InDesign centers the page instead of aligning the view to the top when switching pages (and copying and pasting) - and how to change this behavior. To understand what I'm talking about, do the followin

  • Sales Table reqd

    Hi experts, My user need following data for sales register: Invoice date Invoice no. Customer code Customer Name Invoice qty Unit of measurement F.O.B. amount Freight recovered VAT Tax code Octroi Other deductions Total amount GL code Business Area C

  • XML Output order

    Hi, How can I control the order of columns in XML output? The order in data model applies only to database columns. The formuale columns appear at the end of database columns irrespective of the location of formuale column in the data model.

  • Authorization based on project code

    Hi All Can we base our authorizations on the basis of project code. Can a user be authorize for a project so that user cant see orher project's information. Thanx in advance

  • Where can I download a new version of Firefox that does NOT automatically install in Croatian language

    I'm new to Firefox. I specifically went to an English download page and downloaded the latest Firefox in English. I installed it, and it automatically changed to Croatian, where I live, without any warning. Then I searched for an option to change it