Uses Of RMI

Hello Everyone,
I am new to RMI technique. Can you please brief me about the uses of RMIs. Also, I am in a doubt that RMI is used only when using EJBs.
Thanks!!

EJB's utilize RMI "under the hood". However, you can certainly write your own RMI application without a J2EE app server or container or whatever. Yes, you can write a client/server application using RMI. The advantage is that you can directly call methods on other machines (i.e. no messy TCP/IP socket programming). Anyway, check out the tutorials and articles to learn more.

Similar Messages

  • Using of RMI on KVM

    Hallo programmers
    I have problem with use of RMI technologie on Palm Pilot.
    I would like know, if I can use this technologie on PDAs with little memory and slow processing. I think that I can use java virtual machine KVM which is more constricted then JVM.
    But I have dread that it is more memory demanding.
    Is there anybody who can help me and write me some manner of solvetion of this problem ?

    ...for me, I want to have EJB work on Palm and a full HTML compliant browser with SSL and a flash plug-in, and... hum... what about make coffee... after all, it's JAVA ;)

  • Failover when using weblogic rmi

    does anyone that
    if i keep some plain java objects in collections in a RMI server using
    weblogic RMI.
    will the java objects be available to me on the new server it fails over to?
    iam using weblogic servber 6.0 sp 1
    the collections hold plain old java objects(POJO)
    Mridul Paliwal

    Hi Giuseppe --
    I would open a service request with Oracle support for this.
    -steve-

  • Why we need to use the RMI if you have JSPs? or vice versa

    Hi friends,
    Can anyone please explain me whats the difference between RMI and JSP?
    All I know is how to code and implement them both but can't figure out which one has more advantage than the other.
    Actually this was the Interview question asked to me once,
    The question was "Why we need to use the RMI if you have JSPs? or vice versa"
    Please let me know if you have any answers for this.
    Thank you.

    harsh884 wrote:
    Well I may not have very deep knowledge about them both but from the little bit of coding practice and implementation I know that too, that they are different technology and the implementation is also different. But didnt know what to answer for this question to interviewer.My answer would have been along the lines of using the right tool for the requirements. Use RMI when you want to work with remote objects "directly", but don't want to hassle with handling all the networking manually or restrict yourself to the HTTP protocol and an inappropriate use of the view layer in model 2 applications.
    Thanks anyways for the reply.You're welcome. How did the rest of the interview go?
    ~

  • Using an RMI Client to connect to a Server.

    I am using an RMI Client on my PC (using Eclipse 3.2) to connect to a Server on a Linux System.
    The Server is up and running and from the client side,I am reading all the server configuration into a variable and passing this variable into Naming,lookup.
    String lookUp =     "//" + prop.getProperty("rmi.hostName") +
                          ":" +  prop.getProperty("rmi.appPort") +
                          "/" +  prop.getProperty("rmi.appName);
    System.out.println(lookUp)   // Value://17.10.222.80:40009/RMIAPP
    Application a =  (Application)Naming.lookup(lookUp)     It is unable to connect to the Server.
    Am I missing anything? Have I overlooked any point?
    Thanks

    http://java.sun.com/docs/books/tutorial/rmi/index.html

  • Can a Java stored proc make use of RMI/CORBA?

    Folks:
    I'm in a situation where an update to a table needs to notify a remote Java object. My intent here, then, is to write a trigger to fire a Java stored procedure.
    In the stored procedure, is there any reason why I can't use RMI or CORBA to notify the remote Java object?
    Thanks,
    - Alex -

    I am also looking into having a trigger call a Java Stored procedure that calls a remote application in order to notify it of new messages in a message queue.
    I have looked at some of the sample code on OTN "hotel.java" I don't see a reason that this can't be done. Has anyone done this successfully using RMI?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alex Nghiem ([email protected]):
    Folks:
    I'm in a situation where an update to a table needs to notify a remote Java object. My intent here, then, is to write a trigger to fire a Java stored procedure.
    In the stored procedure, is there any reason why I can't use RMI or CORBA to notify the remote Java object?
    Thanks,
    - Alex -<HR></BLOCKQUOTE>
    null

  • Remotely control your PC from ANYWHERE in the world using JAVA/RMI!

    I have just developed a project named XtremePC.
    This well commented Java project involved RMI technology, can be used to control the server from anywhere in the world including features of listing running processes, file transfer, shutdown/logoff/lock/restart server PC, execute programs, browsing in DOS/Linux fashion. The server is protected by encrypted password. I bet my time and energy on this project most for increase the strength instead of designing GUI. In response to huge request from AIUB, Bangladesh teachers and students for uploading my project of Object Oriented Programming-1 course, I have decided to come up with this Java RMI project with source code!! (Tested on jdk1.3, 1.4)
    Get it from the MyDownload section of my homepage: www.tanzim.tk
    Thanks!
    -- Tanzim Saqib
    [ www.tanzimsaqib.tk ]

    and how many backdoors did you build into it so you can take over all those
    machines and turn them into zombies? lol

  • Last use of RMI object instance

    I have an RMI object with instance variables. As clients of this
    remote object method make calls on it, these instance variables
    are used and modified. My question is; Is there a way where I can
    check when the last call from the client where made using a certain
    instance?
    Do I have to have separate timer methods for each instance to track
    the time elapsed since last use?
    Any answers are appreciated.
    /Mats

    Perhaps you could post something describing what you are trying to do. (Sounds like you want to keep track of last-used-time on a bunch of data elements?)

  • 10.1.3 cache synchronization using custom RMI code

    I am trying to port our custom RMI synchronization code (overriding RMIClusteringService) from 9.0.4 to 10.1.3.
    It works by sending an update message to the remote cache whenever an object gets changed on the local cache as follows:
    2006.05.15 11:28:38.117--ServerSession(1102039280)--Thread(Thread[RMI TCP Connection(926)-19.39.48.136,5,RMI Runtime])--Received updates from Remote Server
    This message then results in a trip to the DB to get the object updates.
    Per 10g documentatation, the changed notification should contain the changed attributes (change set) and this should not result in a DB trip for the remote cache. I am not seeing this behavior.
    This is probably because I was using the old (9.0.4) sessions file with our custom cache synchronization manager, which overrides toplink cache sync settings, as shown below:
    <cache-synchronization-manager>
    <clustering-service>
    oracle.toplink.remote.rmi.polling.RMIPollingClusteringService
    </clustering-service>
    <naming-service-url>localhost:1099</naming-service-url>
    </cache-synchronization-manager>
    <event-listener-class>
    oracle.toplink.remote.rmi.polling.RMIPollingClusteringServiceSessionEventAdaptor</event-listener-class>
    With 10.1.3 RMIClusteringService is deprecated and replaced by RMITransportManager. A whole bunch of other classes has been added. Has anyone migrated or written RMI custom cache sync code to use RMITransportManager? If so, can they share their experiences and/or send their code samples? Any other thoughts will be appreciated too.
    thanks,
    Prabodh.

    I am trying to port our custom RMI synchronization code (overriding RMIClusteringService) from 9.0.4 to 10.1.3.
    It works by sending an update message to the remote cache whenever an object gets changed on the local cache as follows:
    2006.05.15 11:28:38.117--ServerSession(1102039280)--Thread(Thread[RMI TCP Connection(926)-19.39.48.136,5,RMI Runtime])--Received updates from Remote Server
    This message then results in a trip to the DB to get the object updates.
    Per 10g documentatation, the changed notification should contain the changed attributes (change set) and this should not result in a DB trip for the remote cache. I am not seeing this behavior.
    This is probably because I was using the old (9.0.4) sessions file with our custom cache synchronization manager, which overrides toplink cache sync settings, as shown below:
    <cache-synchronization-manager>
    <clustering-service>
    oracle.toplink.remote.rmi.polling.RMIPollingClusteringService
    </clustering-service>
    <naming-service-url>localhost:1099</naming-service-url>
    </cache-synchronization-manager>
    <event-listener-class>
    oracle.toplink.remote.rmi.polling.RMIPollingClusteringServiceSessionEventAdaptor</event-listener-class>
    With 10.1.3 RMIClusteringService is deprecated and replaced by RMITransportManager. A whole bunch of other classes has been added. Has anyone migrated or written RMI custom cache sync code to use RMITransportManager? If so, can they share their experiences and/or send their code samples? Any other thoughts will be appreciated too.
    thanks,
    Prabodh.

  • How to find Port numbers used by RMI application

    Hi, hope u all find me a solution, how to find port numbers used in the RMI application, that is port number which the RMI application communicates between RMIserver and RMIclient. ur answers would b highly appreciated

    Currently RMI transport layer does not directly expose any public methods to get the listening ports of the exported RMI objects, but the application can always export RMI server objects at certain designated ports instead of relying on the RMI runtime by specifying them to UnicastRemoteObjcect at the time of exporting.
    RMI transport layer try to optimize the number of listeing sockets by exporting all RMI server objects on a single port if no explicit ports were chosen. If the application is really interested in knowing the listeing ports, it can always specify the client and server socket factories to be used for creating Socket and ServerSocket to the RMI runtime at the time of exporting. When a RMI server object is exported, but the listening socket is not yet created, RMI transport layer invokes the createServerSocket(host, port) of server socket factory by passing the host and port details. If no explicit port is specified, underlying socket implementation choses anonymous port. At this point of time application can log these listeing ports to some log file.
    Similarly when the stub to the remote object is de-serialized in the client address space, it does also contain the client socket factory along with the end point details (host, port and server object ID). RMI runtime in the client address space needs to establish connection with the remote server object, it try to get the socket from client socket factory by invoking createSocket() on the client socket factory. Now the application can call getLocalPort() on the socket before returning it to the RMI transport layer.
    There is a undocumented class RMIStat to dump RMI runtime state information. It provides a lot of static methods to dump RMI state information like object table, transports, threads etc. You can download the source code of this utility from RMI archives, but remember this is not a comman-line utility, you must invoke these static methods as part of the application code.
    -- Srinath Mandalapu

  • TCP connections used by RMI

    hello,
    I tried making a simple RMI application to check about the usage of TCP connections for the communication. The client and server are running on different hosts and my observations are:
    a) when the client is invoking a method on the server at an interval of about 1 sec, then the same connection is used everytime for the communication.
    b) when the client is invoking a method on the server at an interval of about 30 sec, then the a new TCP connection is made everytime for the communication !
    The java.rmi.dgc.leaseValue is set to 100 minutes in both cases. Does this not mean that the connection should be maintained for 100 minutes even if there is no communication between the client and server ??

    thanks, I could not find any parameter in the standard properties list, however in the SUN specific properties we do have sun.rmi.transport.proxy.connectTimeout which should control the connection life. I use IBM's JRE, so I will try to find an equivalent property.
    Another question ... what is the benefit of java.rmi.dgc.leaseValue if the TCP connection is closed itself ? Does the gc not happen if the TCP connection itself breaks ? Or does the RMI think about a logical connection which is independent of TCP connection's life ?

  • Distributed architecture using JAVA RMI

    Hi!
    I want to implement a distributed architecture, in which clients invoke any of several servers, depending on their availability. The clients are not browsers, so web-server (e.g. Tomcat) clustering is not relevant here. It's a cluster of servers, each capable of providing the same functionality, but clients should be able to "find" the less loaded one and invoke it. Now, with EJB's I believe this is provided out-of-the-box, but what about using RMI? How do two processes find each other via RMI, and is it possible to put a load-balancer in the middle?
    Is it possible to setup a load-balancer IP as RMI host endpoint?
    Thanks a lot
    A.

    They find one another using the rmiregistry tool from the JDK bin, which servers register with and clients use as a lookup. AFAIK this doesn't provide provision for anything resembling load balancing. Java RMI is a fairly basic facility.
    You should probably take a look at a framework like osgi.

  • What protocol is used in RMI?

    When Client and sever are connected and talk to each other what protocol they used?
    Qurban Ali
    [email protected]

    They use JRMP (Java Remote Messaging Protocol) in "normal" RMI. However, they can now use RMI-IIOP (or RMI over IIOP, IIOP being Internet Inter-Orb Protocol) which allows RMI-implemented Objects to talk to CORBA objects I believe. You can generate Stubs/Skels with this protocol using the -iiop argument to the rmic command.

  • Vast use of RMI.

    Imagine haveing a server application connected with a database. Useing either JDO, Hibernate, or JDBC to connect with this database.
    Would you create a client application that connects with the server application and make use of this database information using RMI?
    My worries are:
    1. Whearter the connection will be slow. Imagine having a dial-up connection or even worse a J2ME client.
    2. Would it be secure. Would the transfered data be potientially reached by someone else?

    But from how I see it, one has two options in distributed applications (wheather or not using J2ME).
    The first option is to retrieve all that may be needed. at once, work on that data and then you send the changes back to the server when ready.
    Otherwise you could get the data needed for the particular task, make changes and send changes.
    So the difference between the two aproches is how much data is being retrieved and how often.
    If you go with the first aproach you will have a lot of time waiting for all the data (for all different tasks) to come, and a lot of data in the end when sending the changes (since sending changes for all tasks). However no time is used between one task and another.
    In the second aproach you are retrieving small ammount of data and thus it takes less time (since you retrieve data for one single task), and also less time when sending the changes back. However this small ammount of time will be repeated when passing from one screen to another.
    Now, If I go for the first scenario I would have no problems using sockets. But for the second scenario I see RMI as a fast way and more profesional way.
    Also RMI would make the database calls much more understandable from the client side application.
    I personally never programmed a J2ME or a full RMI application, so all the advise in the matter would really mean a lot to me.
    Thanks for all the posts so far and the URL's :)

  • VersioningError when Using JDBC driver for SQL Server with RMI

    Hi,
    I wrote a simple class for inserting rows into a database. The database is SQL Server 2000, and I am using weblogic's mssqlserver4 driver. The class works fine, but when I try to export the class as a remote object (using Sun's RMI implementation, not Weblogic RMI), I get the following error:
    Exception in thread "main" weblogic.common.internal.VersioningError: No WebLogic packages defined in CLASSPATH at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:35) at weblogic.version.<clinit>(version.java:18)
    at weblogic.jdbc.common.internal.FileProxy.initFileHandles(FileProxy.java:30) at weblogic.jdbc.mssqlserver4.BaseConnection.prepareConnection(BaseConnection.java:215)
    at weblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:34) at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:151) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171)
    Can anyone tell me why this happens? What is difference between using the driver standalone and using it with RMI? Does it have anything to do with the fact that I'm using Javasoft RMI and not Weblogic RMI? I'm pretty sure I have the classpaths set up correctly.
    Thanks,
    Bo

    Bo Min Jiang wrote:
    Hi,
    I wrote a simple class for inserting rows into a database. The database is SQL Server 2000, and I am using weblogic's mssqlserver4 driver. The class works fine, but when I try to export the class as a remote object (using Sun's RMI implementation, not Weblogic RMI), I get the following error:
    Exception in thread "main" weblogic.common.internal.VersioningError: No WebLogic packages defined in CLASSPATH at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:35) at weblogic.version.<clinit>(version.java:18)
    at weblogic.jdbc.common.internal.FileProxy.initFileHandles(FileProxy.java:30) at weblogic.jdbc.mssqlserver4.BaseConnection.prepareConnection(BaseConnection.java:215)
    at weblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:34) at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:151) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171)
    Can anyone tell me why this happens? What is difference between using the driver standalone and using it with RMI? Does it have anything to do with the fact that I'm using Javasoft RMI and not Weblogic RMI? I'm pretty sure I have the classpaths set up correctly.
    Thanks,
    BoHi. Show me the whole stacktrace of the exception. The issue seems to be the driver licensing
    code, which is looking for the bea.license file, and not finding it. Have your code run a System command
    to find and print out the classpath it thinks is in effect. You will then see if the license file is there.
    Joe

