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

  • Binding Spring RMI exported service to JBoss RMI registry

    (originally posted at http://forum.springsource.org/showth...-RMI-port-1098, reposting as new thread as it might not be the same situation)

    Hi,

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

    Code:
    <bean id="SPRING_REMOTING_SENDER_STRATEGY_ENABLED" class="org.springframework.remoting.rmi.RmiServiceExporter"
    		lazy-init="true">
    		<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" />
    	</bean>
    I get an NoSuchObjectException during context loading (bean creation). These are the lines that cause the exception,

    RmiServiceExporter >> getRegistry()
    Code:
    synchronized (LocateRegistry.class) {
    				try {
    					// Retrieve existing registry.
    					Registry reg = LocateRegistry.getRegistry(null, registryPort, clientSocketFactory);
    					testRegistry(reg);
    					return reg;
    				}
    				catch (RemoteException ex) {
    					logger.debug("RMI registry access threw exception", ex);
    					logger.info("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 (http://static.springsource.org/sprin...l#remoting-rmi)

    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
Working...
X