Stop a thread which held by Remote call

I have start a thread for Remote Call using RMI. I want to stop it when the Remote call doesn't response (timeout function). I have implemented the following
class Test
String str;
Thread thread1;
public void method(){
thread1 = new Thread(){
public void run(){         
while(true){//Simulate the call doesn't response
thread1.start();
Thread thread2 = new Thread(){
public void run(){
try{
sleep(2000);
}catch(InterruptedException e){
System.out.println(e);
System.out.println("Interrupt");
thread1.interrupt();
thread2.start();
try{
thread2.join();
if(thread1.isAlive()){
System.out.println("Alive");
//Stop thread1
}catch(InterruptedException e){
System.out.println(e);
System.out.println("End");
     public static void main(String[] args){
          Test t = new Test();
t.method();
Would any one please tell me how to stop the thread1?
Thank you.

There is a deprecated method for stopping a thread, called, unsurprisingly, Thread.stop(). It's deprecated for good reason.
I suspect your program would have worked if a real remote method call had been involved. The interrupt() method could perhaps have been better named. It doesn't cause a interrupt in the classical sense. For the most part, it just sets a flag that can be tested using the Thread.interrupted() method. However, certain blocking operations do get terminated prematurely and in that case an interrupt is thrown. See for example InputStream.read() which can throw IOException, or which InterruptedIOException is a subclass. I rather think that interrupting an RMI call would result in a RemoteException being thrown.
Sylvia.

Similar Messages

  • How to stop a threads that makes I/O calls ?

    Hi,
    I've a business method that calls a Stored Procedure and makes lots of calculations. This method works inside its own thread, because I do not want to stop the GUI from accepting user actions.
    My problem is : this method may take from 5 minutes to 1 hour to process, depending on the size of the input. Sometimes, for any reason at all, the user may want to stop this execution (pressing a button on the GUI). How can I safely stop the thread ?
    I know I should not use stop() and suspend() because they are deprecated. And I do not use loops (remember it calls only a StoredProcedure that makes all processing), so I cannot use a variable nor interrupt(), because they do not work.
    Do you know any other way to stop this thread's execution ? By the way destroy() is not implemented.
    Thanks and regards.
    Bruno

    Are you saying that the 5 minutes to an hour is all spent in the stored procedure?
    If so the only real solution is to kill the statement - I'm not sure how the DB will handle that, but it will certainly free up your cycles.
    To do that without violating encapsulation, you just need to keep a reference to an object that knows something about the DB connection - you don't have to actually pass around the JDBC objects.
    Consider an object like this:
    public class DoLongProcedure {
       private Statement dbStatement;
       public double doLongCalculation() {
          dbStatement.execute(...);
          // etc
       public void interruptCalculation() {
          dbStatement.close();
    }You create an instance of this object and call its doLongCalculation() method to start everything. You have a reference to this object somewhere, because you are waiting for a response. When the user wants to cancel the process you just call the interruptCalculation() method.
    You have not violated your separation of functionality - if you find a new way to stop the process without killing the statement later, you just reimplement that method.

  • Stopping a Thread (where I don't have control of run)

    Is there any way to stop a thread whose run method simply calls a method of another class?
    For example:
    public class myThread extends Thread
      private String className = ...;
      public void run()
        // get className's "main" method and run it

    Actually...Smarsh is right. This is the correct way
    to stop a thead....stop() is deprecated because it can
    cause a deadlock condition. So, in run(), if you
    defined a boolean like "bStopThread" run would look
    like this:
    public void run()  {
    if(bStopThread)
    return;
    // if we drop here...this is the rest of our run
    un code
    Yeah, I get that's how you should stop a thread...
    Let me rephrase the question a little. Say the thread's run method looks similar to this:
    public void run()
      if (stopped)
        return;
      someOtherClass.aMethod();
    }Once it's in aMethod, I have to let it run until it's done, right? There's no other way to stop a thread other than checking a stop condition?

  • The Thread which won't let go...

    I posted very late last night and those who responded were a big help. Still, even though I changed my code I'm worked my way right around into a big circle and the exact same stopping point. Here is some sample code to try to simplify my complication.
    I'm attempting to complete an assignment (due in a few hours) lol... which is supposed to be an "application" not an "applet". It's a lesson in multi-threading. Supposidly there is a main thread which drives everything, several processing threads and a thread which prompts for input. I've got the Thread which prompts for input working just fine as well as the others. However, whenever one of the processing threads begins to process the data, I get no further DOS prompt from my input object until that Thread has completed. I'm going nuts trying to figure out how not to have this happen.
    I'll make an attempt at a simplified version of what's happening below:
    class mainThread impliments Runnable(){
        public void run(){
            while(true){
               //call inputThread object
               dataprocessor();
               //call processorThread object
        public void dataProcessor(){
            //processes data & calls on other methods & objects
            //to help
    class processorThread impliments Runnable(){
    //several of these objects are created to process data
    class InputThread impliments Runnable(){
    //has two methods as given to us by instructor
        public String method1(){
            //involks prompt requesting Strings or characters from user
            //  returns String
        public int method2(){
            //involks prompt requesting integer from user
            //  returns int
    }The problem is when processorThread object is called, everything stops and waits for it to complete. Help!!

    A thread has 3 elements;-
    - start()
    - run()
    - stop()
    controlled by boolean values if(myInt==myCondition){
      myThread.stop();   // method is depricated as it may not stop 'cleanly' and thrfr = memory prob's
      nowPutTheCatOut - etc
    // Better method;-
    public void start() {
    if(myCondition=false){
      myThread.run();
    // X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*X*Hope that helps

  • How to stop a thread in java 1.5 on windows

    Hi All,
    I am using Java 1.5 on windows plateform. I want to stop all the threads which belongs to a particular process when the timeout occurs. In java 1.5 stop() method is depricated and interrupt method just sets the flag and does not stop the thread actually.
    Is there any way to destroy the thread permenently. I am using TheadPool Executor class.
    Regards
    Rinku Garg

    Hi,
    I am having a timer task which is scheduled to run after some fixed time interval when the process started.
    Now this timer task when started, should destroy the active threads of the request. When the request is timed out then the thread is action should termininate.
    In my case run method of particular thread had already made a call to Database through DAO when the time out occurs. So how can I set up a loop in run method which I found on google.
    thread.stop() is deprecated.
    thread.destroy() is deprecated.
    I used thread.interrupt() but it does not stops the thread.
    Please help me in this scenario.
    Regards
    Rinku Garg

  • Stopping a Thread.... again

    Hi all,
    a couple of months ago I've posted a similar topic, on how to stop a thread without using the deprecated stop() method. Still, no result. I have a great deal of calculations that should be done in a separate thread. Due to the fact that the calculations might take up to 10 secons (or more), I would like to give the ability to the user to stop the process of calculations.
    public class Calculations(){
        //Field Declaration
          Thread t;
        public void doTheJob(){
            if(t != null)
                 t = null;
            t  = new Thread( new Runnable(){ public void run(){
                <PERFORM THE CALCULATIONS>
            t.start();
        public void stopTheJob(){
                 <HOW????, t.stop() works "fine">
    }The stop() method of class Thread will do perfectly and stop the procedure. However is deprecated. I've checked the alternative of stop using while( t!= null) loops, but there is no loop in the procedure!! There is just a bunch of operations that should be done in a separate thread. It is logical that something as the following won't do if the procedure has already started.
        public void stopTheJob(){
                 if( t != null)
                      t = null; //No point if the procedure has already started
        }Please correct me if I'm wrong, but help me understand how...
    I am not a programmer and not that smart but I still want to solve this issue.
    I would gladly provide more information if necessary.
    Thnx in advance,
    F.

    There are fundamental problems with monitors (i.e. synchronized bits). You can be sure they've given a lot of thought to cleaning up and decided there's no safe way to do it.
    stop still works and there are very rare situations in which I'd use it. In particular if the thread were running someone else's not fully trusted code and a framework decided an infinite loop was happening. Depracation is a warning, not an error.
    However it's generally no problem at all to have a thread watch for being interrupted and stop itself.
    Generally the interrupt call is the best mechanism since it kicks the thread out of wait or sleep, or sets a flag which you can test (or which will cause an exception next time you wait or sleep.

  • Can't stop synchronized threads with I/O read and write

    I have two synchronized threads which doing read and write from and into a file.
    One thread called "reader" which does reading, encoding, etc from a source file and puts its output in a pre-defined variable. Another called "writer" which puts the reader's output into a file ( not the source file ). Both thread will notify each other when they've finished each of their part. It's similiar to CubyHole example of Java Tutorial example from Sun.
    But somehow it seems like the threads keep spawning and won't die. Even if the source file has been all read and the data has been fully written, calling interrupt(), return, etc has no effect. The threads will keep running untill System.exit() called.
    Is it because the threads were blocked for I/O operation and the only way to kill them is to close the I/O ?
    To be honest, it's not only stop the threads that I want to, I also want to somehow pause the threads manually in the middle of the process.
    Is it possible ?
    Cheers.!!!

    The example code for the problem using 4 classes called :
    - libReadWrite ( class holding methods for aplication operations )
    - reader ( thread class responsible for reading data )
    - writer ( thread class responsible for writing data )
    - myGUI ( user interface class )
    All of them written in different file.
    // libReadWrite
    pubic class libReadWrite {
    private boolean dataReady;
    private String theData;
    //read data
    public synchronized void read(String inputFile) {
    while (dataReady == true) {
    try {
    wait();
    } catch (InterruptedException ex) {}
    RandomAccessFile raf = new RandomAccessFile(inputFile, "r"); // I'm using raf here because there are a lot of seek operations
    theData = "whatever"; // final data after several unlist processes
    dataReady = true;
    notifyAll();
    public synchronized void write(String outputFile) {
    while (dataReady == false) {
    try {
    wait();
    } catch (InterruptedException ex) {}
    DataOutputStream output = new DataOutputStream(new FileOutputStream(outputFile, true));
    output.writeBytes(theData);
    dataReady = false;
    notifyAll();
    //Reader
    public class reader extends Thread {
    private libReadWrite myLib;
    private String inputFile;
    public reader (libReadWrite myLib, String inputFile) {
    this.myLib = myLib;
    this.inputFile = inputFile;
    public void run() {
    while (!isInterrupted()) {
    myLib.read(inputFile); <-- this code running within a loop
    return;
    public class writer extends Thread {
    private libReadWrite myLib;
    private String outputFile;
    public writer (libReadWrite myLib, String outputFile) {
    this.myLib = myLib;
    this.outputFile = outputFile;
    public void run() {
    while (!isInterrupted()) {
    myLib.write(outputFile); <-- this code running within a loop
    try {
    sleep(int)(Math.random() + 100);
    } catch (InterruptedException ex) {}
    return;
    //myGUI
    public class myGUI extends JFrame {
    private libReadWrite lib;
    private reader readerRunner;
    private writer writerRunner;
    //Those private variables initialized when the JFrame open (windowOpened)
    libReadWrite lib = new libReadWrite();
    reader readerRunner = new reader("inputfile.txt");
    writer writerRunner = new writer("outputfile.txt");
    //A lot of gui stuffs here but the thing is below. The code is executed from a button actionPerformed
    if (button.getText().equals("Run me")) {
    readerRunner.start();
    writerRunner.start();
    button.setText("Stop me");
    } else {
    readerRunner.interrupt();
    writerRunner.interrupt();
    }

  • Stop current thread

    I have got a Thread (made from swing thread).
    In the run() method i create a frame with a button that has an "actionperformed" and I show this frame and I put a loop like "
    while(true){
    Thread.currentTread.sleep(1000);
    System.out.println("bip");
    But in the button action I try to kill this Thread.
    But, no one of the methods from Thread class "yield", "destroy", "interrupt" seems to work.
    QUESTION :
    ==> How can I do to kill a Thread when I have his name or when it is the current Thread.

    Right - your best option is to either make the thread null (thus removing the object and stopping the thread from running), which is a bit heavy handed. Be careful of this, especially if you'll be creating new instances all the time - creating and scheduling threads can be quite processor and time intensive.
    The other option is to have the while loop use a boolean variable, such that you can do something like
    // instnace variable:
    private boolean running = true;
    // now a method to modify it:
    public void setRunning(boolean run)
      running = run;
    //some more code in your class...
    // now the body of the run method:
    while(running)
      Thread.currentTread.sleep(1000);
      System.out.println("bip");
    }Thus, when someone calls yourObjectName.setRunning(false), the run() method will quit.
    All you have to do now is call yourObjectName.start() to make it run again.
    I can't think of any cleaner ways to do this, so if they're any Java Gurus out there, help me out here.
    So, do this if you want to stop a thread running; but if you really want to kill it, and not use it again, make the object null.
    Let me know if this works for you,
    Rich

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • How to get Remote Data from a file which is in remote system

    Hi everybody,
    I have developed four classes.
    FileInterface.java:-
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface FileInterface extends Remote {
    public byte[] downloadFile(String fileName) throws
    RemoteException;
    FileServer.java:-
    import java.io.*;
    import java.rmi.*;
    public class FileServer {
    public static void main(String argv[]) {
    if(System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    FileInterface fi = new FileImpl("FileServer");
    Naming.rebind("//10.161.15.219/FileServer", fi);
    } catch(Exception e) {
    System.out.println("FileServer: "+e.getMessage());
    e.printStackTrace();
    FileImpl.java:-
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class FileImpl extends UnicastRemoteObject
    implements FileInterface {
    private String name;
    public FileImpl(String s) throws RemoteException{
    super();
    name = s;
    public byte[] downloadFile(String fileName){
    try {
    File file = new File(fileName);
    byte buffer[] = new byte[(int)file.length()];
    BufferedInputStream input = new
    BufferedInputStream(new FileInputStream(fileName));
    input.read(buffer,0,buffer.length);
    input.close();
    return(buffer);
    } catch(Exception e){
    System.out.println("FileImpl: "+e.getMessage());
    e.printStackTrace();
    return(null);
    FileClient.java:-
    import java.io.*;
    import java.rmi.*;
    public class FileClient{
    public static void main(String argv[]) {
    try {
    String name = "//10.161.15.219/FileServer";
    System.out.println("1");
    FileInterface fi = (FileInterface) Naming.lookup(name);
    System.out.println("2");
    byte[] filedata = fi.downloadFile("//10.161.15.88/C/RMITEST/Test.txt");
    System.out.println("3");
    File file = new File("//10.161.15.219/T.txt");
    System.out.println("4");
    BufferedOutputStream output = new
    BufferedOutputStream(new FileOutputStream(file.getName()));
    output.write(filedata,0,filedata.length);
    output.flush();
    output.close();
    } catch(Exception e) {
    System.err.println("FileServer exception: "+ e.getMessage());
    e.printStackTrace();
    Now Iam trying to access text file which is in remote s/m.
    It is developing stub and skeleton classes,when i run it is coming for local
    If I want to access remotely the error is coming like this
    1
    2
    3
    FileServer exception: null4
    java.lang.NullPointerException
         at FileClient.main(FileClient.java:18)
    Can anybody help me please.

    Probably the easiest way in this case is to run the performance trace (System/Utilities/Performance trace). Start transaction MD04, put on the trace in another window, press enter to see the stock/requirements list, then stop the trace and list the results. Then you'll see which tables were accesses with which queries.

  • How to stop main thread ?

    Hi,
    Inside my java class, after I launch a GUI, I want to stop this main thread. After user make some choice and close GUI window, then, I want to go back to main thread. I use wait() method inside my class to stop main thread , but it does not work and it give me "IllegalMonitorStateException" error. I met same thing, when user close the GUI window and call method notifyAll(). How to stop main thread for a while and how to go back?? Thanks
    Gary

    Hi,
    you can create a boolean, and create a while loop, with a Thread.sleep(time); when you want to continue, you just have to change the state of your boolean. So you don't hava to exit the main. And you can't restart a run() in a thread. You can run it only once, so try to keep in your run() with an appropriate loop.
    Hope it helps.
    S�bastien

  • How is it possible to make sure that LV uses the same thread for several threadsafe DLL calls?

    Hello,
    i have a thread safe DLL and most functions are called from serveral threads from the LV apllication without problems.
    In case of an error i have to call an error handler function in this DLL (like WinAPI: GetLastError()) from the same thread which has called the function that failed before.
    I can't use the user interface execution because some functions need a long execution time and i don't want to balk the user interface.
    All other executions than the user interface execution have more than one thread and in most cases the DLL function calls were executed from different threads - so the error handling doesn't work...
    Any idea?
    Thanks for your help!

    Hmmm....
    How about wrapping all of your dll calls in a single VI (or an Action Engine ) and make sure the VI's thread is NOT set for "Same as caller".
    "Threadconfig.vi" (sp?) will also let you dictate the number of threads associated with an execution system. Set your target thread for "1".
    Not sure on the above.
    Please correct me if this is wrong!
    Ben
    Message Edited by Ben on 07-19-2007 08:26 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Stopping a Thread in Infinite Loop

    I've read several articles on how to stop Threads, and all of them point to using Thread.interrupt(). The problem right now is what happens when the thread is in an infinite loop. For example:
    class A implements Runnable
        public void run()
            while(!Thread.currentThread().isInterrupted())
                  while(true);
    //in other class's main method:
    Thread a = new Thread(new A());
    a.start();
    a.interrupt();The a.interrupt() call only sets the isInterrupted flag in Thread, but it does not terminate the thread as a.stop() would. However, stop() throws a ThreadDeath exception that I would not want to have to deal with. Is there any way to stop this infinite loop thread safely?
    Thanks in advance!

    No need to get snitty. You certainly did not make clear that you are not a newbie at programming. Plenty of newbies who barely have a grasp of the language fundamentals post thread questions here. I thought I did address the question at hand. It seems I misunderstood what you were asking.
    The only way to safely stop that inner loop is like so: while (...) {
       while (!done) {
    }where done is volatile, or all access to it is sychronized on the same lock (meaning you'd sync the !done check above as well).
    If you can't do that, and it's stuck at while (true) and you can't modify the body of the inner loop to check done, then you're SOL.
    (I suppose it's conceivable that 1.6 or 6.0 or whatever it's called will introduce some new safe way to stop that thread, but I haven't heard anything about it.)

  • The FM "DD_DOMA_GET" not released for 'remote' calls.

    Hi,
    When I try to import RFCs from my CRM system in XI, I am getting the following exception:
    com.sap.aii.ibrep.sbeans.upload.RemoteUploadException: The function module "DD_DOMA_GET" not released for 'remote' calls.
    Solution please!!
    Regards,
    Mahesh.

    Hi,
      Making remote enabled will solve this,
    see my reply(Anirban) and jacob's reply in this thread(although this was with idoc)
    Unable to import SAP objects
    For, <i>We tried to make it Remote Enabled but it asks for "Access Key". How to go further?
    </i>
    You need a devloper access key for FM, in SE37
    you can get one in market place, follow this thread,
    Whats Development Key
    Regards,
    Anirban.

  • Client (Solaris) remote call hangs 225sec if Server (Window7) is down.

    We are noticing the RMI Client remote call from Solaris machine hang of exactly 225 seconds if RMI Server on Windows7 machine is shutdown. RMI Server is shutdown for valid reasons. The expectation is, Client would throw a RemoteException immediately for futher processing. The Client hang for 225 minutes is causing performance issues. This has been consistently reproduced across multiple machines with Client on Solaris and Server on Windows 7. There are no 225 sec wait issues if server is on Windows XP or Solaris.
    Usecase (java version "1.6.0_14")
    1. Start RMI Server on Windows 7 machine
    2. Start RMI Client on Solaris machine
    3. Wait till client connects to the server and makes some remote call every 1sec.
    4. Shutdown RMI Server.
    5. Client waits 225 seconds before a time out error is thrown.
    Has anyone seen this problem? Any solutions to get around this?
    Code used to test this
    RmiTestServer.java
    public class RmiTestServer
    public static void main(String args[])
    try
    java.rmi.registry.Registry zRegistry = null;
    try
    zRegistry = java.rmi.registry.LocateRegistry.createRegistry ( 1099 );
    catch ( Exception zEx )
    zRegistry = java.rmi.registry.LocateRegistry.getRegistry ( 1099 );
    if ( zRegistry != null )
    System.out.println( "Binding RmiTestService..." );
    RmiTest c = new RmiTestImpl();
    zRegistry.rebind ( "RmiTestService", c );
    System.out.println( "Done Binding RmiTestService..." );
    else
    System.out.println( "Registry is null." );
    catch (Exception e)
    e.printStackTrace();
    RmiTest.java
    public interface RmiTest extends java.rmi.Remote
    public void callHello() throws java.rmi.RemoteException;
    RmiTestImpl.java
    public class RmiTestImpl extends java.rmi.server.UnicastRemoteObject
    implements RmiTest
    public RmiTestImpl() throws java.rmi.RemoteException
    super();
    public void callHello() throws java.rmi.RemoteException
    System.out.println ("Hello World!!!");
    RmiTestClient
    public class RmiTestClient
    public static void main(String[] args)
    System.out.println ("Connecting to: " + args[0] + " Port 1099" );
    long lTime = System.currentTimeMillis();
    try
    RmiTest c = null;
    java.rmi.registry.Registry registry = java.rmi.registry.LocateRegistry.getRegistry ( args[0], 1099 );
    if ( registry!=null )
    System.out.println ("Start lookup... " );
    c = (RmiTest)registry.lookup ( "RmiTestService" );
    System.out.println( "Lookup Done - " + (System.currentTimeMillis() - lTime)/1000 + "sec\n" );
    while( true )
    lTime = System.currentTimeMillis();
    System.out.println( "Calling Server..." );
    c.callHello();
    System.out.println( "Done Calling Server - " + (System.currentTimeMillis() - lTime)/1000 + "sec\n" );
    lTime = System.currentTimeMillis();
    Thread.sleep(1000);
    catch (Exception e)
    System.out.println( "Time for Exception - " + (System.currentTimeMillis() - lTime)/1000 + "sec\n" );
    e.printStackTrace();
    Output
    Calling Server...
    Jun 9, 2011 10:59:19 PM sun.rmi.transport.tcp.TCPChannel newConnection
    FINE: main: reuse connection
    Jun 9, 2011 10:59:19 PM sun.rmi.transport.tcp.TCPChannel free
    FINE: main: reuse connection
    Done Calling Server - 0sec
    Calling Server...
    Jun 9, 2011 10:59:20 PM sun.rmi.transport.tcp.TCPChannel newConnection
    FINE: main: reuse connection
    Jun 9, 2011 10:59:20 PM sun.rmi.transport.tcp.TCPChannel free
    FINE: main: reuse connection
    Done Calling Server - 0sec
    Calling Server...
    Jun 9, 2011 10:59:21 PM sun.rmi.transport.tcp.TCPConnection isDead --------------->RMI Server Shutdown
    FINER: main: exception:
    java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:168)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
    at sun.rmi.transport.tcp.TCPConnection.isDead(TCPConnection.java:174)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:173)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
    at RmiTestImpl_Stub.callHello(Unknown Source)
    at RmiTestClient.main(RmiTestClient.java:23)
    Jun 9, 2011 10:59:21 PM sun.rmi.transport.tcp.TCPConnection isDead
    FINE: main: server ping failed
    Jun 9, 2011 10:59:21 PM sun.rmi.transport.tcp.TCPChannel free
    FINE: main: close connection
    Jun 9, 2011 10:59:21 PM sun.rmi.transport.tcp.TCPConnection close
    FINE: main: close connection
    Jun 9, 2011 10:59:21 PM sun.rmi.transport.tcp.TCPChannel createConnection
    FINE: main: create connection
    Jun 9, 2011 10:59:21 PM sun.rmi.transport.tcp.TCPEndpoint newSocket
    FINER: main: opening socket to [<IP Address>:65427]
    Jun 9, 2011 10:59:21 PM sun.rmi.transport.proxy.RMIMasterSocketFactory createSocket
    FINE: main: host: <IP Address>, port: 65427
    Jun 9, 2011 10:59:24 PM sun.rmi.transport.tcp.TCPChannel$1 run
    FINER: RMI Scheduler(0): wake up
    Jun 9, 2011 10:59:24 PM sun.rmi.transport.tcp.TCPChannel$1 run
    FINER: RMI Scheduler(0): wake up
    Jun 9, 2011 10:59:39 PM sun.rmi.transport.tcp.TCPChannel$1 run
    FINER: RMI Scheduler(0): wake up
    Jun 9, 2011 10:59:39 PM sun.rmi.transport.tcp.TCPChannel freeCachedConnections
    FINER: RMI Scheduler(0): connection timeout expired
    Jun 9, 2011 10:59:39 PM sun.rmi.transport.tcp.TCPConnection close
    FINE: RMI Scheduler(0): close connection
    Time for Exception - 224sec
    java.rmi.ConnectException: Connection refused to host: <IP Address>; nested exception is:
    java.net.ConnectException: Connection timed out
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
    at RmiTestImpl_Stub.callHello(Unknown Source)
    at RmiTestClient.main(RmiTestClient.java:23)
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
    ... 5 more

    Could you check to see if the remote database is up and running before calling the remote database procedure?

Maybe you are looking for

  • How do i get my purchases back onto my iTunes account?

    They were all deleted due to an issue with my iPod freezing. I took it in to the Apple store, and they told me EVERYTHING was deleted. Most of my music was purchased, including apps and such, so how do i get them back? It is a rip off if I am not abl

  • WRT54G V7.0 VPN and Connection

    I use the Cisco VPN Client 4.8.01.0590 it was working fine with my old Sweex wireless router. Now i am working with the linksys WRT54G v7.0 and connection to the remote netwerk with VPN client is no problem. After 5 minutes working with it my connect

  • I have a macbook pro 10.6.8. My question is, is there a way to bypass the startup items (programs) when booting the computer?

    I perform music with my Macbook pro.  so I have several music applications that startup automatically when the computer boots. they look for the audio interface that they are supposed to talk to and then everything is good.  but sometimes I boot my c

  • Hangman game - logic problem

    Hello, im trying to make it so that when an incorrect letter is chosen (arrayToPass does not contain string) the picture of the hangman is drawn. I want count to go up to the number of incorrect attempts so that the appropriate picture is shown - not

  • Hp 15 g003sm touch-pad driver for windows 7-64bit

    Hi all, Well, the title says it all. I can't find it anywhere and my tuch-pad is not working properly after I installed fresh windows 7. Any ideas, please?!