Starting New process (continous) from another java process

Hi,
I am running into a trouble in starting a new java process (continous process it is like daemon process ) from another java process.
Eg;
Caller.java runs on one JVM instance, from this Caller.java i need to start a daemon java process ConnectionManager.java (My caller.java should have to know whether ConnectionManager was successfully started as a seperate java process or not)
Also Caller.java has to stop ConnectionManager.java(which is running as seperate process)
Any help would be appeciated.
Thank you very much.

First of all the design is unusual. Your issue is basically intercommunication between two processes written in java. There are various ways to do that:
1. Use Persistent system(File/Database) : Easiest but have external dependency.
2. Use RPC calls both JVM,s little bit complex.
3. Run new JVM in debug mode and connect on bootstrap port.
4. Communicate using Sockets.
Whatever suits you...

Similar Messages

  • Killing a Java process from another Java process

    Hi
    Is there a possible way of sending a SIGINT, SIGKILL, or any other signal from a Java process running in one JVM, to a java process running in a different JVM on the same machine.
    I've the signal handlers written in my process and they do respond to singals (e.g. on pressing Ctrl-C) on the console, but i want to write a separate program that sends this signal to the first process.
    Any ideas?
    Thanks in advance and regards
    Kashif

    The answer, as always, is that Java can't do operating-system-specific things like that, but you can use JNI to do it. However, if your code created the Java process you want to kill, via Process p = Runtime.getRuntime().exec(...), then you can use p.destroy() to kill it.

  • Timeout error calling a Business Process from another Business Process

    Hi to all,
    How can I call a Business Process (BP2) from another Business Process (BP1) and wait for the response before other things are performed? I'm trying to call from BP1 in a synchronous step the process BP2; the first step of BP2 is an Open S/A Bridge and, after a transformation, a Close S/A Bridge, but no response returns to BP1 till a timeout error.
    Thank you very much,
    Antonio

    I did some changes and the error now I am getting is,
    ===========================================================
    Error : null oracle.jsp.JspServlet.internalService(JspServlet.java:186)oracle.jsp.JspServlet.service(JspServlet.java:156)javax.servlet.http.HttpServlet.service(HttpServlet.java:588)org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)org.apache.jserv.JServConnection.run(JServConnection.java:294)java.lang.Thread.run(Thread.java:534)
    Error : oa_html._Text__Button__Lat._jspService(_Text__Button__Lat.java:712)oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)oracle.jsp.JspServlet.internalService(JspServlet.java:186)
    ============================================================
    Does the middle tier need to be bounced?
    Thanks

  • Invoking bpel process from another bpel process in same app server

    Hi,
    When I invoke a bpel process from another bpel process in the same oracle AS
    1. Is it a SOAP call or is there any optimization?
    2. If there is some optimization where can I configure this?
    3. Is there any similar optimizations if I invoke a bpel process from a
    java application deployed in the same server? If so can you please provide
    a sample?
    Thanks for your help
    Raj

    By default the BPEL 10.1.2, it will do a local call to the process. It will not execute a SOAP request, no network access is done.
    It can be configured at domain level:
    Parameter: optSoapShortcut (SOAP local optimization)
    Turns on "short-cut" for local SOAP request; local SOAP calls are normally done via an internal call instead of sending a message through the SOAP stack.
    The default behavior for the engine is to optimize all. To disable optimization specify a value other than "true" or "yes".

  • Calling BPM Sub Process from another BPM Process - Stuck at Sub Process

    Hi
    JDeveloper 11.1.1.6, BPM 11.1.1.6, WLS 10.3.6
    I am trying to Call a BPM Process from another BPM Process. Both the processes are defined in the same BPM Project.
    Both the Processes have 'None' Start and End activities.
    The 'Parent Process' has a 'Call Activity' which calls the 'Sub Process'.
    The Sub process takes a parameter of payload object as input and returns output (also same payload object)
    I have passed the payload object from parent to sub process in the 'Data Associations'.
    The Start and End activities in the sub process also have the data associations set where I am passing the payload object from parent process to child process.
    When I run the process and see the Enterprise Manager console - Audit Trail / Flow tabs,
    Flow Tab - The progress of the process is showing only till the Calling of the sub process in the Parent Process. It does not show the Sub Process.
    Audit Trail Tab - Shows that the Sub Process is called but has not reached to the End of the Sub process.
    The audit trail does not have links to the sub process activities.
    I cannot see any exceptions as well in the audit trail.
    How can I find out why the process is stuck? Or what is going on in the process?
    Please let me know if my explanation is not clear?
    Thanks for any help
    Regards
    Sameer

    Thanks for replying.
    I have another Sub Process with Start and End events as Message Events and used Send Task and Receive Task (Implementation : Process Call) in the Main process to invoke the sub process asynchronously.
    Then, the Sub Process is shown in the 'Flow Trace' as child of the main process.
    In this particular one, I used 'Call Activity' to call the sub process.
    So the Audit trail is showing the sub process as a child.
    But what I was trying to say is that the audit trail did not have links to the entries in the 'Event' column (in Enterprice manager - instance window). (like Instance entered activity, Instance left activity etc).
    I was intending to use these links to see the payload information and try to debug if there is any problem with the code.
    The actual problem I was trying to say in the post is that, even after the user responds to the activity (User Task - Approval) in the Sub process,
    the audit trail is not proceeding further.
    In the Sub process definition, after the user task, there is End with none implementation.
    Hope it is clear now.
    Thanks and Regards
    Sameer

  • Spawning another java process after System.exit(0);

    Hi everyone
    I have an application that Im trying to test. Unfortunately one of these tests requires me to spawn another java process after a System.exit(0); has executed. Since this exits the VM its proving very difficult. Does anyone know of a way to restart the VM after the System.exit has run?
    Thanks

    Hi everyone
    I have an application that Im trying to test.
    Unfortunately one of these tests requires me to spawn
    another java process after a System.exit(0); has
    executed. Since this exits the VM its proving very
    difficult. Does anyone know of a way to restart the VM
    after the System.exit has run?Exactly what do you want to do?
    If the application is supposed to only have one exit point then add a security manager and disallow all the other exit points. Then you can use Runtime.exec() to start the second application just before the real exit point.
    However note that if there are other calls to System.exit in the application then it is very likely that this will cause some unexpected failures in terms of security exceptions.
    You could also use Runtime.addShutdownHook() which would run your second app. The hook would be called as the application exits.
    You might want to consider what happens if someone just kills the application (say with 'kill -9' or the windows task manager.) In either of those cases there is nothing that you can do in java to make that second application run.
    You might also want to consider why you are doing this in the first place. As suggested a script solution is probably a better solution.

  • Get process preference from Mediator Java CallOut

    Hi,
    I have used Java Call Out in my mediator. Mediator further forwards the request to BPEL having some preferences. I want to
    get BPEL Process preference value in Java Call Out class method preRouting(). Is it possible?
    I found 1 way to achieve the same using Oracle Fusion Middleware Infrastructure Management Java API. But problem with this is that- I need to hard code parameters like composite endpoint, username & password which I do not want.
    Is there some other way to to get process preference from preRouting()?
    Thanks,
    Sujata

    I don't think you can get the process ID from within java or send signals to other processes.
    You might look at the sun.misc.Signal class. However, it is not recommended to use sun.* classes and I don't think it will do what you need either.
    You will probably have to use JNI, or if it is your program you could just have it send its process ID to standard out.

  • Trying to compile a .java file from another .java file

    Hello,
    I'm trying to compile a .java file from another .java file using Runtime.exec...
    String c[]=new String[3];
    c[0]="cmd.exe"; c[1]="/c" ; c[2]="javac Hello.java";
    Process p=Runtime.exec(c);
    If anyone can help me in atleast getting the command prompt when Runtime.exec("cmd.exe") is executed...that would be great...I tried out notepad.exe, calc, explorer instead of cmd.exe...all the commands display their respective windows..except cmd.exe...the command prompt doesnt appear...
    Please help me ASAP....
    Thanks for your help in advance...
    Regards.
    AKhila.

    try this. ur code will be compliled and will get .class file. but console won't appear. is it a must for u?
    public class Exec{
         public static void main(String a[]) throws Exception{
              String c[]=new String[3];
              c[0]="cmd.exe"; c[1]="/c" ; c[2]="javac Hello.java";
              Process p=Runtime.getRuntime().exec(c);
              // or Runtime.getRuntime().exec("javac Hello.java");

  • How to call a Java class from another java class ??

    Hi ..... can somebody plz tell me
    How to call a Java Class from another Java Class assuming both in the same Package??
    I want to call the entire Java Class  (not any specific method only........I want all the functionalities of that class)
    Please provide me some slotuions!!
    Waiting for some fast replies!!
    Regards
    Smita Mohanty

    Hi Smita,
    you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
    e.g.
    you have developed A.java and B.java, both are in same package.
    in implementaion of B.java
    class B
                A obj = new A();
                 //to access A's methods
                 A.method();
                // to access A's variable
                //either
               A.variable= value.
               //or
               A.setvariable() or A.getvariable()

  • Is it possible to run process chain from the certain process/point?

    Hello
    Is it possible to run process chain from the certain process?
    How?
    Thanks

    Hello,
    yes it possible! use the following steps.
    1. Goto the process which you want the chain to start from.Goto display messages>> Chain tab. In the generated instance note the variant and instance.
    2. Goto table RSPROCESSLOG and give variant and instance and get logid details.
    3. t codese37>> run FM RSPROCESSFINISH.
    4. give the deatils u have got in RSPROCESSLOG table here and say execute.
    This will solve ur problem.
    Hope this helps!
    Reg
    Deepmala

  • How to Get the Parent Process ID from Child BPEL Process

    Hi All,
    We have a requirement to get the Parent BPEL Process ID from Child BPEL Process. One way is we can pass the Parent BPEL process ID from Parent BPEL Process to Child BPEL process. Is there any standard function available to get the Parent BPEL process ID from Child Process?
    P.S: We are using BPEL 10.1.3 Version.
    Please share any info on this.
    Thanks in Advance,
    Saravana

    Hi Saravana,
    The existing methods in 10.1.3x allow a following (a bit of a convoluted way):
    In a BPEL Java embedding activity, you can use the following code to get the parentProcessname:
    String parentInstanceId = getParentId();
    String parentProcessname = getLocator().locator.lookupInstance(parentInstanceId).getProcess().getProcessId().getProcessId();Hope this helps,
    Regards,
    Shanmu
    http://www.prshanmu.com/articles/

  • Please help with executing a java program from another java program

    Hi, I have tried to execute a very simple java program which is printed out "Hello world" from another java gui program when the user click on the "START" button. However, I don't receive any print out on the terminal when they click it. These two programs are being developed in Unix environment. Here is the code that I am trying to use.
    Runtime r = Runtime.getRuntime();
    r.exec("java HelloWorld");
    p.s. HelloWorld is java class of the HelloWorld.java

    I think you have to luanch your MS Prompt first before executing the command.

  • How to start an executable program from a java program ?

    Hi,
    does someone know how to start an executable program from a JAVA program ?
    Thanks, Fred.

    Take a look at the Runtime class.
    -S-

  • How to compile and run a .java file from another java program

    hello,
    can any one tell me how to compile and run a *.java* file from another java program which is not in same directory?

    Well a smarter way of implementing this is by using a solution provided by Java Itself.
    If you are using J2SE 6.0+ there is an in built solution provided along with JDK itself and inorder to go ahead with solution the below are set of API which you;d be using it for compiling Java Programs (Files)
    http://java.sun.com/javase/6/docs/api/javax/tools/package-summary.html
    How do i do that ??
    Check out the below articles which would help you of how to do that
    http://www.ibm.com/developerworks/java/library/j-jcomp/index.html
    http://www.javabeat.net/javabeat/java6/articles/java_6_0_compiler_api_1.php
    http://books.google.com/books?id=WVbpv8SQpkEC&pg=PA155&lpg=PA155&dq=%22javax+tools%22+compiling+java+file&source=web&ots=XOt0siYe-f&sig=HH27ovuwvJgklIf8omTykUmy-eM
    Now once we are done with compilation.In order to run a Specific class all you ought to do is create an object and its specific methods of a specified class included in the CLASSPATH which you can manage it easily by usage little bit reflections.
    Hope that might help :)
    REGARDS,
    RaHuL

  • How to start a independant Daemon program from another java daemon?

    Hello,
    I made two java daemon program Daemon_A and Daemon_B. By definition these two program work whithout any user interaction but most of it they should never fall down.
    So in order to be sure that the both daemon are up (and to prevent any failure) I create a mechanism to check each other and if one is down it will be restart by the other one.
    Up to now I succeed to restart the one who fall down. But ... there is always a but ...
    At start:
    - 1) Daemon_A and Daemon_B start.
    - 2) Daemon_B fall down.
    - 3) Daemon_A restart Daemon_B using this:
       String[] commandArray = new String[3];
       commandArray[0] = "../bin/java";
       commandArray[1] = "-jar";
       commandArray[2] = "Daemon_B.jar";
       Process oProcess = runtime.exec ( commandArray, (String[]) null);- 4) Daemon_A and Daemon_B are UP again.
    - 5) Daemon_A crash then Daemon_B is kill too.
    So once the Daemon_B is restarted it seems that there is still a link between Daemon_A and Daemon_B.
    As I use a command system to restart the daemon I don't understand why my Daemon_B is dependant from the Daemon_A.
    Is there another way of doing this?
    How can I restart my Daemon_B (from the Daemon_A) in a independant process?
    As i'm running out of idea any help will be apreciate,
    thanks
    Emmanuel

    Because you do not need javaw on Unix. You can achieve
    what you want in the normal Unix way. Confer: nohup,
    &, stderr and stdout redircetion.That's not correct, I can not achieve what I want on Unix.
    Well with the above piece of code if I use javaw for launching my command through a system command (runtime.exec) on windows it will start a 100% independant process which is find.
    But under unix if I keep using simply java the process will stay a child process. Which mean if the "father daemon_A" die daemon_B will die too.
    So that's why I woudering if there is a similar program as javaw on unix to avoid create chid process using 'runtime.exec'.
    You mentioned crontab: it does not make an item to act
    as a deamon, it rather periodically runs it. Yhea you right my mistake I don't use the crontab to launch the program. I use "etc/init.d" (for sun solaris) and service for windows. Otherwise the daemons are "real" daemon: one's they are started they keep listening and should never fall. But to get a hight level of security I want to be sure if one fall it will be restarted whithout beeing a child process of the other one.
    so any idea on unix of how can I re-start a daemon in a independant way?
    regards,
    emmanuel

