You may have to turn the object you bind into a remote object, as for standard RMI. This way, the stub (which is serializable) would be bound into JNDI, and whoever retrieves it again can thus call the original object through it.
Someone might correct me - have only just cracked some of the finer points of RMI myself :-)
what you are saying is right, when it comes to remote access. But if you are doing an in-VM call, it is not necessary to serialize the object or provide a remote handle to it, this would create extra unnecessary overhead.
I thought that from the coder's perspective, every call to/from an EJB or JNDI goes via RMI, even if the container optimizes these calls internally (to avoid serialization). Maybe someone with more JBoss knowledge can shed light on this.