rmi

How do I ensure that RMI uses only a specific set of ports?

In our application, we are using RMI for client-server communication in very different ways: Pushing data from the server to the client to be displayed. Sending control information from the client to the server. Callbacks from those control messages code paths that reach back from the server to the client (sidebar note - this is a side...

Pass by reference not returning in RMI for ArrayList

I've got an RMI call defined as: public void remoteGetCustomerNameNumbers(ArrayList<String> customerNumberList, ArrayList<String> customerNameList) throws java.rmi.RemoteException; The function does a database lookup and populates the two ArrayLists. The calling function gets nothing. I believe this works with Vector types. Do I nee...

RMI server: rmiregistry or LocateRegistry.createRegistry

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? ...

RMI vs. Web Services. What's best for Java2Java remoting?

Hi, I'm new to both Web Services and RMI and I wonder which is the better way to do remoting between different web applications, when these applications are all written in Java, that is when different programming languages don't matter (which would be the advantage of WS). While on the one hand I would guess that there's a performance ...

How to initialize Hibernate entities fetched by a remote method call?

When calling a remote service (e.g. over RMI) to load a list of entities from a database using Hibernate, how do you manage it to initialize all the fields and references the client needs? Example: The client calls a remote method to load all customers. With each customer the client wants the reference to the customer's list of bought a...

What are the pros and cons of Web Services and RMI in a Java-only environment?

When developing distributed applications, all written in Java by the same company, would you choose Web Services or RMI? What are the pros and cons in terms of performance, loose coupling, ease of use, ...? Would anyone choose WS? Can you build a service-oriented architecture with RMI? ...

Java RMI: Client security policy

grant { permission java.security.AllPermission; }; This works. grant file:///- { permission java.security.AllPermission; }; This does not work. Could someone please explain to me why? ...

Java RMI Tutorial - AccessControlException: access denied (java.io.FilePermission ...

Yesterday I tried to get started with Java RMI. I found this sun tutorial (http://java.sun.com/docs/books/tutorial/rmi/index.html) and started with the server implemantation. But everytime I start the pogram (the rmiregistry is running) I get an AccessControlException with the following StackTrace: LoginImpl exception: java.security.Acc...

Find which class in which jar has a given serialVersionUID

When I get a java.io.InvalidClassException, it gives me the serialVersionUID that it wants, and the serialVersionUID that it got. Is there an easy way to tell which of my dozens of jars using the wrong serialVersionUID? Update: I should mention that our intention is to update everything at the same time, but I'm trying to debug a probl...

When should I call Naming.unbind()?

I have some code which I am making available via RMI. If my program terminates abnormally, I won't have called Naming.unbind(), and a reference to the object will presumably be hanging around in the RMI registry, and subsequent calls to Naming.bind() with the same name will fail. How do I make sure that rogue references are cleared up?...

How can I open a port in iptables for RMI access

I'm trying to connect from my Java application to a development server that has port 8088 closed which is used for RMI. I appreciate any help on how to open that port. ...

Java RMI not closing socket after lease expiration

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 ...

expose RMI server in JBoss?

I need to access RMI methods from a client front end. For different reasons, I have JBoss running on the server side. This makes me thinking of using JBoss to expose the RMI server methods. I'm kinda new to JBoss, so my question would be: What steps are required in order to make the RMI server methods visible to the client? ...

How to remotely shutdown a Java RMI Server

I have a very simple Java RMI Server that looks like the following: import java.rmi.*; import java.rmi.server.*; public class CalculatorImpl extends UnicastRemoteObject implements Calculator { private String mServerName; public CalculatorImpl(String serverName) throws RemoteException { ...

How can a client do a server side RMI bind without throwing an AccessException?

I have a client-server setup. The client must be able to bind certain objects to the RMIRegistry. Here is the server side code: if (System.getSecurityManager() == null) System.setSecurityManager(new RMISecurityManager()); System.setProperty("java.rmi.server.hostname", "192.168.0.99"); registry = LocateRegistry.createRegistry(Regist...

Should I expect problems when communicating via RMI between Java5 and Java6?

Basically the subject says it all: We have a couple of components running on Java 5, they're talking to each other via RMI. Should we expect any problems, if we move some of them to Java6? By moving I mean compiling them with -source/target 1.6 and running on a java6 vm. ...

RMI server picking up an old ip address

I am seeing a strange problem: I have a linux machine, installed JDK1.6 on that machine, and some business went on, and some days later had to change the IP address of the machine. and now after some months... i am trying to get some spring application to work... and it seems the RMI Server is starting at my old ip address... 21:12...

How to automatically copy data to new RMI threads ?

Hello, I am adapting a little rmi client-server application. I have written several things : HelloInterface -> A Hello World interface for RMI Server -> The server app' Client -> The client app' Nothing special, but... I have put my hands in a new RMISecurityManager, which calls a JNI method and checks the permission for a separate us...

StreamCorruptedException when connecting to JBoss RMI

We're having strange behaviour when connecting to JBoss RMI when our software is running inside Eclipse. When running the program from a web-start, it works fine, but when running it from Eclipse (both 3.3 and 3.4) we're getting this StreamCorruptedException: java.io.StreamCorruptedException: invalid type code: 13 at java.io.ObjectInpu...

Java RMI tracing

Is there a tool which traces & logs all RMI activity of a Java application? ...