Announcement Announcement Module
Collapse
No announcement yet.
Configure Spring RMI to use JBOSS default RMI port 1098 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configure Spring RMI to use JBOSS default RMI port 1098

    I want to expose a RMI service using Spring v1 from my application which run under Jboss 4.0.5.GA, I add this piece of code in my beanRefFactory.xml class
    <bean id="MsgSenderService" class="com.tryout.integration.MsgSenderImpl" />
    <bean class="org.springframework.remoting.rmi.RmiService Exporter">
    <property name="serviceName" value="msg-service"/>
    <property name="service" ref="MsgSenderService"/>
    <property name="serviceInterface" value="com.tryout.integration.MsgSender"/>
    <property name="registryPort" value="1098"/>
    </bean>

    When I run the server, I got eror java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
    The only way to fix the error that I know is to use a different port not being used by anyone, like 1298. Which give me a conclusion Spring try to run itís own RMI listener.

    Is there any way to configure Spring or JBoss, so my Spring RMI can listen using whatever JBossís RMI port at ? Or is this already by design ?

    Thanks

  • #2
    Please use [ code][/code ] tags when posting code, that way it remains readable.

    Please post the full stacktrace...

    In your configuration you didn't specify a host and it might be that JBoss isn't listening to localhost but to the server name or ip address. Also make sure that the registry can be accessed it might be secured for instance..

    Comment


    • #3
      Hi,

      I'm trying to achieve the same thing: 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)

      --EDIT--
      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.
      --EDIT--

      Thanks for your help
      Last edited by fertroya; Feb 15th, 2013, 03:15 PM.

      Comment

      Working...
      X