3 Replies Latest reply on Sep 1, 2005 7:38 AM by Venkata Rajesh

    Advice on converting RMI app to JBoss

    Charlie Hubbard Newbie

      I need a little guidance on porting an older RMI application to JBoss. Today I have a server that is comprised on mainly RMI objects. I'm trying to move this server into JBoss and eventually to J2EE, but right now I'm just trying to get the server into JBoss. As it stands I have created a MBean for the server and successfully gotten it to start up in JBoss. Now I'd like to remove some of the overlap between JBoss and my server. Right now my MBean is creating a RMIRegistry using LocateRegistry.create() method in java.rmi. I've been going over the JBoss services and it looks like JBoss is already creating a RMIRegistry service. I looked in jboss-service.xml in the conf directory and found the NamingService which has a rmiPort attribute set to 1098 by default. I tried registering my RMI objects with that service on 1098, but I get an ObjectNotFoundException when I try to call Naming.rebind(). Then I tried LocateRegistry.list() and same thing happens. It appears to understand RMI, but it doesn't have a RMIRegistry object in it.

      I also looked at the JRMPInvoker service, but I couldn't figure out if it was plain RMI or not.

      What am I doing wrong? How can I register my objects in JBoss? If I can't use Naming.rebind() then will I have to use JBoss JNDI? Will my clients of the RMI objects need to change too? Possibly to JBoss JNDI client libraries? Is there some way I could register these RMI objects through a XML file rather than a MBean or in addition to? (Besides make them EJBs).