4 Replies Latest reply on Jun 30, 2003 8:52 AM by constant

    How to use both rmi and jms?

    constant

      Hi,all!

      In JBoss, rmi and jndi both use port 1099, so rmi can't work while JBoss has started(it raises a error that look like this:java.rmi.server.ExportException: Port already in use: 1099; nested exception is: java.net.BindException: ddress in use: JVM_Bind), how to solve this problem? Could anyone tell me the way out? Thanks in advance!

        • 1. Re: How to use both rmi and jms?

          You can change the JNDI port in jboss-service.xml (don't forget to update your client's jndi-properties when you do this).

          • 2. Re: How to use both rmi and jms?
            constant

            Hello, Juha Lindfors!

            I changed the item in jboss-service.xml to the following:


            <!-- The listening port for the bootstrap JNP service. Set this to -1
            to run the NamingService without the JNP invoker listening port.
            -->
            1098


            What should I do to update the client's jndi-properties?
            The jndi.properties file looks like this:

            java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
            # Do NOT uncomment this line as it causes in VM calls to go over
            # RMI!
            #java.naming.provider.url=localhost

            • 3. Re: How to use both rmi and jms?

              That's not the jndi.properties file you should touch. Just make sure the jndi.properties you distribute to your clients contain the correct port number.

              • 4. Re: How to use both rmi and jms?
                constant

                Do you mean that what I need to do is change the port in the program? Well, my program has change accordingly as follows:

                public static void main(String[] args)
                {
                try
                {
                LocateRegistry.createRegistry(1098);

                EventListener obj = new EventListener();
                System.out.println("EventListener instantiated: " + obj);
                Naming.rebind("/EventListener", obj);
                }
                catch(Exception e)
                {
                System.out.println(e);
                }
                }


                But the problem remains there:

                java.rmi.server.ExportException: Port already in use: 1098; nested exception is:
                java.net.BindException: Address in use: JVM_Bind