« Update: BMW Climate Control Repair | Main | Is your Tivo on the Internet? »

Fun with Remote Method Invocation & Stubs

Lately I've been developing numerous Stateless Session EJBs for my project at work. This is the first project I've deployed on the Sun One Application Server, so I'm wrestling with some of its subtle nuances during deployment. One of my greatest annoyances is the handling of stub class at deployment time for EJB components.

Stub classes are generated for any RMI-based deployment. The stub classes must be distributed to any client looking to access the component using RMI. So, it's not sufficient to distribute just the remote interface to client applications. Locating & packaging the stubs classes during deployment creates a large number of steps that are difficult to automate (i.e. application is compiled and built on a workstation, but the application is running on a UNIX server).

So, I was thinking about XML web services and how they inherently support dynamic lookup and dynamic bind. The XML schema is comparable to the Remote Interface. A JAX-RPC web service client might be comparable to the RMI stub classes; however, the web service client can be programmatically developed or generated using a tool like JAX-RPC by the service client, whereas stub classes can only be produced by the owner of the RMI deployment. Every deployment platform for RMI-based resources could potentially require re-generation and re-distribution for stub classes. No such steps are required for XML web services where the client interfaces are generated from an interface defintion document (i.e. XML Schema) at runtime or deployment time.