Tuesday, March 27, 2007

EJB3 : view from Ethereal

Exploring something new is exciting thing. How does EJB looks like from the view of networking ? Can I catch a result of remote EJB method invocation as plain String ? So, my experiment... Yep, it is dummy but I never tried it by myself.

I have 2 computers : A and B, both in the same sub net (192.168.3.*). There is some very-very simple stateless session bean deployed at machine A :

package com.mycoolcompany.Beans;

import javax.ejb.Stateless;
import com.mycoolcompany.Beans.MySession;

public class MySessionBean implements MySession {
public String someLogicForRemoteInterface()
return "This_is_a_string_to_catch";
Application server is jBoss- 4.0.4 GA. The EJB client is on B. Ethereal is also at B. It will be more interesting to place sniffer at 3-rd computer, but I haven't such ability.
Take a look at result :

So, as you can see "This_is_a_string_to_catch" has catched successfully.


Loki said...

Note that an EJB3 protocol analyzer for Wireshark (formerly known as Ethereal) would be even more interesting.

Actually, it should be an RMI protocol dissecter, which, at first, would require an implementation of a Java serialization decompiler. Not an easy task (although the Java's Serialization is documented (see chapter 6)) but it would be a very useful feature indeed.

Stas Ostapenko said...

Hi Loki!

Thanks for advice! I'll take a look at Wireshark, since I haven't heard about it. EJB3 protocol analyzer sounds cool :)

I fact I'm little wondering that string has been catched as plain text.

Lutz said...

"wireshark" is just the new name for the "ethereal" software