Remote reference to an RMI server

I was going through some of the posts here and somebody mentioned : -
"The Registry is a client that
holds a reference to your remote object. If the remote object
terminates, the reference remains, (as it would with any other
client). You must manually purge the reference, (possibly with
an unbind()).
This is contrary to what I thought "the remote reference to an RMI server not implementing activatable remains valid as long as the server itself remains running and no longer. Is it a misunderstanding on my part?

hi Ayesha,
You are right
"the remote reference to an RMI server not implementing activatable remains valid as long as the server itself remains running and no longer".

Similar Messages

  • Activatable Servers and Remote References [RMI]

    Hello everyone,
    I'm wondering if there's a way to know, on an activatable server, how many clients have an active reference to that and their id. I need to know exactly who did not renew his lease with the server, and once I know it I can remove that client from a list of logged-in client..
    example:
    client "user1" gets a remote reference of the activatable server, that adds "user1" to a logged-in-list I made (like a online userlist in a forum). suddenly user1 crashes without invoking "logout" method (and for the userlist he's still online!).
    Once the lease for user1 expires, the activatable servers decreases the remoteRef count.
    I'd like to associate the client username with the remote reference or the lease in some way, so once a client lease is not renewed I know for sure who I've to remove with the server from the online userlist..
    Hope you can understand my problem, thanks in advance
    Edited by: Guguz on 28-dic-2010 6.44

    Each time a client connects to the login server, I give him a new activatable server.A new server. Making it activatable is pointless: you're creating it dynamically per client. Only the login server needs to be activatable. It goes something like this, modulo typos:
    public interface Login extends Remote
      Session login(String username, char[] password) throws RemoteException;
    public class LoginImpl extends Activatable implements Login
    public interface Session extends Remote
      // your session API here
      void logout() throws RemoteException; // explicit logout
    public class Session extends UnicastRemoteObject implements Session, Unreferenced
      // ... implementation of your session API
      // Unreferenced.unreferenced()
      public void unreferenced()
        // Log the enforced logout via unreferenced()
        logout();
      // logout()
      public void logout()
        // Log the logout
        // call UnicastRemoteObject.unexportObject(this, true);
        // and do whatever else you have to do when a client logs out
    In the activatable unreferenced methodIn the Unreferenced.unreferenced() method
    then I can put the "logout user".And wherever else it should go.
    And this should prevent crashes right ?Wrong. It won't prevent crashes. It will detect them.

  • RMI server calling a method on a client object ?

    Hi All,
    I am writing a client - server application and my intention is to use RMI for comunication.
    When the client has to retrive datas from the server it's easy, but let's suppose that the server has to inform the client about some updates about the data, how can I do that?
    I do not want the client keeping calling methods on the server to see if there is something of new :(
    Is there some way to pass an OutputStream to the client, so when the server writes someting, the client reads it ? ( the client should have a thread which keeps reading)
    Or maybe I could pass a reference of a client class to the server so when the server needs to inform the client, it calls a method on this class?
    thanks, Fab

    The client can be a Remote Object to, passed as a remote reference when calling the server.
    Basically all you'll have to do is "register" the client on the serverside.
    Your serverside class would the have a:
    register(RemoteClient client) method.
    The server could the use this remote reference for callbacks.
    So, all you have to do is declare the Remote Interface for the client and implement it, and the call the servers myRemoteServer.register(this).
    If you've already implemented the server, it's a peace of cake to enhance your client.

  • Rmi remote reference lookup very slow in web start application

    I have a little problem with the RMI communication in a web start test application.
    It is a very simple program in which the client calls a remote object that returns a String.
    Everything seems to be working fine when i'm running/debugging the client app in eclipse, but when i package my client project into a jar file and run it as a web start application (i'm providing the jnlp on a local webserver) the remote reference lookup takes about 15 seconds.
    basically, what my client does is this:
    Registry registry = LocateRegistry.getRegistry(address);
    ServerTransaction st= (ServerTransaction) registry.lookup(name);
    String result = st.test();
    The server code looks like this:
    String name = "ServerTransaction";
    ServerTransaction engine = new DefaultServerTransaction();
    ServerTransaction stub = (ServerTransaction) UnicastRemoteObject.exportObject(engine, 0);
    Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
    registry.rebind(name, stub);
    The server runs as a normal stand alone java application on my local machine as well.
    And here the content of the jnlp file for the client application:
    <resources>
         <jar href="WSTest.jar"/>
         <jar href="WSTestServer.jar"/>
         <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
         <property name="serverAddress" value="127.0.0.1" />
    </resources>
    <security>
         <all-permissions/>
    </security>
    <application-desc main-class="test.WSTest"/>
    As i said, the whole thing works when run as a normal java application as well as with web start, with the difference that the remote reference lookup takes about 15 seconds with web start.
    Can anyone tell me how i could go about this?

    Meanwhile, i tried the same thing at home on my xp machine (i use vista at work), and even though my test at home basically does the same thing (invoking a simple remote method that just returns "hello world") it worked pretty fast, contary to the 15 second hang on vista.
    So i can't really say where the problem is...
    I also found these two rmi properties
    sun.rmi.transport.connectionTimeout (1.1.6 and later)
    The value of this property represents the period (in milliseconds) for which socket connections may reside in an "unused" state, before the Java RMI runtime will allow those connections to be freed (closed). The default value is 15000 milliseconds (15 seconds).
    and
    sun.rmi.transport.proxy.connectTimeout (1.1 and later)
    The value of this property represents the maximum length of time (in milliseconds) that the Java RMI runtime will wait for a connection attempt (createSocket) to complete, before attempting to contact the server using HTTP. This property is only used when the http.proxyHost property is set and the value of java.rmi.server.disableHttp is false. The default value is 15000 milliseconds (15 seconds).
    Hoping it would help (totally clueless) i tried to set these as system properties via System.setProperty(...) to a lower value (if that even works this was - please correct me if i am totally wrong here) but it didn't help.

  • RMI / clustering / remote references

    We are currently in the process of designing the architecture for an application. We are considering using RMI as a mechanism of communication. The architecture is as such
              / App Server 1 \   / External Server 1
    Web     /                \ /
    Server                     X
              \ App Server 2 /   \ External Server 2
       DatabaseWhere App Server 1 and App Server 2 are stateless servers that provide exactly the same functionality. In fact the idea is that you can add more App Servers to increase performance as you wish. To keep the servers stateless, any state information is stored on the Database.
    App Server 1 and App Server 2 can talk to either External Server 1 or External Server 2 to access remote functions.
    So both External Server 1 and External Server 2 can provide the same Objects but calls relating to the same data may have to go back to the same External Server. (I.E. these external Servers are statefull)
    This has raised several problems.
    1/ If App Server 1 and App Server 2 both register it's remote Objects with the same Registry, how does the registry deal with this. Does it maintain two references or just the latest? Would using JNDI as the registry service help? Would the registry round-robin these references?
    2/ Is there are way of storing stubs in a database. I.e App Server 1 requests an External Server remote object, External Server 1 is used, App Server 1 Stores this remote object to allow any App Server to continue the process. App Server 2 picks up the Remote object from the Database and carries on talking to External Server 1 through it.
    Originally I was hoping to just bypass the whole Registry section and create my own lookup process. However I cannot see how this can be done. I tried looking to see how Sun actually do the Remote Binding in the Java Foundation Classes but it all seems to be done in the underlying sun.rmi classes...
    any ideas?
    Cheers
    Ben

    I've just found a solution to my last question. From this I should be able to create my own registry app that is contacted initially through this mechanism, and then any required exposed objects are passed to it using .exportObject() and serialisation. My registry app can then pick up objects of the same type and allow a round robin mechanism, etc...
    import java.rmi.*;
    import java.rmi.server.*;
    import sun.rmi.server.UnicastServerRef;
    import sun.rmi.transport.LiveRef;
    public class MyServerImpl extends RemoteServer implements SimpleRMIInterface
        public static int SERVER_PORT = 1234; // the client should know it
        public static int SERVER_ID = 666; // the client should also know it
        public SimpleRMIImpl(String name) throws RemoteException
            LiveRef liveref = new LiveRef(new ObjID(SERVER_ID), SERVER_PORT);
            UnicastServerRef unicastserverref = new UnicastServerRef(liveref);
            ref = unicastserverref;
            unicastserverref.exportObject(this, null);
            // No need to do Naming.rebind(name, this);
    ... Interface methods implementation skipped
    }Client implementation:
    import java.rmi.server.*;
    import sun.rmi.transport.tcp.TCPEndpoint;
    import sun.rmi.transport.LiveRef;
    import sun.rmi.server.UnicastRef;
    public class SimpleRMIClient
        public static void main(String[] argv)
            try
                TCPEndpoint tcpendpoint = new TCPEndpoint("servername",1234); // I use port=1234 here
                LiveRef liveref = new LiveRef(new ObjID(666),    tcpendpoint,false);
                MyServerInterface myServerObject = (MyServerInterface) new MyServerImpl_Stub((RemoteRef) (new UnicastRef(liveref)));
                // No need to do Naming.lookup(serverName + "/" +
    objectName);
            catch(Exception e)
                e.printStackTrace();
                System.exit(0);
                System.out.println("RMI connection successful");
    }nice...
    Ben

  • RMI Remote reference is getting garbage collected

    Hi,
    I'm using Weblogic 5.1, on Windows NT.
    I have RMI remote object on the server side, and my client is an applet.
    In the applet I use JNDI to get the reference of the server object, and
    use it. The problem is after sometime ( like 10 min or so) I get
    weblogic.rmi.NoSuchObjectException
    and at the WLServer console I see
    ' <DGCServer> tried to renew lease for 1 lost reference'.
    At the server side, I bind the object using JNDI.
    I want thsi reference to be available all the time in the applet.
    any help is appreciated.
    thanks,
    Abdul.

    Refer to my post on misc. Do not cross-post.
    Cheers - Wei
    aroshan <@cisco.com> wrote in message news:[email protected]..
    Hi,
    I'm using Weblogic 5.1, on Windows NT.
    I have RMI remote object on the server side, and my client is an applet.
    In the applet I use JNDI to get the reference of the server object, and
    use it. The problem is after sometime ( like 10 min or so) I get
    weblogic.rmi.NoSuchObjectException
    and at the WLServer console I see
    ' <DGCServer> tried to renew lease for 1 lost reference'.
    At the server side, I bind the object using JNDI.
    I want thsi reference to be available all the time in the applet.
    any help is appreciated.
    thanks,
    Abdul.

  • How do I make a RMI client running in Bea find a remote, non Bea, RMI server?

    On my stand alone test system I run a RMI server in one JVM,
    registry.exe and a RMI client in its own JVM. The client uses
    java.rmi.Naming.lookup() to find the RMI server, and this works fine.
    If I run the same RMI client class within Bea the naming lookup fails! I
    guess this is due to Bea using it own RMI registry rather than the
    registry.exe I started separately(?)
    QUESTION: How do I make a RMI client running in Bea find a remote,
    non-Bea, RMI server?
    Of course, in the final environment the server will run on a system
    remote from Bea.
    The RMI client calls are done from a servlet, not from a EJB.
    The doumentation about using RMI with Bea is focused on running the RMI
    server within Bea. This might be the "normal" thing to do, but in our
    case Bea is the client, not the server. Do I still need to use
    weblogic.rmi.*....? If so, where?
    Grateful for any tip.
    Göran Hagnell

    On my stand alone test system I run a RMI server in one JVM,
    registry.exe and a RMI client in its own JVM. The client uses
    java.rmi.Naming.lookup() to find the RMI server, and this works fine.
    If I run the same RMI client class within Bea the naming lookup fails! I
    guess this is due to Bea using it own RMI registry rather than the
    registry.exe I started separately(?)
    QUESTION: How do I make a RMI client running in Bea find a remote,
    non-Bea, RMI server?
    Of course, in the final environment the server will run on a system
    remote from Bea.
    The RMI client calls are done from a servlet, not from a EJB.
    The doumentation about using RMI with Bea is focused on running the RMI
    server within Bea. This might be the "normal" thing to do, but in our
    case Bea is the client, not the server. Do I still need to use
    weblogic.rmi.*....? If so, where?
    Grateful for any tip.
    Göran Hagnell

  • BEA-080003 RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl

    When i try to run oracle webcenter portal in jdeveloper by Run button i see in console
    [12:23:43 PM] Deploying Application...
    <18.07.2013 12:23:43 MSK> <Warning> <RMI> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.invoke(Ljavax.management.ObjectName;Ljava.lang.String;Ljava.rmi.MarshalledObject;[Ljava.lang.String;Ljavax.security.auth.Subject;)
    weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[weblogic], on ResourceType: DeployerRuntime Action: execute, Target: query.
    weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[weblogic], on ResourceType: DeployerRuntime Action: execute, Target: query
        at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeAction.wlsRun(SecurityHelper.java:819)
        at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeAction.run(SecurityHelper.java:682)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.management.internal.SecurityHelper.isAccessAllowed(SecurityHelper.java:269)
        Truncated. see log file for complete stacktrace
    >
    <18.07.2013 12:23:43 MSK> <Warning> <RMI> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.invoke(Ljavax.management.ObjectName;Ljava.lang.String;Ljava.rmi.MarshalledObject;[Ljava.lang.String;Ljavax.security.auth.Subject;)
    weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[weblogic], on ResourceType: DeployerRuntime Action: execute, Target: deploy.
    weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[weblogic], on ResourceType: DeployerRuntime Action: execute, Target: deploy
        at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeAction.wlsRun(SecurityHelper.java:819)
        at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeAction.run(SecurityHelper.java:682)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.management.internal.SecurityHelper.isAccessAllowed(SecurityHelper.java:269)
        Truncated. see log file for complete stacktrace
    >
    <18.07.2013 12:23:43 MSK> <Warning> <RMI> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.invoke(Ljavax.management.ObjectName;Ljava.lang.String;Ljava.rmi.MarshalledObject;[Ljava.lang.String;Ljavax.security.auth.Subject;)
    weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[weblogic], on ResourceType: DeployerRuntime Action: execute, Target: query.
    weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[weblogic], on ResourceType: DeployerRuntime Action: execute, Target: query
        at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeAction.wlsRun(SecurityHelper.java:819)
        at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeAction.run(SecurityHelper.java:682)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.management.internal.SecurityHelper.isAccessAllowed(SecurityHelper.java:269)
        Truncated. see log file for complete stacktrace
    >
    <18.07.2013 12:23:44 MSK> <Warning> <RMI> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.invoke(Ljavax.management.ObjectName;Ljava.lang.String;Ljava.rmi.MarshalledObject;[Ljava.lang.String;Ljavax.security.auth.Subject;)
    weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[weblogic], on ResourceType: DeployerRuntime Action: execute, Target: query.
    weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[weblogic], on ResourceType: DeployerRuntime Action: execute, Target: query
        at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeAction.wlsRun(SecurityHelper.java:819)
        at weblogic.management.internal.SecurityHelper$IsAccessAllowedPrivilegeAction.run(SecurityHelper.java:682)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.management.internal.SecurityHelper.isAccessAllowed(SecurityHelper.java:269)
        Truncated. see log file for complete stacktrace
    >
    [12:23:45 PM] ####  Deployment incomplete.  ####
    [12:23:45 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
    what does it mean and how to solve this?

    any help?

  • Why constructor of rmi server throws remote exception

    why is it that the constructor of the class extending UnicastRemoteObject i.e rmi server has to throw RemoteException?

    Writing an RMI server is a matter of defining a class, exporting it when constructed and implementing one or more remote interfaces. How to export?
    auto export happens when u call super() in the constructor. It is then registered with the rmi system and made to listen to a TCP port. The various constructors for UnicatRemoteObject allow the derived classes to export at the default port.
    Because this automatic export step occurs at construction the constructors throw this exception.

  • Java Web Services accessing rmi server

    Hi,
    I want to access the rmi server from a java web services.My java web services is running under Sun application server9.The rmi server is not using any application server.Please help me to sort out the problem.
    Bye
    Binay

    What's the problem exactly? I assume you understand that the RMI server has to run like any RMI server, it has to bind itself into a Registry; the Web server acts as an RMI client so it has to look up the Registry to get a remote reference so it can call the required remote methods.

  • How to Start Java RMI Server Application as Windows NT Service

    Hi!!,
    I have problem regarding the Installation of Java Application as NT Service this Java app in turn will start RMI Registry using LocateRegistry.createRegistry() at some specific port number. The Service is created successfully but i have problem regarding the Accessing of this Remote Object using Lookup() .(ie) I am able to get the RMI Registry Obj Refererce of the Java Rmi Application but couldn't able to Lookup for the Object registered to this Rmi Registry.I am not able to proceed after getting the Rmi Registry reference.
    So any help Regarding this is appreciated.
    Thanks in Advance.
    with regards,
    Ramakrishna M
    Mail: [email protected]

    Hello,
    I have started a Java RMI Server Application as NT Service using JNT (download it from www.eworksmart.com/JNT/ ).
    It is working fine.
    S. Navaneethakrishnan
    [email protected]

  • RMI server doesn't reliably start

    I have a simple RMI server with one object that has one method:
    public interface Foo extends Remote {
          // the Blah class is Serializable
          java.util.ArrayList <Blah> getListOfBlahs (String name);
    public class FooImpl impelments Foo {
        java.util.ArrayLIst <Blah> getListOfBlahs (String name) {
                 // Do whatever...
    }My server is pretty simple at the moment and looks like this:
        public static void main (String [] args) {
            try {
                Foo stub = (Foo)UnicastRemoteObject.exportObject (new FooImpl(), 0);
                Registry registry = LocateRegistry.getRegistry();
                try {
                    registry.unbind ("foo");
                } catch (NotBoundException ex) {
                    System.out.println ("the thing isn't bound at the moment");
                registry.bind ("foo", stub);
                System.out.println ("Server Ready.....");
            } catch (RemoteException rmi) {
                rmi.printStackTrace ();
            } catch (AlreadyBoundException ex) {
                ex.printStackTrace ();
        }The problem is that sometimes when I start it, it promptly dies again with no error messages.
    A couple things:
    1) The server runs on a Fedora Core 8 machine, and the firewall is shutdown.
    2) Before I run the server, I make sure to start the rmiregistry.
    Usually I have to start the server a few times before the process doesn't just die again.
    My hypothesis is that it's trying (unsuccessfully) to bind my Foo class to a port that is in use, but why don't I get an error?
    Are there other log files to look at? Maybe in /var/log somewhere?
    Thanks
    -matthew
    Edited by: matthew on Aug 29, 2008 1:11 PM

    Yep.
    After making some static references to the remote objects, the server starts and stays running:
    class Server {
       private static FooImpl foo;
        public static void main (String [] args) {
            try {
                foo = new FooImpl ();
                Foo stub = (Foo)UnicastRemoteObject.exportObject (foo, 0);
                Registry registry = LocateRegistry.getRegistry();
                try {
                    registry.unbind ("foo");
                } catch (NotBoundException ex) {
                    System.out.println ("the thing isn't bound at the moment");
                registry.bind ("foo", stub);
                System.out.println ("Server Ready.....");
            } catch (RemoteException rmi) {
                rmi.printStackTrace ();
            } catch (AlreadyBoundException ex) {
                ex.printStackTrace ();
    }-matthew

  • Starting and stopping an RMI server

    I'm trying to figure out how to best stop and start my server.
    My server class has two executions. One for starting and one for stopping.
    Start Steps:
    1) create my remote object ( an extension of UnicastRemoteObject )
    2) create a registry ( LocateRegistry.create() )
    3) bind my remote object
    When I run this start method of my RMI server class, everything get's set up. I'm not doing any sort of waiting loop or anything to determine the lifecycle of my server. My understanding is that my rmiregistry, and my registered remote object, will continue to be available indefinitely. Perhaps this is incorrect.
    Stop Steps:
    When I want to stop the server, I'm calling my stop method. This is another invocation of my server class, so it's a separate JVM. In this stop method I want to do the following steps:
    1) get the registry that I created earlier, by port number
    2) get my remote object via reg.lookup()
    3) unbind my remote obect ( reg.unbind() )
    4) unexport my remote object ( UnicastRemoteObject.unexport ( myRemoteObj, true ) )
    My concerns here are whether this makes sense. Does the unexport method work like this? i.e. from a remote handle to the object -- I'm not in the local JVM when the stop method runs. Also, does the rmiregistry "just die" at this point? It's not holding anything and when my method exits there's no reference to it anywhere. Except maybe in client code . . .

    My understanding is that my rmiregistry, and my registered remote object, will continue to be available indefinitely. Perhaps this is incorrect.That's correct as long as you store static references to them both in the server JVM.
    My concerns here are whether this makes sense. Does the unexport method work like this? i.e. from a remote handle to the objectNo. You have to have the actual remote object. You could make shutdown() an RMI method itself.
    Also, does the rmiregistry "just die" at this point?No, you have to unexport that as well.

  • RMI server object getting garbage collected

    Hi all,
    I have seen a number of posts regarding the ConnectException and found that this can occur in a number of situations.
    I am having a problem here.
    I am having an RMI server that is always up and running. And the server object gets requests from the client at regular intervals. But, when the server object is not receiving any requests for a long time (ex: 1 day), then I think the remote object itself is getting garbage collected. And so, tough I am able to get the remote reference using the lookup method, I am getting "Connection refused to host: 192.168.0.216; nested exception is:
         java.net.ConnectException: Connection refused" when I call a method using this reference.
    I believe that this is because the server object getting garbage collected as there are no requests for the server since long. Please correct me if my assumption is wrong.
    I want to know, after how much time the server object gets garbage collected if no requests are received. But, my requirement is that the server object should always be available and WHENEVER a client request comes then that should be processed. What should I do to accomplish this task.
    If any one have any suggestions, please reply as soon as possible.
    Thanks in advance,
    srik4u

    You might do some research into using an activatable remote object. You run rmid (the rmi activation deamon) and register a subclass of java.rmi.activation.Activatable (instead of the usual UnicastRemoteObject) with it. With an activatable object, the remote reference to the activatable object doesn't need to have a live object behind it. If an activatable object is not running (ie: it hasn't been constructed yet, or it has been garbage collected ...as in your case) a remote reference to the object can still be exported to a client. The first time the client calls a method on the remote object, the activation service on the server sees the object is not active, and activates the object for the client. If the object is running ...it is rmi as usual. But if it gets gc'd again, the next invocation on the remote object will trigger the activation service again.
    (The above explanation paraphrases author David Flanagan from Java Enterprise in a Nutshell, O'Reilly)
    I have only built one of these, which loosely followed an example from the above mentioned book. It's a whole other ballgame over and above a regular rmi object. But like anything else, if you dig in and get your head wrapped around it, it eventually makes sense. Ok, why lie ...it confused the hell out of me and left me a little queasy. But you know the drill, by the time you build a few of them it will probably seem as easy as mapping the human genome, right? At any rate, it seems like what you might be after ...so have a look at it. Good luck, and wear your lifejacket.

  • Help me prevent restarting my RMI server

    I choose the RMI framework because I thought that this would support dynamic loading of classes. Now I'm beginning to doubt this feature, hope someone can fill in the blanks for me.
    The clients are built using Java Web Start. I use RMI for authentication and transactions (application events, files, etc.). The interfaces I use in RMI are very loose, they take an Object as parameter and returns an Object. I wrote it that way because I didn't know what functionality I would need in the future.
    Main problem: Compatibility issues when I rewrite classes on the client side....:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.io.InvalidClassException: jflex.rmi.RMIPostEvents; local class incompatible: stream classdesc serialVersionUID = 7574722854925780076, local class serialVersionUID = 8717205828862885031
         at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    yadayadayadayada.....
    How can get the RMI server to reload the client classes when this exception occurs? If I have to restart the RMI server everytime I modify RMI classes on the client the RMI technique is useless to me.
    Thanks in advance.

    OK, now I understand, and this is an interesting problem.
    I would have expected RMI to have annotated all remotely loaded codebase namespaces with a session id, to prevent this type of thing from happening. Not good. Unfortunately this issue is in the 'deep-water' of RMI internal implementation. The only expert on this I know on this forum is ejp. If you're reading this Esmond, little help here, please!
    It would seem that you are forced to also change the name of the implementation class of the JFlexServerTask implementation, or derive from it, a bit of a hassle for sure. Does the server hold persistent references to the loaded tasks? If not, the classes might be unloaded when the DGC runs, but again I am not sure of this. Also, you can never be sure when DGC will run. Otherwise it seems like over the long term, the server runtime could get pretty congested with unused classes.
    I guess I have not run into this problem before since I generally I do not allow servers to accept code from clients. The reason being that if there is an error in the client implementation, it can easily crash the server, accidentally or intentionally. Authentication I generally handle by sending the client a random value, which it then hashes with its password. (SHA or MD5 are good) Your present scheme could be easily cracked, unless you are running RMI over SSL, since your authentication object would be sent in plaintext over the network.
    However, I am guessing you want to send batch jobs to a server, on a highly trusted network. I'm not sure how to resolve the problem, this stumps me, and I have been doing this for a long time :-)

Maybe you are looking for

  • Tiger  won't start after install

    Hi there, I have just installed Tiger on the 2nd Hard drive in my G4 (533Mhz) but when I restart I get the prohibiting sign after awhile and nothing more happens. I'm running OS9.1 from the other HD but needed Tiger to upgrade to new dreamweaver. I'v

  • MIDI to MP3 Conversion

    Hello, I need some help about MIDI to MP3 Conversion, because I want to programme a MIDI to MP3 Conversion. Is it possible to realize? Could anybody give me some links for Information about this Conversion or some Code-Examples for this Conversion or

  • Although I purchased an audiobook directly from iTunes I cannot get it onto my 4th gen. shuffle. Any advice?

    I just purchased an audiobook  from itunes and I cannot get it on my ipod shuffle 4th gen.  I can get music on it just fine and i have the newest versions of my ipod's software and of itunes.  Any help is appreciated.

  • UnsatisfiedLinkError: ocijdbc10.dll: %1 is not a valid Win32 application

    we are running 64-bit Oracle client and getting the following exception in JDBC application when trying to use OCI JDBC URL: Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\oracle\product\10.2.0\db_1\BIN\ocijdbc10.dll: %1 is not a valid

  • Error in iPhoto pictures overlayed on video

    I have found a number of error which I'm surprised no one else has posted. Refer to the attached picture: http://i22.photobucket.com/albums/b322/chaosboi/imovie.jpg The first picture I have overlayed (top left of screen IMG_1129) is displaying an inc