NAPT Firewall, RMI Callbacks and JRMP MultiplexProtocol

Hi All,
I am looking at having an RMI client behind a Network Address Port Translation firewall receive RMI calls back from an RMI server. NAPT makes it impossible for the client to listen for connection coming from the server through the NAPT firewall.
This is discussed at http://www.rmiproxy.com and http://cssassociates.com/rmifirewall.html but the proposed solutions do not appear to use the MultiplexProtocol protocol defined by JRMP (http://java.sun.com/j2se/1.4.2/docs/guide/rmi/spec/rmi-protocol3.html).
The RMI FAQ
"How can I receive incoming RMI calls through a local firewall"?
(http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html#firewallIn) had a section for JSSE 1.3 that explained how to use the multiplex protocol (option 4). It sounds like this option referred to the JRMP MultiplexProtocol protocol.
The multiplex protocol option has been removed from the 1.4 FAQ
(http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#firewallIn).
Tried the "checkListen" and "socket factory" techniques mentioned in the 1.3 FAQ without success with 1.4.2. The RMI client behind the NAPT firewall runs in a signed Applet.
Is the ability of using the JRMP MultiplexProtocol protocol available in the JRE in order to receive incoming RMI calls through a local firewall? If yes, what do you do in order to use it?
What is the best way to have RMI callbacks work behind NAPT?
Thanks a lot in advance!
Cheers
Bertrand

As of about JDK 1.2.2, the ability of RMI clients to negotiate the multiplex protocol was
removed, but the server-side support remains.
Your best answer for negotiating NAT filrewalls may be the RMI Proxy http://www.rmiproxy.com, although I could be biased as I wrote it.
EJP

Similar Messages

  • RMI callbacks with no replica aware stubs in a cluster?

    We would like to use either an RMI ping mechanism or an RMI callback in an upcoming project but are limited to 1.1 and 1.2 JRE's. I don't believe generating a replica aware proxy is an option for us given those constraints, no support for dynamic proxies. So we have a remote server object that we would ideally like to be clusterable that we can register a callback interface with. How can we accomplish this given our client limitations with weblogic 8.1 RMI? Any options?

    Yep you speak no lies. Of course once I thought about it some more I realized the error of assuming one could register a jdk rmi object with a weblogic rmi object. JRMP vs T3?. Not good.
    We still like using plain jane RMI w/in weblogic. I can register my UnicastRemoteObject stub with a normal RMI object on the server and it can callback and deliver messages. It will also send heartbeats periodically. If the heartbeat isn't heard from in awhile we re-register through http. The advantage of this is that the http session has failed over to another box and the web tier manages the rmi registration for me. The client can remain ignorant of any RMI lookups, which are tedious when not using JNDI or the cluster aware proxy.
    All of this to get back a few seconds and keep a few thousand clients from polling through a servlet every second. Argh JDK 1.1.
    Thanks for hammering that final point in.

  • RMI Callbacks with Highavailability

    Hi,
    I would like to use the RMI Callbacks mechanism. The only problem I got is that I need to also implement highavailability, meaning that I will have more than one server. How can this be implement? Do I need to pass the callback reference to all the other servers? Is it possible to keep the reference in a data base?
    Thanks!

    I resent your remark.
    A client can connect to one server. Now, this server has the refernce to later be used by RMI Callback. In order for other servers to use it as well, the server can serialize the reference and save it in the DB (that was my question - if saving it in the database is possible). A server that gets a request from a client and wants to forward it to another client, checks to see if it has its reference. If not, it reads it from the database and uses it.

  • RMI callback

    Hello everyone!
    I have problem with RMI callbacks. I have on server function "connect" which is adding a client to host lists. Then if necessary I send something to people from that list. Everything is working, client can send info to server which is next resend to clients from host list. But problem is at start-up. Sending to a server a reference to a client object is very, very slow. It takes about 10-20 sec.
    Then everything is fine, every method gives me an answer within parts of seconds.
    How can I eliminate this startup problem?
    Thanks in advance,
    Daniel

    It seems that I resolve the problem first :) Hopfully.
    Here is the answer for those of You who has or will have same problem:
    If you want to pass the object by reference to server you need to implement Remote interface. Of course this is implemented by class UnicastRemoteObject, which you have to extend, but you must remember to implement it in every object which is called by class as well. I have forgoten about this and insted passing by reference it copied object, which is horrible SLOW!!

  • RMI Callback messages can not be sent to all clients

    we I send a message to all clients using RMI Callback the message dont arrive to all clients when one or more clients is disconnected without removing themselves from the hashtable at the server side .
    how i can know if the client is disconnected before sending the message to him using RMI callback taking into account that the client dosnt tell the server when he has disconnected.
    please i want a solution to this problem.
    thanks

    You seem to be making this a little complicated. During the login (or sometime) have one of the parms that are passed back to the server be a remote object on the client. It can have a nice interface like
    public void callMe(Object obj) throws .... or you could get cute and add
    pubic void shutDown() throws.... but this could be handled in the other method.
    During the call the client becomes the server and the server the client. The callMe method has no clue as to what thread it is on so it should just quickly queue up whatever it has gotten and return. It should not be doing work that will effect the Awt thread. If the client is no longer there then you should be able to catch this on the server, and continue posting other clients.
    Howie
    Your question is very similar to what I'm currently
    researching. I've got the additional complication of
    detecting when clients crash without unregistering (in
    my case unlocking) a resource. I haven't written any
    test code yet, so don't shoot me if I'm wrong, but
    here is my general strategy.
    In order to implementing RMI callbacks, it looks like
    you must make both the clients and the server register
    themselves in the RMI Registry. Parameters sent
    through RMI method calls are done by value so
    you can't simply add a listener as you normally do.
    The server will put itself in the registry using a
    well known ID. The clients will get this reference
    and ask the server for a unique ID. They will then
    register themselves in the RMI registry using this
    value. The client will then tell the server that it
    is registered. I believe if the client object is
    wrapped in a WeakReference, then when the client dies
    or ends, the reference contained in the WeakReference
    will be null. The server will perform this check on
    all registered clients to determine which clients are
    still alive.
    ,Marcus

  • RMI protocol over JRMP transport error when accessing Discoverer Plus

    Hi,
    I just upgraded my Discoverer to 9.0.2.54.01. I can successfully access my Discoverer Viewer Workbooks but not my Discoverer Plus. When I try to access Plus, Applet will be started, and then it will prompt the RMI protocol error:
    Attempt 1.  RMI protocol over JRMP transport: Connection refused to host: 127.0.0.1; nested exception is:*
    java.net.ConnectException: Connection refused: connect*
    Attempt 2.  RMI protocol over http transport : Unable to attach to existing session.*
    I used browsers Mozilla3.0.5 and IE7.
    Thanks!

    Hi Andy
    It could be a Java incompatibility issue. On one of your client machines try removing Java altogether and then reconnecting to Discoverer Plus. The server should send down a new, clean version of the Java.
    Try this and let me know how you get on
    Best wishes
    Michael

  • RMI Protocol over JRMP transport: connection refused

    I changed the look and feel for disco plus to Jinitiator. I then started getting error RMI Protocol over JRMP transport: connection refused to host: 192.168.1.1
    I changed the settings back to java plugin 1.4 but I'm still getting the same error on all client machines.
    I'm running windows 2003 and application server 10.1.2.0.2
    Thanks for any help,
    Brian

    Hi Brian
    When you changed to JInitiator what did you set the style to be? Also, why would you not want to use the Sun Java?
    Anyhow, try getting the users to clear their local Sun Java cache, this will release the applet causing it to reload upon next connection, and try again.
    If you want to retry JInitiator, try this:
    1. Go to Control Panel | JInitiator 1.3.1.x or whatever version you are using
    2. Navigate to the Proxies tab
    3. Uncheck Use Browser Settings
    4. Click the Apply button
    5. Close all browser windows
    6. Reconnect to Discoverer Plus
    If the above steps do not help, try editing the security details of the Options menu in the Internet Explorer using this workflow:
    1. On the client machine, launch IE
    2. From the toolbar, select Tools | Internet Options
    3. Navigate to the Security tab
    4. Click on the Trusted Sites icon
    5. Click on the Sites button
    6. Add a fully, qualified HTTP link to your server
    7. Close all browser windows
    8. Reconnect to Discoverer Plus
    Of the two solutions above, the first is most likely to fix your issue. However, I advise all my customers to set up the application server connections as being trusted sites.
    One additional thing would be to delete your cookies. Discoverer Plus loves cookies.
    Best wishes
    Michael

  • RMI Protocol over JRMP transport: connection refused to host: 10.10.10.10

    Hi,
    We migrated our Discoverer 9.0.2 to 10.1.2. However, when we connected to Discoverer Plus, the message saying "RMI Protocol over JRMP transport: connection refused to host: 10.10.10.10" appeared. We use the "Default" communication protocol and Sun JVM 1.4+ is installed in the client. Do you know what's happening?
    Thanks.
    Andy

    Hi Andy
    It could be a Java incompatibility issue. On one of your client machines try removing Java altogether and then reconnecting to Discoverer Plus. The server should send down a new, clean version of the Java.
    Try this and let me know how you get on
    Best wishes
    Michael

  • "DEADLOCK" when showing dialog from RMI-callback.

    Hi!
    Today is the 10th day (full time) that I've been searching for a solution in Java Forums and Internet, but I couldn't find anything that helps me. Help is extremely appreciated, otherwise I'll go crazy! :-)
    The problem is that RMI-callback thread "somehow blocks" the Event Dispatch Thread.
    I want to do following:
    1) I push the button in the client (btDoSomething)
    (MOUSE_RELEASED,(39,14),button=1,modifiers=Button1,clickCount=1 is automatically pushed onto EventQueue)
    2) btDoSomethingActionPerformed is invoked
    3) inside of it I make a call to RMI-server (server.doSomething())
    4) from this server method I invoke RMI-callback back to the client (client.askUser())
    5) in the callback I want to display a question to the user (JOptionPane.showConfirmDialog)
    6) user should answers the question
    7) callback returns to server
    8) client call to the server returns
    9) btDoSomethingActionPerformed returns and everybody is happy :-)
    This works normally in normal Client, that means, while a button is pushed, you can show Dialogs, but with RMI callback I get problems.
    I just made a small client-server sample to simulate real project. What I want to achieve is that client invokes server method, server method does something, but if server method doesn't have enough information to make the decision it needs to do call back to the client and wait for input, so the user gets an JOptionPane.
    Here is my callback method:
        /** this is the remote callback method, which is invoked from the sevrer */
        public synchronized String askUser() throws java.rmi.RemoteException {
            System.out.println("askUser() thread group: " + Thread.currentThread().getThreadGroup());
            System.out.println("callback started...");
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        System.out.println("My event finished.");
            }catch (Exception e) {
                e.printStackTrace();
            try {
                Thread.currentThread().sleep(10000);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("callback finished.");
            return "Yo!"; // just return anything
        }Here in this sample I let the callback thread sleep for 10 seconds, but in real project I let it sleep infinitely and I want to wake it up after the user has answered JOptionPane. But I have the DEADLOCK, because event queue is waiting for callback to finish and doesn't schedule the "showing dialog" event which contains the command for waking up the callback thread.
    I looked very precisely when the event queue starts again to process events: it is precisely then when btDoSomethingActionPerformed is finished.
    When I'm not accessing GUI inside of the callback, this callback mechanism works perfectly, but as soon as I want to show the dialog from inside of the RMI-callback method, the "AWT Event Dispatch Queue" is somehow frozen until RMI-callback thread is finished (and in turn btDoSomethingActionPerformed terminates) . I cannot explain this weird behaviour!!!
    If I don't use SwingUtilities.invokeLater (I know this shoudn't be done outside of Event Dispatch Thread), but access the GUI directy, my JOptionPane is shown, but is not painted (it is blank gray) until callback thread returns.
    Why showing (or painting) of dialog is not done until btDoSomethingActionPerformed is finished?
    I also tried to spawn a new Thread inside of main RMI-callback thread, but nothing changed.
    I also tried the workaround from some older posting to use myInvokeLater:
        private final static ThreadGroup _applicationThreadGroup = Thread.currentThread().getThreadGroup();
        public void myInvokeLater(final Runnable code) {
            (new Thread(_applicationThreadGroup, new Runnable() {
                public void run() { SwingUtilities.invokeLater(code); }
            ).start();
        }but this didn't help either.
    Then I tried to spawn a new Thread directly from the Client's constructor, so that I'm sure that it belongs to the main appplication thread group. I even started that thread there in the constructor and made it wait for the callback. When callback came in, it would wake up that sleeping thread which should then show the dialog. But this did't help either.
    Now I think that it is IMPOSSIBLE to solve this problem this way.
    Spawning a new Process could work I think, but I'm not really sure if I want do to that.
    I know I could make a solution where server method is invoked and if some information is missing I can raise custom exception, provide the input on client side and call the same server mathod again with this additional data, but for that I need to change server RMI interfaces, etc... to fit in this concept. I thought callback would much easier, but after almost 10 days of trying the callback...I almost regreted it :-(
    Is anyone able to help?
    Thank you very much!
    Please scroll down for the complete sample (with build and run batch files), in case someone wants to try it. Or for the time being for your convenience you can download the whole sample from
    http://www.onlineloop.com/~tornado/download/rmi_callback_blocks_gui.zip
    ######### BEGIN CODE ####################################
    package callbackdialog;
    public interface ICallback extends java.rmi.Remote {
        public String askUser() throws java.rmi.RemoteException;
    package callbackdialog;
    public interface IServer extends java.rmi.Remote {
        public void doSomething() throws java.rmi.RemoteException;
    package callbackdialog;
    import java.rmi.Naming;
    public class Server {
        public Server() {
            try {
                IServer s = new ServerImpl();
                Naming.rebind("rmi://localhost:1099/ServerService", s);
            } catch (Exception e) {
                System.out.println("Trouble: " + e);
        public static void main(String args[]) {
            new Server();
    package callbackdialog;
    import java.rmi.Naming;
    public class ServerImpl extends java.rmi.server.UnicastRemoteObject implements IServer {
        // Implementations must have an explicit constructor
        // in order to declare the RemoteException exception
        public ServerImpl() throws java.rmi.RemoteException {
            super();
        public void doSomething() throws java.rmi.RemoteException {
            System.out.println("doSomething started...");
            try {
                // ask the client for the "missing" value via RMI callback
                ICallback client = (ICallback)Naming.lookup("rmi://localhost/ICallback");
                String clientValue = client.askUser();
                System.out.println("Got value from callback: " + clientValue);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("doSomething finished.");
    package callbackdialog;
    import java.rmi.server.RemoteStub;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.registry.Registry;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.Naming;
    import javax.swing.JOptionPane;
    import javax.swing.SwingUtilities;
    import javax.swing.JFrame;
    public class Client extends javax.swing.JFrame implements ICallback {
        private final JFrame parentFrame = this;
        private Registry mRegistry = null;
        private RemoteStub remoteStub = null;
        private IServer server = null;
        private final static ThreadGroup _applicationThreadGroup = Thread.currentThread().getThreadGroup();
        /** Creates new form Client */
        public Client() {
            initComponents();
            System.out.println("Client constructor thread group: " + Thread.currentThread().getThreadGroup());
            try {
                server = (IServer)Naming.lookup("rmi://localhost/ServerService");
                // register client to the registry, so the server can invoke callback on it
                mRegistry = LocateRegistry.getRegistry("localhost", 1099);
                remoteStub = (RemoteStub)UnicastRemoteObject.exportObject((ICallback)this);
                Registry mRegistry = LocateRegistry.getRegistry("localhost", 1099);
                mRegistry.bind("ICallback", remoteStub);
            }catch (java.rmi.AlreadyBoundException e) {
                try {
                    mRegistry.unbind("ICallback");
                    mRegistry.bind("ICallback", remoteStub);
                }catch (Exception ex) {
                    // ignore it
            }catch (Exception e) {
                e.printStackTrace();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
            secondTestPanel = new javax.swing.JPanel();
            btDoSomething = new javax.swing.JButton();
            getContentPane().setLayout(new java.awt.GridBagLayout());
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("RMI-Callback-GUI-problem sample");
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    formWindowClosing(evt);
            secondTestPanel.setLayout(new java.awt.GridBagLayout());
            btDoSomething.setText("show dialog");
            btDoSomething.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    btDoSomethingActionPerformed(evt);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 3;
            gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0);
            secondTestPanel.add(btDoSomething, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
            gridBagConstraints.weightx = 1.0;
            gridBagConstraints.weighty = 1.0;
            getContentPane().add(secondTestPanel, gridBagConstraints);
            pack();
        private void btDoSomethingActionPerformed(java.awt.event.ActionEvent evt) {                                             
            System.out.println(java.awt.EventQueue.getCurrentEvent().paramString());
            try {
                server.doSomething(); // invoke server RMI method, which will do the client RMI-Callback
                                      // in order to show the dialog
            }catch (Exception e) {
                e.printStackTrace();
        private void formWindowClosing(java.awt.event.WindowEvent evt) {                                  
            try {
                mRegistry.unbind("ICallback");
            }catch (Exception e) {
                e.printStackTrace();
            setVisible(false);
            dispose();
            System.exit(0);
        /** this is the remote callback method, which is invoked from the sevrer */
        public synchronized String askUser() throws java.rmi.RemoteException {
            System.out.println("askUser() thread group: " + Thread.currentThread().getThreadGroup());
            System.out.println("callback started...");
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        System.out.println("My event finished.");
            }catch (Exception e) {
                e.printStackTrace();
            try {
                Thread.currentThread().sleep(10000);
            }catch (Exception e) {
                e.printStackTrace();
            System.out.println("callback finished.");
            return "Yo!"; // just return anything
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    Client client = new Client();
                    client.setSize(500,300);
                    client.setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton btDoSomething;
        private javax.swing.JPanel secondTestPanel;
        // End of variables declaration
    1_build.bat
    javac -cp . -d . *.java
    rmic callbackdialog.ServerImpl
    rmic callbackdialog.Client
    pause
    2_RunRmiRegistry.bat
    rmiregistry
    pause
    3_RunServer.bat
    rem java -classpath .\ Server
    java callbackdialog.Server
    pause
    4_RunClient.bat
    java callbackdialog.Client
    pause
    ######### END CODE ####################################

    I can understand that only partially, because SwingUtilities.invokeLater puts(redirects) my runnable object directly into AWT thread. The only conclusion I can draw from all things that I have tried until now , is that SwingUtilities.invokeLater(<showing the dialog>) invoked from a RMI thread somehow have lower "priority" than events coming directly from the AWT-thread and therefore it is held back until normal awt event completes (in this case BUTTON_RELEASED).
    But what I don't understand is the fact that the dialog is not shown even If I create and start a new thread from the client's constructor. This thread has nothing to do with RMI as it is in the main thread group:
        private BlockingObject dialogBlocker = new BlockingObject();
        private BlockingObject blocker = new BlockingObject();
        public Client() {
            initComponents();
            (new Thread() {
                public void run() {
                    try {
                        dialogBlocker.sleep(0);
                        System.out.println("My event started...");
                        JOptionPane.showConfirmDialog(parentFrame, "Are you OK?", "Question", JOptionPane.YES_NO_OPTION);
                        blocker.wake();
                        System.out.println("My event finished.");
                    }catch (Exception e) {
                        e.printStackTrace();
            }).start();
            ...Callback is then only used to wake up this thread which should display the dialog:
        public Object askUser() throws java.rmi.RemoteException {
            System.out.println("callback started...");
            dialogBlocker.wake();
            blocker.sleep(0);
            System.out.println("callback finished.");
            return userChoice; // return anything I don't care for now
    class BlockingObject {
        public void sleep(long timeout) {
            synchronized(this){
                try {
                    wait(timeout);
                }catch (InterruptedException e) {}
        public void wake() {
            synchronized(this){
                notifyAll();
        }In this case the dialog is shown, but it is NOT painted, so I have deadlock again. Why it is not painted?!?
    Haven't I uncouple it from RMI-Thread?
    But perhaps I'm looking at the wrong side of the whole thing.
    If I invoke server.doSomething (as ejp proposed) in a separate thread, then everything is fine (except that I cannot use this solution in my project :-( ).
    It seems that the whole problem is NOT AT ALL related to callback itself, but rather to the fact that if client invokes remote call, even dialogs can't be shown until the rmi call returns to the client.
    Thank you, Drindilica

  • RMI callback with JAVA1.5

    Since the version 1.5 we have no need to distribute the stub to all the clients.
    It's a great feature, but I need to perform a callback from the server to the client, in this case I need to perform a call to UnicastRemoteObject.exportObject() client-side before calling the registration method exposed by the server, and the stub of the class implementing the callback interface must be placed in the classpath of the server, is it true? Is there any other methos to perform an RMI-callback?
    To be clear as much as possible I have this interface exposed by the server
    public interface Services extends Remote
      public Map<String, ApplicationStatus> applicationsList () throws RemoteException;
       public ApplicationStatus startApplication (String identifier) throws RemoteException;
      public ApplicationStatus stopApplication (String identifier) throws RemoteException;
      public int exitCode (String identifier) throws RemoteException;
       * This method, as the name says, is used by the client to register the listener to some server-side event.
       * @param callback
       * @throws RemoteException
      public void registerForNotification (ExitCodeCallback callback) throws RemoteException;
    }and the interface of the callback is
    public interface ExitCodeCallback extends Remote
      public void notifyExitCode (ExitCodeEvent event) throws RemoteException;
    }On the server side I export the services in the registry
    Services servicesServerSide = new MyServices();
    Services services = (Services) UnicastRemoteObject.exportObject(servicesServerSide , 0);and on the client I perform a lookup of the services
    Registry registry = LocateRegistry.getRegistry("192.168.0.1", 1099);
    Services services = (Services) registry.lookup("SERVICES");I export my implementation of the interface
    public class ClientExitCodeCallback implements ExitCodeCallback
      public void notifyExitCode (ExitCodeEvent event)
        System.out.println(event.asString());
    }through the code
    services.registerForNotification(remoteCallback);but on the calling of this method I obtain a ServerSideException
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: it.sogei.jscheduler.rmi.client.ClientExitCodeCallback_Stub
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
         at sun.rmi.transport.Transport$1.run(Transport.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
         at java.lang.Thread.run(Thread.java:595)
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
         at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:179)
         at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
         at $Proxy0.registerForNotification(Unknown Source)
         at it.sogei.jscheduler.rmi.client.StartClient.main(StartClient.java:45)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: it.sogei.jscheduler.rmi.client.ClientExitCodeCallback_Stub
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:285)
         at sun.rmi.transport.Transport$1.run(Transport.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassNotFoundException: it.sogei.jscheduler.rmi.client.ClientExitCodeCallback_Stub
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:246)
         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:430)
         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
         at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
         at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
         at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
         at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
         ... 6 moreIs it true all of the above?

    If the server gets that exception, it's because the client found and used the stub when it exported its callback, or else the server is running < 1.5.
    If the client explicitly cites a port number or zero and it is running >= 1.5 and there is no stub class, it won't use it; it will create a dynamic stub class; and it will send an object of that class to the server as a parameter to the registration call. If the server is running >= 1.5, it will succesfully deserialize that object, reconstruct the dynamic stub from information in the serialization stream, and execute the registration method implementation.
    If the client exports by using a stub class instead of the above, it will create an object of that class and send it to the server as a parameter to the registration call; the server will try to deserialize it; and if it doesn't have the stub class available it will throw that exception.
    This is how it works.

  • RMI Callback Applet Tomcat!

    Hello,
    First timer here...bear with me.
    I am running a RMI server and an applet with one interface for the RMI Server. This part works fine. The .class files and the html is deployed thru TOMCAT 4.1
    The problem is however when the server code is changed to handle callbacks with the applet. Have already changed the security policy file. Now the applet too has its own interface.
    Compiled the .java files and also rmic applet and rmic server. Started the registry after that. And the server too with the codebase too mentioned with -Djava.rmi.server.codebase. (As in the HelloWorld example on the sun website) So far so good.
    However as soon as I load the appletviewer as http://localhost:8080/page.html (As I am running Tomcat) the error I get is:
    IO Exception while reading: Connection refused: connect
    Is it something to do with firewalls? But then everything is right now local and am lost...Any help will be really appreciated. Thanks a bunch.

    More explanation to the mentioned problem:
    I am sorry for not being very clear on this. Hope this helps.
    This link has the "QuoteServer" example which is on the same lines as my project.
    http://engronline.ee.memphis.edu/advjava/Examples/RMI/rmi_example.htm
    In the above example I compile all four files and then generate rmic for applet and server. Then I place all the class files and the related html for the applet in TOMCAT.
    Policy file:
    grant {
    // Allow everything for now
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*:1024-65535", "connect,accept";
    permission java.net.SocketPermission "*:80", "connect";
    Then I start my TOMCAT and then the server with codebase=http:\\localhost:8080\(my folder)\ and the security file as mentioned above. So far so good.
    The problem occurs when I start my applet as
    appletviewer -J-Djava.security.policy="above file here" http:\\localhost:8080\page.html
    Also when I loaded the applet in IE I got the AccessControlException:access denied. Can you also direct me as to how to direct the above security policy file in IE?
    Thanks in advance for your patience. I hope I am clearer this time. Please let me know if more details are required.
    Appreciate your help.

  • RMI Callback questions

    Hello everybody,
    1. Can i have a RMI callback mechanisms established between WLS5.1 and WLE5.0.x..xx
    environments?
    2. What are the problems associated with it? Any rule of thumb please
    3. I need to access EJB's on the WLS side of it,(once hte callback is invoked
    by the server) and at the server side, the RMI Server is a daemon looking on the
    tuxedo bus using JOLT API's? Any constraints in this approach from BEA Perspective?
    Please let me know. It's urgent.
    with regds
    siva

    "siva" <[email protected]> writes:
    1. Can i have a RMI callback mechanisms established between WLS5.1 and WLE5.0.x..xx
    environments?
    2. What are the problems associated with it? Any rule of thumb please
    3. I need to access EJB's on the WLS side of it,(once hte callback is invoked
    by the server) and at the server side, the RMI Server is a daemon looking on the
    tuxedo bus using JOLT API's? Any constraints in this approach from BEA Perspective?I know it can be done using Jolt, I don't know what the limitations are.
    andy

  • RMI Callback with Applet

    Hi,
    I have a simple RMI Callback Client/Sever Application, where the client-side is inplemented in a JApplet. All works fine by local tests (client and server on my machine), but when the client is on remote machine I got an security exception or error (ClassFormatError(Bad magic number)).
    How can I make my client/server work?

    No, I'm testing inside LAN, no firewalls, no proxys, no nothing. Just a server and the client (applet).
    And this strange error, I'll paste the entire stack trace:
    java.lang.ClassFormatError: Client (Bad magic number)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadCode(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    On my local machine oll works fine... is the problem the applet's "sandbox"? Or...?
    Any ideas are welcome
    Thanks

  • RMI Callback ConnectException

    Hi,
    I'm trying to get a RMI Callback running on 2 different machines. The client registers itself at the server who then calls a method on the client. Locally everything works fine, but when running the server on a different PC I get a ConnectException when trying to call the callback method on the client. Funnily enough, the IP to which the connection is refused is that of the server! Why does it try to connect to itself? No firewalls involved, policies okay, registry running... Tested already with two machines running the same OS and Java version.
    What am I missing?
    Thanks a lot!

    I'm also facing the same problem. The application without callbacks runs without problem in one machine AND two different machines. but when i run those on different machines the app with callbacks fails. In this case the client program gives error. The IP address it looks to connect is correct in my case.
    Lookup completed
    Server said hello
    Exception in CallbackClient: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.ConnectException: Connection refused to host: 192.168.0.199; nested exception is:
         java.net.ConnectException: Connection refused

  • Ports and IPs to be open/permitted in firewall to download and work in creative cloud

    What is the complete list of ports and IP addresses to be open/permited in our enterprise firewall in order to let internal PCs download and work with creative cloud applications?

    Our firewall only supports IP configuration (not URL). Do you have IP list?
    From: Rajshree [email protected]
    Sent: miércoles, 06 de noviembre de 2013 17:23
    To: Simon, Mariano
    Subject: Ports and IPs to be open/permitted in firewall to download and work in creative cloud
    Re: Ports and IPs to be open/permitted in firewall to download and work in creative cloud
    created by Rajshree <http://forums.adobe.com/people/Rajshree>  in Adobe Creative Cloud - View the full discussion <http://forums.adobe.com/message/5819892#5819892

Maybe you are looking for

  • IPod touch 4g is not recognized in my computer as a portable device, help?

    I have an iPod Touch 4th generation (4.2.1) and the computer it was initially synced with (a Dell Inspiron laptop) is no longer working.  I would like to update the iPod software via iTunes, and I have already transferred purchases and backed up my i

  • To read a connection string from a notepad

    i want to read the DSN-less connection string from a notepad that is from a text file so that if server ip address changes then it will be easy to change the ip address in the notepad rather than changing the code .we are using jsp. Connection con=Dr

  • IPod appearing in Device Manager as unknown device

    Hi, I'm currently using an iPod Nano 4th Gen. and it is appearing in Device Manager as an unknown device. I found this out after the error message "USB device not recognised" or something, and followed instructions. I'm currently clueless on what to

  • For each an array

    Hello all, In my RTF template i'm trying to do a "for each" on a array created with "set_array" ... but it doesn't work ... someone has any idea to solve this issue? In other languages it's an easy way to do it, please tell me how to proceed in bip.

  • Hp officejet 4635

    I bought the HP Officejet 4635 and have had trouble printing pictures in a Word document.  The problem happens when I have to resize the picture. For example, if the picture is 4" square and I want to reduce it to 2" square in the document, I ususall