rmi

How to have JMX bind to a specific interface?

I am currently starting my Java VM with the com.sun.management.jmxremote.* properties so that I can connect to it via JConsole for management and monitoring. Unfortunately, it listens on all interfaces (IP addresses) on the machine. In our environment, there are often cases where there is more than one Java VM running on a machine at t...

RMI, EJB and callback

Is it possible for a client to pass an RMI object as an argument to an EJB so that the EJB may callback the client? ...

Bad idea to chain exceptions with RMI?

Is it a bad idea to use exception chaining when throwing RemoteExceptions? We have an RMI server that does something like this: public Object doSomething() throws RemoteException { try { return getData(); } catch (CustomException ex) { throw new RemoteException(ex); } } I'm getting UnmarshallEx...

Simpler-than-JBoss way to have POJO RPC in Java with container session management

Currently, I only know a way of doing RPC for POJOs in Java, and is with the very complex EJB/JBoss solution. Is there any better way of providing a similar functionality with a thiner layer (within or without a Java EE container), using RMI or something that can serialize and send full blown objects over the wire? I'm not currently i...

Java RMI Resources

Hi everyone I am currently undertaking a project that involves extensive use of Java RMI and I was wondering if anyone is aware of any good resources about it. The problem I am having with the material I am finding currently is that its usually quite out of date (like Java 1.3) and / or half complete. I would even be happy to buy a book...

Best practicies for JUnit and RMI Apps, RMI Registry

I'm looking to write a set of system integration tests for an RMI client application. I'd like to start the RMI server in JUnit 3.8.2 and then run those tests. Has anyone done this? I'm using something like this in a pojo with main: import java.rmi.registry.*; .... //setup try { java.rmi.registry.LocateReg...

How to mix java webstart with RMI?

I want to distribute a webstart application which uses RMI. I want to avoid to ask the user the address of the RMI server, because the website that distributes the application is also the RMI server. Furthermore, I don't know the address of the server at build time, therefore the address must be added with ad hoc configuration to the J...

running rmi server, classnotfound

Hi I'm trying to run a java application that binds a class to the naming server, but i constantly get a ClassNotFoundException First I start the registry: rmiregistry then from eclipse I try to execute the server but get this error java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: ...

How can I measure the size of the object I send over RMI?

I'm doing some performance tuning on my application and would like to know a good way of measuring the size of the object that I am sending over RMI. The aim is to make my object leaner. ...

How to use RMI with applet client behind a firewall?

How can I use RMI with a applet client behind a firewall? How can I use RMI with a firewalled server and firewalled applet client? (If possible) I know that the RMI server uses port 1099 (by default, but this is configurable); however after this the communication requires a new socket on a different random port. I also know that you ca...

Problem running our client from within Eclipse

Whenever we run our Java client from within Eclipse to contact a server app using RMI, we get an exception: java.io.StreamCorruptedException: invalid type code: 01 This only happens from within Eclipse, nowhere else (IntelliJ, command line, etc.). Does anyone know what's going on? ...

RMI Thread terminating due to java.lang.OutOfMemoryError: Java heap space

Hi All, I am working on a comp based application. In this application there are n number of containers that communicate to each other via rmi services they provide to each other. At a certaion point One rmi thread conneccted to my container is lost the connection due to out of memory error ,but all other RMI thred connected to my contai...

Java - Distributed Programming, RMI?

I've got a doozy of a problem here. I'm aiming to build a framework to allow for the integration of different traffic simulation models. This integration is based upon the sharing of link connectivities, link costs, and vehicles between simulations. To make a distributed simulation, I plan to have a 'coordinator' (star topology). All pa...

Netbeans, Ant and RMIC (Java RMIC Compiler) (Help with)

Hi guys, I'm rather miffed / baffled at the moment. I've got a Netbeans project, that compiles fine. I've edited the build.xml file to create a "-post-compile" target, which does an rmic ant task. So now, when I "clean and build" it compiles my main code, then generates the rmic stubs for me. However, when I chose to 'Run' my netbeans...

NamingException when trying RMI/HTTP from JBoss 4.0.1 to 4.2.3

I've got an application that is trying to call a method on an EJB running on JBoss 4.2.3 GA. The application is a legacy app; it works when it accesses the original server which ran on JBoss 4.0.1. Its RMI code is in jbossall-client.jar from JBoss 4.0.1. It is trying to call a method which will give it new code to allow it to update it...

Sending Dates over RMI between machines in different regions

I'm having a problem sending java.util.Date objects over RMI, to and from machines in different timezones. For example, a client in Germany will send a date object to a server in the UK. User enters a date string e.g. 20090220. Client app in Germany converts it to date using SimpleDateFormat("yyyyMMdd") to give: Fri Feb 20 00:00:00 C...

Determine remote client IP address for Java RMI call

When I implement an RMI server (implement an interface that extends java.rmi.Remote) is there a way to get information about the current RMI request context, specifically the remote client's IP address? public void myMethod() throws RemoteException { log.info("remote IP is "+ RMISomething.getSomething()); } ...

How can I implement my security policy in java program itself.

I am really new in java-RMI and developed a small application on it.But to run my server and client I need to execute- Java -Djava.security.policy=client.policy So what should I do to ommite '-Djava.security.policy=client.policy' this command? Or is there any way to implement the security policy in java program? Thanks in advance. ...

RMI and exceptions

I am new to using RMI and I am relatively new to using exceptions. I want to be able to throw an exception over RMI (is this possible?) I have a simple server which serves up students and I have delete method which if the student doesn't exist I want to throw a custom exception of StudentNotFoundException which extends RemoteException...

java interface extends questions

For my assignment I have to implement an RMI server which will a front end for two other RMI services. So I decided a logical thing to do would be to have the interface for this implement the interfaces for the other two services. public interface FrontEndServer extends Remote, BookServer, StudentServer { // Block empty so far } ...