JBossBook_305 provide an example called JNDIMap, I packed it as a SAR file and deployed it in JBoss.
I found I can only access the object contextMap inside JBoss (through a Session Bean in my example). When I tried to access it from another JVM, I found the object I got is not an instance of HashMap, when I print out the object I got from lookup("inmemory/maps/MapTest"), the result is:
Reference Class Name: java.util.HashMap
How I can access this MBean service outside JBoss?
It binds a reference to the Map into JNDI.
The map itself is not bound.
If you bind the map into jndi you will receive
a copy remotely, however all contents must be
Another approach would be to use a Stateless Session Bean
to provide remote access to the map.