Help,   rmi:multi thread client

I am developing a rmi program. Each client thread obtains the remoteObject by calling Naming.rebind().
My problem is when 20 client threads get the RemoteObject at the same time, i get the exception from naming.rebind()method.
Anyone can help me?
thanks

that is the exception i get
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
     java.io.EOFException
     at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
     at java.rmi.Naming.lookup(Naming.java:84)
     at arch.lib.CommProxyImpl.setRemoteProxy(CommProxyImpl.java:52)
     at arch.ClientThread.<init>(ClientThread.java:45)
     at arch.ClientGenerator.main(ClientGenerator.java:27)
Caused by: java.io.EOFException
     at java.io.DataInputStream.readByte(DataInputStream.java:333)
     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
     ... 6 more

Similar Messages

  • Urgent: How to : Multi-threaded Client??

    Hi,
    I have socket connection and was using single client thread untill now. But now requirements need to have multi-threaded client. Can any one pl. help me how to send messages thru' one thread and receive messages thru' another thread using same connection?? I urgently need help on this.
    thanx

    Create aclasses derived from thread for use by receiving
    Pass the socket to that class's constructor
    In the receivers thread's run method just in a while loop call read, or readObject, or whatever
    Just send in the regular thread.

  • Force a multi-threaded client to use more than one proxy.

    I have a multi-threaded client app. that I'm using to test our proxy throughput. I've run into the same problem I've seen other people run into where the client application threads all get sent via the same proxy (in my case, I have 16 proxies available and configured in the client config.)
    Now I've seen threads like this one: Re: How to dynamically connect Extend client to proxy server?
    I just wondered, has a solution appeared since that time? I guess Coherence 3.6 and 3.7 have appeared in the interim. I'm on 3.6.1.4.
    My "Coherence specific" code is all localised in each thread and nothing is shared, so I guess the behaviour I'm seeing is something to do with the way Coherence initialises it's client classes within the JVM, rather than something it defers until a cache connection is established.
    Any solutions to this problem, so I can get my multi-threaded client (where each thread opens a NamedCache connection and then establishes a CQC against it) to use all (or at least more) of the available 16 proxies?
    Cheers,
    Steve

    I have a multi-threaded client app. that I'm using to test our proxy throughput. I've run into the same problem I've seen other people run into where the client application threads all get sent via the same proxy (in my case, I have 16 proxies available and configured in the client config.)
    Now I've seen threads like this one: Re: How to dynamically connect Extend client to proxy server?
    I just wondered, has a solution appeared since that time? I guess Coherence 3.6 and 3.7 have appeared in the interim. I'm on 3.6.1.4.
    My "Coherence specific" code is all localised in each thread and nothing is shared, so I guess the behaviour I'm seeing is something to do with the way Coherence initialises it's client classes within the JVM, rather than something it defers until a cache connection is established.
    Any solutions to this problem, so I can get my multi-threaded client (where each thread opens a NamedCache connection and then establishes a CQC against it) to use all (or at least more) of the available 16 proxies?
    Cheers,
    Steve

  • Highlight text not working in multi-thread client-server application plug-in

    I'm developing a plugin application for my dissertation research on multi-application environment. I have an application server that communicate with the PDF document via plugin.
    The plugin acts as both client and server, depending on the situation.
    - Plugin as Server
             I have a multi-threaded winsock2 IOCP running to catch client connections and when a client connected, get the data from the client (set of words), and highlight these words in the pdf document.
    - Plugin as client
               I use 2 procedures, one to collect all the text from PDF and send to the server using tcp win-socket connection and another to collect data from highlight tool and send these text. both these are not threaded.
    Here's my question, because I want to listen to multiple client connections, when the plugin is the server, I'm running this procedure in a thread and then wait for clients to connect and use IOCP to serve the client connections.  When the client is connected I use the data coming from client to highlight some text in the PDF document. All of these functionalities are already implemented, but when I receive data from client and try to highlight text in the PDF document my application freezes up and stop working. I think this is something to do with the thread. I'm using _beginthreadex to start the server and then another _beginthreadex inside the IOCP worker thread.
    I can post the code, but before that let me know if you can see any problem in this situation. What I see from other posts is that acrobat is not multi-threaded.

    Thanks a lot for the reply.
    I guess I probably need some sort of a notification when the data is received and do a callback to the main thread to run the acrobat API. Is there anyway I can create custom notifications? Something like this,
    AVAppRegisterNotification(AVDocDidOpenNSEL, gExtensionID, ASCallbackCreateNotification( AVDocDidOpen, (void *)DocIsOpenedCallback), NULL);
    or should I use a custom action listener?

  • TPEPERM on multi thread clients

    Good day experts!
    We have a problem with our client experiencing TPEPERM when they multi thread on their side. Both our passwords are the same
    Could this be a version issue
    Our version of tuxedo is 6.5
    Greatly appreciate your help

    Multithreading is supported in Tuxedo only for release 7.1 and later. (I recall that we did implement a limited version of client thread support in Tuxedo 6.5 for some platforms that required setting an environment variable and may have required getting special binaries from BEA, but this is no longer supported.)
    However, if you make Tuxedo calls from only one thread in your program and have other threads that do not access Tuxedo, then it is OK to use multiple threads in Tuxedo 6.5.
    You will need to upgrade to a later version of Tuxedo if you want to access Tuxedo from more than one thread within a process.
    Ed

  • Multi-threaded clients in 6.5

    Can a Tuxedo client asynchronously tpcall() services from independent threads?

    There is a special version of TUXEDO 6.5, called the Client Threads
    Supplement, that allows native client threads to tpinit in different
    contexts (as in Tux 7.1), and do parallel ATMI calls. This version runs
    on Solaris and NT. You can read a more thorough description, and
    download the package at http://commerce.bea.com/downloads/tuxedo.jsp
    (way down at the bottom of the page).
         Scott Orshan
         BEA Systems
    "\"David Bliss\" db-public.AT.home.dot.com" wrote:
    >
    Can a Tuxedo client asynchronously tpcall() services from independent threads?

  • Help! Multi-Thread in Java Swing!

    Hi,
    I have a java swing application. The basic logic for the application is, I will input some data and click the "Process" Button.
    The application will perform some operation. Currently I can perform one operation at a time.
    I have to extend the scope of this application to multiple process at the same time.
    like, I will add a table in the application. Whenever I give input and press the "Process" button, the process should be added in the table at the same time I should be able to input and initiate the next operation.
    I am not very much experienced in java swing.
    Is it possible to do in swing? Can somebody give me some input on this?
    Thanks,
    Raja.

    Check out SwingWorker http://docs.oracle.com/javase/7/docs/api/javax/swing/SwingWorker.html

  • Help with multi-thread bash script

    Hi,
    I would like to simultaneously copy photo files from a memory card (in a card reader) both to internal HDD and external USB HDD, using rsync, in a *single* run (instead of running 2 rsync processes and read the same large data twice).
    It's a single core (ATOM 450) netbook, and I'm looking to minimize time and power consumption (netbook will work on internal battery during trip).
    Can anybody offer me a solution?
    Thanks

    mibadt wrote:
    Hi,
    I would like to simultaneously copy photo files from a memory card (in a card reader) both to internal HDD and external USB HDD, using rsync, in a *single* run (instead of running 2 rsync processes and read the same large data twice).
    It's a single core (ATOM 450) netbook, and I'm looking to minimize time and power consumption (netbook will work on internal battery during trip).
    Can anybody offer me a solution?
    Thanks
    Hi mibadt,
    AFAIK this is impossible. Rsync generates the deltas between the source(s) and the destination. You have two different destinations to sync to, and want rsync to somehow create a single set of deltas so that it can write it out to the two different destinations!
    What you really want to do is just copy the same files from A to B and C, in one process. Creative uses of the tee command (as briest suggested) seems to be the right trick here.
    http://en.wikipedia.org/wiki/Tee_(command)
    http://www.google.com/search?q=linux+co … stinations

  • RMI and Threading: Urgent, pls help!

    Hi everyone,
    I read the previous topics in multithreading but i'm still confused about how RMI works in this case.
    I have a client server application with RMI where client runs some time-consuming executables on the server.
    (i use Process proc = Runtime.getRuntime().exec(cmd...)...)
    Basically I want to make sure that simultaneous requests from different clients execute concurrently, instead of waiting for each other to finish. So my questions are:
    1) When mutiple clients are making remote calls, does RMI map each client request to separate thread and execute them simultaneously (if yes, does it have some limit on number of threads that can be created?);
    Or will I have to take care of creating threads on the server side for each request myself? if the later is the case, how could I go about doing that?
    2) What if all (or some of) the clients are connected from the same VM? How can I ensure that they get executed in different threads, concurrently. Could you pls direct me to ways of implementing it.
    any help is greatly appreciated,
    yulduz

    1) When mutiple clients are making remote calls, does RMI map each client request to separate
    thread and execute them simultaneously (if yes, does it have some limit on number of threads
    that can be created?); Yes, RMI takes care of launching a thread on each remote call. It actually maintains a pool of threads from which, a free thread is assigned a new request. From then on, you have different threads running in server VM (one per each client call).
    Or will I have to take care of creating threads on the server side for each request myself? if the
    later is the case, how could I go about doing that?No, you dont have to create any thread just for the purpose of handling a remote call.
    2) What if all (or some of) the clients are connected from the same VM? How can I ensure that
    they get executed in different threads, concurrently. Could you pls direct me to ways of
    implementing it.You dont have to do anything extra for achieving this. It doesnt matter whether you are running clients in the same VM or different VMs. If you want concurrency on the client side, you have to make remote calls from different threads. The following code outlines the difference between concurrency and non-concurrency in client VM (and NOT server VM).
    class CallerThread extends Thread {
         public void run() {
              remoteRef.callMethod();
    public class Client {
        ... main() {
            // these are not concurrent in client VM bcos the second call happens only after first one       returns
            remoteRef.callMethod1();        
            remoteRef.callMethod2();
            CallerThread t1, t2;
            // these two calls are concurrent on the client side as they're called from two different threads
            t1.start();        
            t2.start();
    }regds,
    CA

  • Using multi-thread in RMI

    i know how to do a simple RMI program, but now i want to have a multi-threaded server to support the client. could any one tell me how to do this (using Thread in RMI) ??
    thx.
    Mo

    Well, you kind of answered your own question.
    An RMI server is inherently multi-threaded. This means that each remote request from a client is a separate thread, and can execute simultaneously with requests from other clients. In fact, your biggest problem will probably be to identify the places where access to objects must be synchronized, so that simultaneous requests do not conflict.
    So what is it you have to do that RMI doesn't do?

  • Memory leaks and multi threading issues in managed client.

    In our company we use a lot of Oracle, and after the release of the managed provider we migrated all applications to it. First the  things were very impressive : the new client was faster, but after some days applications that uses 100MB with old client goes to 1GB and up. The memory is not the only issue, we use a lot of multi threading, and we experience connection drops and not disposal, after 1 days working one of the application had over 100 sessions on the server. I think there is something wrong with connection pool and multi threading.
    Is someone experience same problems.
    Yesterday we went back with unmanaged provider. Now things are back to normal.

    connection drops: did you try to use "Validate Connection=true" parameter in your connection string?
    the new client was faster: are you sure with this statement? Even in 64bit environment? I got quite serious performance problems when running application under 64bit process: https://forums.oracle.com/thread/2595323

  • Does RMI supports multi threading?

    Hi, Does RMI supports Multi threading or not? What is the disadvantage of RMI and why EJB came?
    Thanks in advance
    By
    vinod

    (a) yes
    (b) firewall penetration is its biggest problem
    (c) EJB is built over RMI, don't get the wrong idea about that. It's a large topic - search as recommended, especially for the Sun White Papers

  • Help with understanding multi-threaded code

    Hi Everyone,
    I am currently reading a book on multi-threading and up until recently I have been able to understand what is going on. The thing is the complexity of the code has just jumped up about two gears without warning. The code is now using inner classes which I am trying to develop an understanding of but I am not finding it easy going, and the book has been lite on explanations. If anybody can help with the following code it will be really appreciated.
    public class SetPriority extends Object
         private static Runnable makeRunnable()
              Runnable r = new Runnable()
                   public void run()
                        for(int i=0; i<5; i++)
                             Thread t = Thread.currentThread();
                             System.out.println("in run() - priority=" + t.getPriority() +
                                          ", name=" + t.getName());
                             try{
                                  Thread.sleep(2000);
                             }catch(InterruptedException x){
                                  //ignore
              return r;
         public static void main(String[] args)
              Thread threadA = new Thread(makeRunnable(), "threadA");
              threadA.setPriority(8);
              threadA.start();
              Thread threadB = new Thread(makeRunnable(), "threadB");
              threadB.setPriority(2);
              threadB.start();
              Runnable r = new Runnable()
                   public void run()
                        Thread threadC = new Thread(makeRunnable(), "threadC");
                        threadC.start();
              Thread threadD = new Thread(r, "threadD");
              threadD.setPriority(7);
              threadD.start();
              try{
                   Thread.sleep(3000);
              }catch(InterruptedException x){
                   //ignore
              threadA.setPriority(3);
              System.out.println("in main() - threadA.getPriority()=" + threadA.getPriority());
    }My greatest challenge is understanding how the makeRunnable() method works. I don't understand how this inner class can be declared static and then multiple "instances" created from it. I know that I have no idea what is going on, please help!!!
    Thanks for your time.
    Regards
    Davo
    P.S.: If you know of any really good references on inner classes, particularly URL resources, please let me know. Thanks again.

    Yikes!! The good news is that you're unlikely to see such convoluted code in real life. But here we go.
    "private static Runnable makeRunnable()" declares a method that returns objects of type Runnable. The fact that the method is declared "static" is pretty irrelevant - I'll describe what that means later.
    The body of the method creates and returns an object of type Runnable. Not much special about it, except that you can give such an object to the constructor of class Thread and as a result the run() method of this Runnable object will be called on a new thread of execution (think - in parallel).
    Now the way it creates this Runnable object is by using the "anonymous inner class" syntax. In effect the method is doing the same as
    public class MyNewClass implements Runnable {
        public void run() {
            // All the same code inside run()
    public class SetPriority {
        private static Runnable makeRunnable() {
            Runnable r = new MyNewClass();
            return r;
        // The rest of the original code
    }Except you don't bother declaring MyNewClass. You're not interested in defining any new method signatures. You just want to create an object that implements Runnable and has certain instructions that you want inside the run() method. Think of the whole approach as shorthand.
    Think about this for a while. In the mean time I'll write up the "static".

  • HELP!....GUI crashes when i call a multi-threaded program from it

    Hi..I have encountered a problem in my end of year project, which i cant see to solve. The problem is i am starting a multi-threaded program for a JButton on a GUI. All though this starts the other program it crashes the GUI completely how do i stop this.
    this is the code i use to call the threaded program.
    public void actionPerformed(ActionEvent e)
    Object target=e.getSource();
    String line = new String();
    if( target==b1 )
         try
    cl = new client();
         cl.startup();
         catch(Exception ex){ex.printStackTrace();}
    thanks Mike

    No there is no exceptions being given. this is one of the reasons why i dont no what to do. i thought myself that the threaded was taking all the resources and not going back to the GUI. if this is the case is there anyway that i can call back the GUI and keep the threaded program running?
    thanks
    mike.

  • Helpful hint while multi-threading

    Hi all
    This had me stupmed for a little while. A multi-threaded program I'd been working didn't appear to be working correctly. I noticed this was because it looked like the thread never made it to its run() method. The cause of this was the fact id overridden the start() method of the thread without including this.run() at the end. The symptoms of this happening aren't obvious though, and it can be quite puzzling. I hope this gets added to any FAQs etc, or solves someones problem.

    And if, for whatever reason, you do need to override start(), you should not call this.run() at the end, you should call super.start() !!!
    If you call this.run() at the end, you are having the current thread go and do the run method.

Maybe you are looking for

  • Unit of measure

    Hi I want to procure same material from same vendor for different plants with different unit of measure.I tried maintaining different unit of measure in inforecord but it is not posible... How to maintian differnet unit of measure with plant level fo

  • Table CRMPARNR overwritten during CRM to R3 replication

    Good Morning, Can anyone advise on why when we update main contact in CRM the replication over writes the entry in CRMPARNR table in R3, therefore breaking the connection between R3 and CRM main contact? I can't see why this is occurring, it appears

  • Good book  on multithreading

    Could any one please give me suggestion on good book on multi threading with good theory. I have basic idea on Multithreading, so i would like to improve myseld on the same. Its better to give the name of the book and what the special in them., I wou

  • New Web Services Connector for JMX available

    A new Early Access (EA3) of the Connector is out. It implements the JSR 262 Public Review Specification (http://jcp.org/aboutJava/communityprocess/pr/jsr262/index.html). You can download the RI auto-extractible jar file from http://ws-jmx-connector.d

  • When to get a new iMac

    I've been waiting for a number of months to get a new iMac. Optimally, I wanted to save the most money by waiting for the latest model, plus getting iLife '08 and Mac OS 10.5 Leopard. However, I'm caught in a small bind. Since I do development work,