Help Please!!!!!  RMI and Threads

My server has 10 threads doing constant polling of network equipment through use of SNMP. I have a servlet that connects to my server and retrieves collected information by using RMI and displays it in the browser window. Browser refreshes the information very often. So, there is a constant flow of RMI traffic between the server and the servlet.
Here is the problem:
There are times when my server stops responding to RMI requests issued by the servlet. All 10 threads that are doing SNMP polling stop being scheduled by the JVM. They block! This picular situation occurs with the server only during RMI requests coming from servlet. It doesn't always happen though. Also, I've noticed that if RMI load is high this problem emerges again.
I get no RMI exceptions.
I am using Apache and Jserv.
All of my attempts to understand and fix the problem have been futile so far. Could a heavy RMI load between my server and servlet be causing my threads to block? Should I decrease my RMI traffic?

You have the same problem I had. You need to set the timeout .. so once the timeout is exceeded, an exception is thrown. You need to create a custom RMISocketFactory ... trust me, its easier than it sounds ..check the answers to my post at:
http://forums.java.sun.com/thread.jsp?forum=58&thread=167287
hope that helps.

Similar Messages

  • Help please, combining AND filters with OR filters

    I have this application I am working on: http://webbymgc.com/tomato/
    It's working fairly well EXCEPT, and this is a big except: selectors WITHIN each fieldset should be "or" but BETWEEN fieldsets as "and"
    In other words, clicking "red" and "yellow" in "color" should get you both kinds of tomatoes.  This is how I set it up.
    Now, if you check "class" = "heirloom" is adds all the ones that match that term, so you get more tomatoes.  I would like "heirloom" to be an "AND" so the user would get yellow or red heirloom tomatoes.
    Make sense? 

    mr kglad i really hope my ( too many replies and questions ) don't bother you.. but please excuse me if they sound foolish or something im a beginner as mentioned...
    There must be something wrong with whatever im doing ... ( im so desperate and since you are the only one who replied on me i really need your help please.. )
    1- i published the first fla as a swf (10.3 ) with a button with the code you've given me )
    2- i published the second fla as a swf (10.3) with another button with the same code you've given me )
    3- i made a main page where there are two buttons.. one for english and one for foreign language
      English button with this code :
    Engbutton.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_4);
    import fl.display.ProLoader;
    var fl_ProLoader_4:ProLoader;
    //This variable keeps track of whether you want to load or unload the SWF
    var fl_ToLoad_4:Boolean = true;
    function fl_ClickToLoadUnloadSWF_4(event:MouseEvent):void
        if(fl_ToLoad_4)
            fl_ProLoader_4 = new ProLoader();
            fl_ProLoader_4.load(new URLRequest("englishformFIN.swf"));
            addChild(fl_ProLoader_4);
        else
            fl_ProLoader_4.unload();
            removeChild(fl_ProLoader_4);
            fl_ProLoader_4 = null;
        // Toggle whether you want to load or unload the SWF
        fl_ToLoad_4 = !fl_ToLoad_4;
    and the other button with the same code ( the second fla )
    IT DOESNT WORK WHEN I TEST THE MOVIE.. the return buttons nor the main ones..why why why why why... ???
    i really need your help
    THANK YOU in advance

  • Query quote help-Please ignore this thread

    Dear all,
    Please ignore this thread.
    Thanks for understanding
    Kai
    Edited by: KaiS on Nov 12, 2009 9:33 AM

    try
    and A.subno =''' || subno || ''' ;' from usr_inf where rownum <300;
    those are two single quotes ('), not double quotes.

  • RMI and Threads: Calling wait() on a remote object

    I created a counter as a remote object.
    Multiple clients are displaying the counter value.
    If one of the clients increments the counter, I want the displayed counter value on every client to be updated to the new value (of the counter on the server).
    Therefore every client starts a new thread to "listen" for changes of the countervalue. I wanted to call the wait() method on the remote object (the remote counter). But i think it will be called on the stub instead of on the actual remote object.
    Therefore i created a extra method waitForChange() on the remote object.
    public void waitForChange() throws RemoteException, InterruptedException {
         synchronized(this) {
              wait();
    This method only calls the wait() method. Now I'm sure it's called on the remote object and not on the stub.
    This works, but my question is: is there a better way to do this?
    Code:
    ==========================================
    The remote interface
    ==========================================
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface RemoteCounter extends Remote {
         void incrementCounter() throws RemoteException;
         int getCounterValue() throws RemoteException;
         void waitForChange() throws RemoteException, InterruptedException;
    } ==========================================
    The implementation of the remote interface
    ==========================================
    import java.rmi.*;
    import java.rmi.activation.*;
    import RemoteCounter;
    public class RemoteCounterImpl extends Activatable
         implements RemoteCounter {
         private static final long serialVersionUID = 1L;
         private int counter = 0;
         protected RemoteCounterImpl(ActivationID id, MarshalledObject data) throws RemoteException {
              super(id, 0);
         public void incrementCounter() throws RemoteException {
              synchronized(this) {
                   counter++;
                   notifyAll(); //Inform all clients of the new countervalue;
         public void waitForChange() throws RemoteException, InterruptedException {
              synchronized(this) {
                   wait();
         public int getCounterValue() throws RemoteException {
              return counter;
    }==========================================
    A piece of code registering the remote object
    ==========================================
    ActivationDesc desc = new ActivationDesc(agi, "RemoteCounterImpl", codebase, data);
    //Register with rmid
    RemoteCounter counter = (RemoteCounter)Activatable.register(desc);
    // Bind the stub to a name in the registry running on 1099
    Naming.bind("Counter", counter);==========================================
    The panel containing a button, a label
    which starts a new thread listening for
    counter value changes
    ==========================================
    import javax.swing.*;
    import java.awt.Dimension;
    import java.awt.event.*;
    import java.rmi.*;
    import org.personal.exam.services.RemoteCounter;
    public class PanelCounter extends JPanel {
         private static final long serialVersionUID = 1L;
         JLabel labelX = new JLabel("Press testbutton");
         Thread t;
         RemoteCounter remoteCounter;
         public PanelCounter()     {
              try {
                   jbInit();
              } catch(Exception e) {
                   e.printStackTrace();
         private void jbInit() throws Exception
              this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
              this.setPreferredSize(new Dimension(450,300));
              // The securityManager is required to make is possible
              // to download classes from the server
              if (System.getSecurityManager() == null) {
                   System.setSecurityManager(new RMISecurityManager());
              //Create a testButton to increment the counter          
              JButton testButton = new JButton("Increment");
              testButton.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent arg0) {
                        incrementCounter();
              this.add(testButton);
              //Add a label to display the counter value
              this.add(labelX);
              // Create thread to listen for counter value changes
              try {
                   remoteCounter = (RemoteCounter)Naming.lookup("Counter");
                   CounterValueChecker cvl = new CounterValueChecker(labelX, remoteCounter);
                   //Start a thread to listen for changes of the countervalue
                 t = new Thread(cvl);
                 t.start();
              } catch(Exception e) {
                   e.printStackTrace();
              this.setVisible(true);
         private void incrementCounter() {
              String message = "error";
              try {
                   remoteCounter.incrementCounter();
                   message = "Current value is " + remoteCounter.getCounterValue();
              } catch(Exception e) {
                   System.out.println("Test Exception: " + e.getMessage());
                   e.printStackTrace();
              labelX.setText(message);
    }==========================================
    The runnable implementation used by the
    thread to wait for counterchanges
    ==========================================
    import java.rmi.RemoteException;
    import javax.swing.JLabel;
    import org.apache.log4j.Logger;
    import RemoteCounter;
    public class CounterValueChecker implements Runnable {
         private JLabel counterLabel;
         private RemoteCounter remoteCounter;
         public boolean keepChecking= true;
         private Logger logger = Logger.getLogger(this.getClass());
         public CounterValueChecker(JLabel counterLabel, RemoteCounter remoteCounter){
              this.counterLabel = counterLabel;
              this.remoteCounter = remoteCounter;
         public void run() {
              while(keepChecking) {
                   int newVal = -1;
                   synchronized(remoteCounter) {
                        try {
                             //remoteCounter.wait();
    //this does not work. I think because the wait() method is called on the
    //stub instead of on the actual remote object
                             remoteCounter.waitForChange();
                        } catch (InterruptedException e) {
                             keepChecking = false;
                             break;
                        } catch (RemoteException re) {
                             re.printStackTrace();
                        try {
                             newVal = remoteCounter.getCounterValue();
                        } catch (RemoteException re) {
                             re.printStackTrace();
                        counterLabel.setText("New value: " + newVal);
    }This is just a little test. Actually I want to notify clients of changes in data displayed in a Table. If one client saves one record of the data, i want the new record to be displayed immediatly on all clients that are viewing the same data.

    I've been doing some reading about RMI and callback.
    As I understand it, there's a remote object is running on the client now as wel. And the server makes a call to the client.
    But now the server makes a call to one client.
    And the point is, I want all clients to be updated with the new value.
    Does this mean, I have to keep a list with references to all clients connected to the server?
    I my code the notifyAll() method causes all waiting Threads (running on several clients) to wake up and do something (getting the new counter value).

  • 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

  • If anyone could Help Please, Variables And just how they work

    I think I may have taken on a bit more than i can handle with this project.
    I have been asked to create a "Picture in Picture" situation, What i am wanting is to have the background of the File Static with the food menu consistently rolling over coming from a .txt file so it is easy to change the wording and prices, while having adds (up to 50) running on the other half of the screen cutting in and out of Bloopers. I have seen in done once before and was told it was all done in flash, can anyone please help me out, even a tutorial would be great, I have tried the Variable text to no avail, does this need a starting code??
    Thanks Heaps in Advance

    OK, so i use loadvars("menu.txt","C:\\Documents and Settings\\Owner\\My Documents\\Spot 81"); in the Flash file and what do is use for the txt file? for name1 would i use &name1=Soup Of The Day??  ALso fo you know whatis the best code to call a picture in? Thanks

  • Conservation-help please webdesigners and other help needed

    are you interested in world conservation issues? Would you like to be part
    of a team developing a website that may change the way people act towards
    conservation and may indeed change the future of conservation volunteering
    itself. [email protected] if you are interested a mission plan can be
    obtained from the above address we will see were things go from there. This
    is not a wind up in any way this is -planned to be both a serious tool in
    terms of science and in terms of conersvtaion help mostly in the uk but also
    abroad, the site will have a broad span of features. I need skilled web
    designers and others who can help me market the idea, also once the site is
    set up the way the site works will require a few trusted overseers, it must
    be stressed that the site is none profit making in intent possible small
    amounts may be paid for its construction but these will not be large. Anyone
    interested in helping in the construction of this website will be rewarded
    but further down the line and through simplwe satisfaction of seeing a
    useful and well thought out idea coming to life at their own hands. please
    reply to the sender address or [email protected] please if yopu have any
    inclination do reply we need you as they say , if no one volunteers this
    project wont getr carried out, any help will be greatfully accepted if you
    give me 1hr or 2 of your time i will be very greatful indeed. The website
    being constructed is only in web format because it makes it easy to access
    and it is the easiest medium in which to get setup quickly advertising is
    likely to follow in other mediums and over time the scope of the website as
    explained in the brief which I will send you if you are interested will
    increase and hopefully the good work which comes from that will increase
    also. Thank you for your time
    andrew cuthbert

    are you interested in world conservation issues? Would you like to be part
    of a team developing a website that may change the way people act towards
    conservation and may indeed change the future of conservation volunteering
    itself. [email protected] if you are interested a mission plan can be
    obtained from the above address we will see were things go from there. This
    is not a wind up in any way this is -planned to be both a serious tool in
    terms of science and in terms of conersvtaion help mostly in the uk but also
    abroad, the site will have a broad span of features. I need skilled web
    designers and others who can help me market the idea, also once the site is
    set up the way the site works will require a few trusted overseers, it must
    be stressed that the site is none profit making in intent possible small
    amounts may be paid for its construction but these will not be large. Anyone
    interested in helping in the construction of this website will be rewarded
    but further down the line and through simplwe satisfaction of seeing a
    useful and well thought out idea coming to life at their own hands. please
    reply to the sender address or [email protected] please if yopu have any
    inclination do reply we need you as they say , if no one volunteers this
    project wont getr carried out, any help will be greatfully accepted if you
    give me 1hr or 2 of your time i will be very greatful indeed. The website
    being constructed is only in web format because it makes it easy to access
    and it is the easiest medium in which to get setup quickly advertising is
    likely to follow in other mediums and over time the scope of the website as
    explained in the brief which I will send you if you are interested will
    increase and hopefully the good work which comes from that will increase
    also. Thank you for your time
    andrew cuthbert

  • Etude Ringtone HELP - Please see and Reply

    I was a proud owner of a Nokia 6230 and now I upgraded to a 6230i.
    Guess what the Etude ringtone that was extremely helpful as an ALARM Tone is no longer there. Any help from where i can get it?
    I am not hearing the new alarm resulting in going late to work and risking my job
    Don't let this happen !!!! Please Please
    HELP !!

    I am having the same problem too would like to find out how to fix it ?
    Cheers.

  • Help please gbytes and skype

    Hi there. Please can anyone help me. I'm going to b sky ping on my iPhone for 1 hour 7 days a week and 1 evening an hour, Does anyone know roughly even how many gbytes thus would use up as trying to work out what monthly plan to grand no clue about data usage. Kind regards

    Hi and welcome to the Skype Community,
    It really depends on whether you use audio or video calling, how many contacts you have, how much chatting you perform. Some upper and lower limits are:
    If you are signed in to Skype but not making any calls, Skype will use on average 0-4kbps. When you make a call, Skype will use on average between 24-128kbps.
    https://support.skype.com/en/faq/FA1417/how-much-bandwidth-does-skype-need
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Begginer needs help please lads and ladettes

    Hi there two things really..... I have a small video booth company in ireland and use prem ele 7 to edit clips for final dvd, normally 120 clips ranging from 15 secs - 45 secs Do i have to drop and drag transitions one at a time or can I drop bulk transitions in for all clips???????
    Also I am editing a scotish/irish weddding at the moment and yup someone lifts there kilt and reveals his manhood aI want to keep clip but wandering if its possible to blur or cover it up????????
    Would really appreciate your thoughts
    Many thanks

    No and yes, Brandon.
    In version 8, Adobe added the ability to add transitions to several clips at once. In version 7, you still have to drop them onto clips one at a time.
    The best way to blur a face (or whatever) is to use the Track Matte. I cover it in my new book, "Cool Tricks & Hot Tips for Adobe Premiere Elements." In fact, the sample chapter I posted to this page includes the how-to for using the Track Matte! If you like it, please think about picking up a copy of the whole book!
    http://Muvipix.com/CoolTricks
    You can also learn a lot about the program with my free Basic Training for Premiere Elements tutorials, also available on Premiere Elements support site http://Muvipix.com (along with hundred of other tips, tutorials, custom-created DVD menus, motion backgrounds and royalty-free music and stock footage clips). We also publish a number of books that are available on Amazon.com and at the Muvipix store.

  • Help please: URLConnection and timeout

    I want to connect to a Internet URL and retrieve the HTML code, but I have error message: "Operation timed out: connect"
    How I can resolve this?
    Thanks.
    <%
    try {
    URL theUrl = new URL("http://www.yahoo.com");
    URLConnection uc = theUrl.openConnection();
    InputStream content = uc.getInputStream();
    BufferedInputStream in = new BufferedInputStream (content);
    LineNumberReader lnr = new LineNumberReader (new InputStreamReader(in));
    String tempStr = "";
    StringBuffer str = new StringBuffer();
    while ((tempStr = lnr.readLine()) != null)
    str.append(tempStr);
    out.println(tempStr);
    in.close();
    lnr.close();
    catch(Exception e) { out.println("Error:"+e.getMessage()); }
    %>

    I was getting the same error while connecting through a proxy.
    The following lines fixed the problem:
    System.setProperty("http.proxyHost", "[your proxy's IP]");
    System.setProperty("http.proxyPort", "[your proxy's port]");
    Good Luck
    matrixPooh www.bizdisplay.com

  • Help Please IMac and macbook pro Question

    I brought my daughters Imac home for my husband and I to use. We bought her a macbook pro for college.  Her laptop is saying something about not recognizing her informatin because she was using the imac. Does anyone know what I need to do to disconnect her from the Imac so her laptop will work better?

    I think you or her will have to call Apple, should be free 90 phone support on the new one.

  • HELP PLEASE:) confused and sad

    i have lost all of my music since i put my iphone onto my new laptop! where has it all gone?how can i retrieve it, cant even get the music i purchased through itunes    !
    help very much appreciated...totally gutted
    THANKS

    Your music will only be where you put it.
    If you haev a new laptop, then you need to copy everything from your old computer, or your backup copy of your old computer, to your new one.

  • Newbie Needs Help Please - VoIP and VPN

    Hello,
    I have a question about some voip/vpn configuration. I've got two sites that have 1760 routers with fxo/fxs cards that are going to be tieing the two phone systems together with a couple of voip trunks. These are secondary devices on the network with no data traffic or real LAN even, but addressed with a 2nd wan ip on the fa 0/0 port. The only traffic going through these routers is voice/voip.
    My question is about this voip setup with vpn. First off, should I or shouldn't I, or even can I? If I configure a site-to-site vpn connection, will the voip traffic pass over that? How would I set up a VPN tunnel for only the fxo/fxs cards with no "LAN" behind it? Is there a need to have a vpn? Any benefits to sending the voip data across vpn, other than the obvious encryption of the "call"?
    The thing is, I've only setup a VPN with Cisco a few couple of times, and once was from a pre-configured script I found and the other was from some software called SDM. I've only known about setting up VPN's for connecting the LAN behind router A to the LAN behind router B. This setup has NO LAN. The only interfaces are the fa 0/0 (getting static wan ip), and the fxo and fxs cards handling the voice. I have no clue on how to configure a site-to-site VPN for this, or if I even can, or if I should.
    The next two replies will have my voip configuration as it sits on the bench in testing; I have both fa 0/0 interfaces connected to the local LAN just for a connection and testing, but each will later be getting it's own static WAN IP on the fa 0/0 interfaces:

    SITE 1:
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    hostname SITE 1
    boot-start-marker
    boot-end-marker
    enable secret XXX
    no aaa new-model
    voice-card 2
    voice-card 3
    ip cef
    interface FastEthernet0/0
    ip address 192.168.254.30 255.255.255.0
    speed auto
    no shutdown
    no ip http server
    no ip http secure-server
    control-plane
    voice-port 2/0
    connection plar opx 290
    voice-port 2/1
    connection plar opx 291
    voice-port 2/2
    voice-port 2/3
    voice-port 3/0
    connection plar 190
    voice-port 3/1
    connection plar 191
    voice-port 3/2
    voice-port 3/3
    dial-peer voice 180 pots
    destination-pattern 180
    port 2/0
    dial-peer voice 181 pots
    destination-pattern 181
    port 2/1
    dial-peer voice 190 voip
    destination-pattern 19
    session target ipv4:192.168.254.40
    line con 0
    logging synchronous
    line aux 0
    line vty 0 4
    password xxx
    logging synchronous
    login
    transport input telnet
    end

  • Accidentally deleted bonjour from my computer.  iTunes will not open.  Help Please.

    Accidentally deleted Bonjour from my computer.  iTunes will not open.  Running Windows XP. Help please.

    Uninstalling and then reinstalling your iTunes should also get your Bonjour reinstalled.
    For the reinstall, use an installer downloaded from the Apple website:
    http://www.apple.com/itunes/download/
    ... or you could get it back via your Apple Software Update for Windows.
    If you'd prefer not to uninstall iTunes, try the following procedure.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the Bonjour.msi (or Bonjour64.msi) to do a standalone Bonjour install.

Maybe you are looking for

  • Deployment Application To Weblogic Server Failed

    Hello every body I need your help in this problem please : I'm using Oracle JDeveloper 11.1 in my local machine, I Installed Weblogic Server 10.3 on the server and it's works well, I made new JDBC connection in Weblogic Server and it's works well too

  • Account 'Acquisition: down payments' could not be found for area 01

    Hi, In our PO there is a 8 line items. We want to create GRN by taking 2 line items at a time. It is Asset's PO and GRN. During GRN we select two line items check box including item OK check box. Click on Check button which shows as green signal. Cli

  • Cisco ISE version 1.2.1.198 distribution deployment issue

    Dear All, I am having 3 ISE (Admin, PSN & MNT node) running on version 1.2.1.198 with no patch. My MNT node is not sync. with admin node. I need to apply a certificate but getting error. I am unable to deregister it. I have tried to push the patch 3

  • Cisco ip phone and wired user authenticate form ISE

    Hi dears, I configurate wired users from Cisco ISE. The authentication protocol is Eap-fast, the external device is DC. The wired user authenticate from ISE normally. I use labminutes web sites for configuration video. Now the customer also want the

  • Unable to open files from web on Sharepoint 2013

    I have a user who is having an issue opening any files on sharepoint site. I have checked technet for possible solutions and this is what has been done so far: Environment: VDI using Xendesktop with Windows 7 Enterprise, Office 2013.  1. Ran repair o