rmi

RMI + java reflection

不想你离开。 提交于 2019-12-21 05:16:13
问题 I'm using RMI to allow access to my Java application via MATLAB, which runs in another JVM. MATLAB has a nice interface to print the methods of a Java object. But it fails with RMI, because the object it gets is a proxy. So I would like to add my own method to extract/print the capability of a remote interface (RMI obviously can't directly access methods not available in exported remote interfaces). How could I do this with reflection, either on the client end of the RMI connection, or on the

RMI server: rmiregistry or LocateRegistry.createRegistry

∥☆過路亽.° 提交于 2019-12-20 18:29:33
问题 For RMI on server-side, do we need to start rmiregistry program, or just call LocateRegistry.createRegistry ? If both are possible, what are the advantages and disadvantages? 回答1: They're the same thing... rmiregistry is a separate program, which you can run from a command line or a script, while LocateRegistry.createRegistry does the same thing programatically. In my experience, for "real" servers you will want to use rmiregistry so that you know it's always running regardless of whether or

java/spring- getting NoClassDefFoundError at org.springframework.context.support.AbstractApplicationContext

*爱你&永不变心* 提交于 2019-12-20 05:31:20
问题 I am trying to initialise an RMI client for which I have used Spring. Now, the application's RMI context is stored in file= rmiClientAppContext.xml The relevant code for using the above file is given below-- //RMI Client Application Context is started... ApplicationContext context = new ClassPathXmlApplicationContext("rmiClientAppContext.xml"); However, when I try and run the program, this is the error I am getting-- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache

Java RMI not closing socket after lease expiration

徘徊边缘 提交于 2019-12-20 04:13:18
问题 My RMI enabled application seems to be leaking sockets. I have a Java application providing a service over RMI. It is using the Java SE 1.6 RMI implementation running on Linux. The problem I am observing is that if a client obtains a reference to my Remote object, using the Registry, and then the connection is severed abruptly (power loss, cable unplugged, etc...), the server keeps the socket open. I would expect the RMI implementation to clean up after the client's lease expires, but that is

Writing a secure RMI server-client application

我们两清 提交于 2019-12-19 09:27:57
问题 I'm writing a server-client application where communication is done over the internet and I have several questions and concerns regarding security. I have done some research and found some posts here useful, but I would like more information. Some related questions I read were: Secure authentication of client over RMI java rmi authentication & security. exportObject makes it public? Is communication in java rmi secure? I have 3 parts to consider: Information exchanged between the client and

Difference between classes java.rmi.registry.Registry and java.rmi.Naming

自古美人都是妖i 提交于 2019-12-18 13:01:45
问题 What is the difference between the Registry class and Naming class. In my application I am using Registry class. But I want to know about Naming class and its uses ? 回答1: The difference is that Naming is a utility class with static methods, while Registry is a remote interface. Unsurprisingly, Naming calls Registry internally. Note that the name arguments you pass to java.rmi.Naming are in URL format, and include the location of the registry, whereas with java.rmi.registry.Registry , the name

RemoteException java.rmi.UnmarshalException: error unmarshalling return [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 13:01:31
问题 This question already has answers here : java.rmi.ServerException: RemoteException occurred in server thread (ClassNotFoundException) (4 answers) Closed 2 years ago . I'm running the program here on 2 JVMs on diff physical machines. I get the error RemoteException java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: CalculatorImpl_Stub (no security manager: RMI class loader disabled) I've even tried running it on the same machine

What is the difference between Java RMI and RPC?

元气小坏坏 提交于 2019-12-17 21:38:16
问题 What is the actual difference between Java RMI and RPC? I have read in some places that RMI uses Objects? 回答1: RPC is C based, and as such it has structured programming semantics, on the other side, RMI is a Java based technology and it's object oriented. With RPC you can just call remote functions exported into a server, in RMI you can have references to remote objects and invoke their methods, and also pass and return more remote object references that can be distributed among many JVM

How do I set the classpath that rmiregistry uses?

≡放荡痞女 提交于 2019-12-17 16:44:13
问题 I'm trying to make a Java RMI client/server app. I'm running into problems starting up the server side of my app, as it keeps running into a ClassNotFoundException during the call to the Registry.bind() method when I attempt to start up the server side of the app. I started with the simple tutorial here: http://docs.oracle.com/javase/1.5.0/docs/guide/rmi/hello/hello-world.html. After following those instructions, it was initially throwing a ClassNotFoundException complaining that it couldn't

Is it possible for a thread to Deadlock itself?

自作多情 提交于 2019-12-17 10:18:43
问题 Is it technically possible for a thread in Java to deadlock itself? I was asked this at an interview a while back and responded that it wasn't possible but the interviewer told me that it is. Unfortunately I wasn't able to get his method on how to achieve this deadlock. This got me thinking and the only situation that I can think of is where you can have this happen is where you have an RMI server process which contained a method that calls itself. The line of code that calls the method is