Maybe you are looking for

  • How do I print invoice on a new created form?

    Hello, I'm trying to implement a new invoice that will coexist with the old one. I performed the following steps: 1.     the form ZRVINVOICE01 is copied to ZNEWINVOICE 2.     the form ZNEWINVOICE is modified and activated 3.     in transaction V/40 I

  • How do you import photos from iphone5 to pc (windows 7) without duplicating

    Every time I plug my iphone 5 into the laptop (using windows 7) the easiest way is to right click on the portable device (iphone icon) and import to my pictures, BUT every time I do this it wants to import ALL photos and videos. Is there a simple way

  • Thumbnail preview freeze??

    I have several videos in the iPhoto library. When i "scroll" across to preview or press the space bar to preview, the preview will only work with the first set of clips. When I move down to preview the other clips in the list, the preview window free

  • How find which method-class will be selected?

    Hello sap gurus, I have another question: There are 2 the same methods: customer_exit_event_save, BUT in different classes. One for the class CL_EX_BCA_PO_CUSTOMER_EXIT, another from the class ZCL_IM_BCA_PO_CUSTOMER_EXI Not fully clear how the system

  • SWC reference by name!

    I got a SWC file that includes a class name Helvetica var helvetica:Helvetica = new Helvetica();    <-- this works but i want to work it like this: (couse i have a flashvar that sends the name with font to embedd) var helvetica:* = getDefinitionByNam