Maybe you are looking for

  • Contribute error message when trying to embed PDF's

    I am trying to insert an embedded PDF as a new webpage on my website.  I can get it to work fine and embed the PDF, but then I try to resize the PDF so that when I open the webpage the PDF takes up the whole page and not just a small corner.  Any tho

  • Bubble chart color

    Hi, just wondering if anyone knew how i can change the color of a bubble in the flex bubble chart when the mouse moves over? thanks

  • [Music&Movies] Cannot move forward etc faster :(

    Dear all, Since I've update my BB 8520 to the last version (which is a great update), I can't move back and forward as fast as I was able to do it with music and video with the previous version, now it only jumps 1s per 1s, I have checked in most of

  • HOW TO COLOUR SOME COLUMNS GLOBALLY

    hi gurus I HAVE 4 CHARACHTERISTICS AND 20KEY FIGURES. I WANT WHEN WE EXECUTE THIS SOME COLUMNS COMES IN DIFFERENT COLOURS, IS IT POSSIBLE TO COLOUR SOME CHARACTERISTICS OR KEY FIGURES GLOBALLY THANKS ABHAY

  • Arrow keys not scrolling right

    Hello. My smooth-scrolling arrow keys are no longer smooth. They jump the page to the bottom or top, but my Page Down and Up are fine. Can you tell me how to change the arrow keys back to what they were? THANKS!! shawn