Rmi server communicating with client

Is there any way for an rmi server to communicate back to the client? What I mean is, the client connects to the server and calls some method x(). One of the arguments of x() is the client(x(AClient ac)). Assume that AClient is a JFrame and has a method y() which adds a button to the frame or something. If the server calls ac.y(), in my understanding/experience, the server would actually create a local copy of AClient and add the button to the local copy, not to the frame that the client user is looking at.Is this correct? { 
  If so, is there any way to have ac.y() add the button to the client user's frame?
    If not, does anyone have any ideas for how to implement something like this relatively easily? 
If not, does anyone have any ideas why it's not responding that way for me?I'm trying to avoid programming socket connections for this, and would love to be able to do it with rmi.
Thanks in advance,
m

Not sure exactly what your starting point is. But:
1. The client must be a UnicastRemoteObject.
2. If your client is behind a firewall, then the scheme probably won't work. (Explored exhaustively in this forum.)

Similar Messages

  • Server communicates with client. I got a question.

    Hi everybody,
    i am writing two programs, a server and a client. i want to write an aplication like MSN Messenger. So between the server and the "Java Messenger" (client) there is much communication like when the messenger want to connect to the server and receive his friendlist, or when the client connects to the server and asks for the ip adress of a friend to open a chat and so on. so I began to create a ServerSocket and a Socket for connecting the clinet with the server. But when i want to transfer messages like "i want to change my status" so there is only the In- and Outputstream possible in the world of socket, isn'it? So the idea would be to send and receive codemessages like CHANGE_STAT or ADD_NEW_FRIEND and so on... there, i see two possibilities, one is to transmet the codewords in Strings and the second is to transmet the codewords in a object called "MessageTyp" for example.
    ok i think with this idea i will get the application Java Messenger functioning.
    But my question is, doesnt in the world of Java exists a technique where the client connects to the server and receives all required references to the server's objects and the client will simply execute directly the methodes of the server's object to receive his needs?

    What you can do is to use some tags like XML/HTML
    something like this - --
    whenever a plain message needs to be sent, you can send it through socket like this way--
    <MESSAGE> -- Plain Message </MESSAGE>
    For Controls like Buzz, <BUZZ></BUZZ>
    Of course this involves a bit of coding on the server side to decipher the information sent from the client. But this will definitely enhance your messenger abilities. Of course you can enhance the above by sending tags for BOLD, ITALIC & UNDERLINE, FONTS and what not ... !!!

  • Regular RMI server object with WebLogic JNDI

    Is that possible to register a regular RMI object with WebLogic JNDI
    tree? I was building a simple program (using javac and rmic only) based
    on the java.rmi.* (without changing the import statements to
    weblogic.rmi.*) and using the weblogic.jndi to register the server
    object. Below is some piece of code,
    Context ctx = null;
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL, "t3://172.20.20.20:7001");
    ctx = new InitialContext(ht);
    ctx.bind("HelloServer", obj);
    The code failed for the following reason,
    javax.naming.NamingException. Root exception is
    java.rmi.MarshalException: failed to marshal public abstract void
    weblogic.jndi.internal.NamingNode.bind(java.lang.String,java.lang.Object,java.util.Hashtable)
    throws javax.naming.NamingException,java.rmi.RemoteException; nested
    exception is:
    java.rmi.server.ExportException: A description for
    examples.rmi.hello.HelloImpl was found but it could not be read due to:
    [Failed to find examples.rmi.hello.HelloImpl_WLStub or
    examples.rmi.hello.Hello_WLStub for class examples.rmi.hello.HelloImpl]
    java.rmi.StubNotFoundException: Failed to find
    examples.rmi.hello.HelloImpl_WLStub or examples.rmi.hello.Hello_WLStub
    for class examples.rmi.hello.HelloImpl
    at
    weblogic.rmi.internal.BasicDescriptor.<init>(BasicDescriptor.java:101)
    at
    weblogic.rmi.internal.BasicRuntimeDescriptor.<init>(BasicRuntimeDescriptor.java:50)
    at
    weblogic.rmi.internal.DescriptorManager.resolveClass(DescriptorManager.java:55)
    at
    weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:39)
    at
    weblogic.rmi.internal.DescriptorManager.getDescriptor(DescriptorManager.java:30)
    at
    weblogic.rmi.internal.OIDManager.getRequestDispatcher(OIDManager.java:281)
    at
    weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:270)
    at
    weblogic.rmi.internal.OIDManager.replaceObject(OIDManager.java:98)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:55)
    at
    weblogic.common.internal.ChunkedObjectOutputStream$NestedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:239)
    Any idea?
    - SteveC

    "Pyung Yoon" <[email protected]> writes:
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);This implies JRMP which the server does not support. You need to use t3 or iiop.
    andy

  • HowI get Address Book Server sync with clients?

    I have just set up Lion Server on a macmini and am learning how to set it up.  I cannot get address Book server to sync with client accounts.
    The server is function is active.  The users are properly set up, and the clients have been connected to the server and a Mac OSX Server Address Book created.  I have also set up the address book on the Mac Mini with an OSX Server addresss book.  It should show the same entries as the client and sync wherever changes are made.  Not a sausage....nothing......  The little 'wheel' whizzes round and does......... you have got it........ nothing.
    I thought this was easy to use?
    Any help would be welcome.

    Hi,
    Yes the sync tool is a standalone utility (you don't need the outlook connector installed). I finally got around to installing/configuring the latest version (comm-suite-5 sync tool) against my 2005Q4 test install.
    The addressbook server is the UWC address as I mentioned before but you also need to include the /uwc on the end.
    So for my system I have the following setting:
    local.sso.uwc.verifyurl = http://test-system.sun.com:82/uwc/VerifySSO?
    This maps to a :
    => Address Book Server: test-system.sun.com/uwc
    => Port: 82
    So in your case it would be:
    local.sso.uwc.verifyurl = http://hostname:6788/uwc/VerifySSO?
    => Address Book Server: hostname/uwc
    => Port: 6788
    Regards,
    Shane.

  • RMI-Server "checks" when Client closes RMI-Connection

    Hi there!
    I hope somebody can help me...
    I'm developing a client/server application where my client calls a remote method and my server starts working (i.e. 5-7 minutes batch processing).
    Is there a way my server "gets informed", when RMI connection is closed (network failure, client closes)? In this situation the server should perform a rollback, delete generated files, etc.
    I don't know if there is thrown a exception inside the server method, which I can catch ....
    Any suggestion is welcome ..
    Best Regards
    Anton

    Thanks a lot, I will have a look at the tutorial.
    Initially my thoughts on this issue were:
    -) The Client-RMI call is made in an own Thread (There are several things to do before job processing can start on the remote machine).
    -) when the RMI call is processed, the thread gets blocked, so doesn't add load to the machine (hope so).
    -) RMI does the "alive-checking", when network connection fails the client can mark the job as failed. The called server should also do some rollback. So I do not have to implements callback-listeners to react on server callbacks
    -) But I'm worried about open connections, running out of socket resources and that there is no way to abort a endless running job.
    This is my first aproach to solve this problem, I would be very glad about any comment ...

  • NI OPC server communication with B&R plc

    hi,
    I have a NI OPC server in my lab . I want to send the data from B&R plc to the OPC server. I have tried to search for a solution but could not find any.
    Kindly help me in establisihng a communication between the B&R plc and the OPC server.
    Regards

    Did you try installing the B&R PLC OPC server on a computer and then see if the NI OPC server can connect to it?  It might not be the most elegant soloution, but it might work.
    We were having problems with some siemens wincc software that would not connect to the Think&Do OPC server.  So I had to bring the Think&Do OPC tags into LabVIEW and then have LabVIEW broadcast the data so the Semens OPC software could see it.  I did not like doing it, but it worked.
    Other than that, maybe someone else will have more to offer.

  • Send Message from RMI Server to RMI Client

    Hi,
    I want to send message to RMI Client throw RMI server to refresh client's data object as it is database application. I guessed i could implement an interface on client side and i can register my client to the server by sending object to the server. It is not helping it is throwing NULL Pointer exception on server side and it is not refreshing. It seems like it is not passing by reference.
    Can any one please guide me with how to send messages to clinet. What is the best way to do it?
    -A Thakkar.

    You need to elaborate the object model of your client. When you run into this situiation where you might have to sublass two different objects, then you should take a look at breaking the client itself into more than one object.
    Let me put it another way: A JFrame is a GUI object; why would you ever try to callback a GUI object? Can't you create - say - a CallbackHandler, and let it initiate further action in the client?

  • Fundamental question: disable the GUI while RMI is communicating?

    Good afternoon,
    I'm using RMI in a swing application and i have fundamental question:
    I have a jlist with categories and another jlist which displays the items of the selected category. When a user selects a category rmi is used to get the items of the selected category from the server (internet).
    Should i disable the whole application while rmi is communicating with the server? For example with a glasspane with a cancel button.
    What is the best practice in this case?
    Best regards,
    James

    I found a really nice solution, now i call my remote methods like:
    taskManager.executeAction(new ITaskResult(){
          public void done(Object result) {
            Collections.sort(rpcs, new RpcComperator());
            fireContentsChanged(this, 0, getSize());
          public void failed(Exception e) {
            WindowUtils.showErrorDialog(owner, "Could not change server");
        }, new IAction(){
          public Object action() throws DBException, AccessException {
            return taskManager.getBasic().changeRpc(rpc);
        }, true);The first parameter of executeAction() is a object which gets notified when a task completes (done()) or fails (failed()). The second parameter is a object which indicates which remote functions should be called. And finally the third parameter defines if the user should wait until the remote function completes.
    If the user should wait the executeAction() function shows a nice modal dialog with a progressbar and a cancel button. If the user doesn't have to wait it takes the progressbar on the statusbar to indicate the system is busy.
    Much rewriting was needed, but i think it is quite simple and it is fully swing thread save. But it wonders me that such a thing wasn't available.

  • RMI recovery and multi-client questions

    Hello,
    I'm new to RMI and managed to get a sample HelloWorld-code running. After secceeding two major questions came up.
    1) If the RMI server is running and the registry server crashes and is restarted, then the new instance of the registry server does know anything about the still running RMI server. What do you need to to that the RMI server rebinds. My idea is that the RMI server must be multithreaded, controls in the background the registry and automatically rebinds after a crash. Any other easier and even better solutions?
    2) My impression is that there is one instance of the RMI server waiting for incoming requests. What happens, if a request takes a long time and a second request from a second client comes in? How can it be achieved that one RMI server handles many client requests? I know for database connections ther is something like pooling. Do you need to implement a similar technique for RMI.
    3) Would the implementation of a web service avoid the problems mentioned above?
    Thanks for any suggestions or hints to related topics.
    Regards, Rainer

    Hi carr_onstott ,
    thanks for clarification and the suggestion to start the name service withing the own application. � need to discuss this approach with the customer, normally there is one and only one name service on a server using the default port. With your suggestion I need to reserve a second portnumber and moreover standard tools providing a list of registered RMI servers will not detect my RMI server.
    The problem I see with web services is that we plan to exchange huge binary data byte[] and this is not really what web services are made for. There are sultions to use multibodypart to transfer the XML web service request/response, but the amount of data increases dramatically.
    Regards, Rainer

  • Load balancing on RMI Server Application

    Hi there, I'd like to know more detail about load balancing on RMI server application, been digging the web for some time, but couldn't find much information, does anyone know any website or has the knowledge of load balancing on RMI to share? Sort like its design and implementation.
    Thanks,
    Jax

    I want performance and fault-tolerance,
    In that case, is it necessary to have a main
    rmi server to allow client to access and pick one of
    the rmi servers for the client?Well, if you have one main RMI server, you have a single point of failure again.. Why can't your application know about all rmi servers, and randomly choose one? If it's down, pick a different one.. If your applicatoin is an applet, you'll have to sign it.. Do that and put it on 2 redundant web servers. You have performance by splitting the load and you have your fault tolerance by having x identical rmi servers.
    If you're saying what I think, why would you have one main rmi server that picks a different rmi server? That's more work AND your redundancy goes byebye, ie if your main rmi server dies..

  • Cannot install Crystal Reports Server 2008 and Client Tools on same machine

    I am having trouble setting up Crystal Reports Server 2008 with Client Tools on a new Windows 2003 SP 2 machine. The Server 2008 package installs OK (built-in MySQL server, built-in Tomcat 5.5 server). Reports run okay. But my customer wants to run reports that use Salesforce as a data source, so I tried to install Crystal Reports Server 2008 Client Tools (needed  for Salesforce support, apparently). I receive this error:
    'Business Objects product detected: cannot continue with install'. Installation of Client Tools immediately terminates.
    Oddly enough, when I uninstalled Server 2008, the Client Tools installed successfully. Then I tried installing Server 2008, and I got the same error message as with Server 2008. What the heck?
    Any ideas on how I can get Server 2008 and Server 2008 Client Tools to live in harmony on the same machine? We were able to do this with a (otherwise overloaded) Win2K3 server before.
    Thank you in advance for any help.

    Typically the client tools are installed with enterprise by default. If not then you would want to use add/remove in control panel and select them. The installer thinks you are trying to install enterprise on top of itself and thus the error.
    Regards,
    Tim

  • Is OSX Mountain Lion Server Compatible with Snow Leopard

    Is Mountain Lion Server compatible with Clients running on Snow Leopard?

    We haven't had any problems with Home Directories hosted on 10.8.2 on a small number ol 10.6 clients. The only issue is that you can't use Workgroup Manager 10.8 on the 10.6 machines to allow 10.6-only apps. If you have a mixture of 10.6, 10.8 or 10.7 clients the user's prefs for things like Mail get screwy due to the different schema.

  • SAP BI Client tools are not communicating with BO server

    Hi Experts,
    We've recently installed BI 4.1 . We're having few issues:
    1. When client is installed on different machine then it is not communicating with server. We've already tried few things like untick auto assign from Request server and manually assign static port but it didn't work .
    2. Our BO Server is running on AWS Cloud.
    3. Client is communicating when installed on server machine.
    4. Could you please help our how to resolve this error.
    5. CMC and BI launch pad are installed on server side as they're web browser tool and we need to install these on client machine as well. Qns is Do we need to install them or provide just URL link? If just URL like where to get these URL links.
    6. We can't see SAP Lumira and SAP Dashboard on Service market place to install. Where we can find these software on Service maket place?
    7. Could someone please send screenshot to install Dashboard, Lumira, Analysis office and Crystal report enterprise and crystal report 2013.
    8. Do we need to install all these on client machine?
    9. Could you please give me software list which should be installed on client machine?
    10. As i know there is life cycle management tool but it is not even available from server side not even on client side. Could you please recommend how it can be installed??
    Thanks in advance.

    1. When client is installed on different machine then it is not communicating with server. We've already tried few things like untick auto assign from Request server and manually assign static port but it didn't work .
    Could you confirm that you are able to ping the BO server from Client machine. Also use telnet command from commandline of  CMD in client machine. It will help to confirm that port communication is successful. Use ipaddress:cmsport for the system while logging into the client software. Update the hosts file entries at client machine with BO server name and ip address. Create an exception for BO installation location at client machine and check the results
    2. Our BO Server is running on AWS Cloud.
    3. Client is communicating when installed on server machine.
    4. Could you please help our how to resolve this error.
    5. CMC and BI launch pad are installed on server side as they're web browser tool and we need to install these on client machine as well. Qns is Do we need to install them or provide just URL link? If just URL like where to get these URL links.
    Check on the server side first where your web server is installed (I am assuming tomcat in your scenario). Use http://serverame:8080/BOE/BI and http://servername:8080/BOE/CMC (8080 is default port. If it has been changed use the correct port).
    If its working well. Perform the same activity using ipaddress:8080 at server. Next chek whether using the same URL you are able to get BILaunchPad and CMC pages and able to login from the same.
    6. We can't see SAP Lumira and SAP Dashboard on Service market place to install. Where we can find these software on Service maket place (https://service.sap.com)?
    Software and downloads-->Installations and Upgrades
    - D" SBOP DASHBOARDS (XCELSIUS)
    7. Could someone please send screenshot to install Dashboard, Lumira, Analysis office and Crystal report enterprise and crystal report 2013.
    Look into the admin guide for installation pre-requisites. These are available at Analytics Knowledge Center
    We have a drop down for all products. Look for the guide and proceed with the installation.
    8. Do we need to install all these on client machine?
    Dashboard,Lumira,analysis office, CRE and CR2013 are client tools and hence need to be installed on client machine.
    We also have CRS 2013 which is a server software and has to be downloaded from service market place. The li
    9. Could you please give me software list which should be installed on client machine?
    These vary according to user requirements. Check with developers for their softwares needed
    10. As i know there is life cycle management tool but it is not even available from server side not even on client side. Could you please recommend how it can be installed??
    In BI4.1 LCM comes by default. It is a server application. You can find it in CMC named as Promotion management and version management.
    Use the admin guide and installation guide for all of the above. It will help you.

  • Last Contact with Server - Client Quit Communicating with Server

    Hi,
    Is there anyone with the same problem we're experiencing below?
    6 Windows 7 clients and 1 Windows XP client (10.2.2)
    All 6 Windows 7 clients quit communicating with the server after a while.
    Last contact with server time stamp doesn't change on both the client and
    server. Next contact with server does, but the client doesn't refresh. If I
    try to remote control, I can't. If I assign a new bundle, it doesn't work.
    However, I can login to the Zen agent.
    I can unregister the client locally and reregister and the client will
    communicate with the server for a while and it will then stop communicating
    again after several hours or couple days.
    All but the sole Windows XP client are having this issue. Windows XP client
    is also the first client registered in the server.
    thanks

    JS,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • One RMI server with 2 different clients

    I have an RMI server which implements 2 different remote interfaces (call them InterfaceA and InterfaceB).
    I then have 2 client programs, ClientA and ClientB, each using their respective interface.
    When I try to run ClientA, I get a ClassDefNotFound exception for InterfaceB - which CientA never references.
    I'm thinking it is because there is only one Stub class for the server, meaning it has info on InterfaceA and InterfaceB.
    My questions are:
    Is it possible to make 2 seperate stub classes from one implementation class?, one for each interface?
    If not, is there some other way I can do this setup?

    Why not have two classes on the server:
    ClassA implements interfaceA
    ClassB implements interfaceB
    and bind both
    objectA (instance of ClassA) for clientA, and
    objectB (instance of classB) for clientB.

Maybe you are looking for