Announcement Announcement Module
No announcement yet.
Binding Spring RMI exported service to JBoss RMI registry Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding Spring RMI exported service to JBoss RMI registry

    (originally posted at, reposting as new thread as it might not be the same situation)


    I'm trying to bind my exported service to JBoss RMI registry.
    My configuration goes as follows:

    <bean id="SPRING_REMOTING_SENDER_STRATEGY_ENABLED" class="org.springframework.remoting.rmi.RmiServiceExporter"
    		<property name="serviceName" value="RemoteEventSourceSVC" />
    		<property name="service"
    			ref="my.framework.event.consumer.source.mdb.remote" />
    		<property name="serviceInterface"
    			value="my.framework.event.consumer.source.mdb.IRemoteEventSource" />
    		<property name="registryPort"
    			value="1098" />
    I get an NoSuchObjectException during context loading (bean creation). These are the lines that cause the exception,

    RmiServiceExporter >> getRegistry()
    synchronized (LocateRegistry.class) {
    				try {
    					// Retrieve existing registry.
    					Registry reg = LocateRegistry.getRegistry(null, registryPort, clientSocketFactory);
    					return reg;
    				catch (RemoteException ex) {
    					logger.debug("RMI registry access threw exception", ex);"Could not detect RMI registry - creating new one");
    					// Assume no registry found -> create new one.
    					return LocateRegistry.createRegistry(registryPort, clientSocketFactory, serverSocketFactory);
    In particular the testRegistry() method which invokes list() on the registry object.

    Any clues on what should I do to achieve this binding? Is it at all possible to reuse JBoss RMI Registry?

    In the official docs there's a recommendation not to do so, but it doesn't say it's not possible (

    I'm using IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64), JBoss 4.3 EAP and Spring 3.1.0.RELEASE.

    Thanks for your help