10 Replies Latest reply on Oct 9, 2002 5:54 PM by Kevin Urciolo

    JBoss 3.0.1 Server Configuration Port Changes

    Kevin Urciolo Newbie

      I am attempting to run JBoss in my client VM. I currently have two configurations. One uses all of the preconfigured port numbers. It starts fine when I execute something similar to the following:

      try {
      Main main = new Main();
      main.boot(argsTest);
      }
      catch (Exception e) {
      e.printStackTrace();
      }

      However, when I attempt to start the second configuration that has had the port numbers changed to allow two instances of JBOSS to run at the same time, I get the attached error.

      I can run both configurations without problems from the command line by calling run -c configuration. I only encounter the problem when attempting to start JBoss programmatically. Any ideas?

      Thanks.

        • 1. Re: JBoss 3.0.1 Server Configuration Port Changes
          Kevin Urciolo Newbie

          If the attachment is not clear, here are the key points to the log:

          15:40:02,015 INFO [NamingService] Started jnpPort=2099, rmiPort=0, backlog=50, bindAddress=null, Client SocketFactory=null, Server SocketFactory=null

          15:40:02,025 WARN [NamingService] Context.PROVIDER_URL in server jndi.properties, url=localhost:1099

          15:40:02,025 INFO [NamingService] Listening on port 2099

          ...

          15:40:03,146 WARN [NamingContext] Failed to connect to localhost:1099

          javax.naming.CommunicationException: Failed to connect to server localhost:1099. Root exception is

          javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099. Root exception is

          java.net.ConnectException: Connection refused: connect

          • 2. Re: JBoss 3.0.1 Server Configuration Port Changes
            Adrian Brock Master

            15:40:01,905 INFO [NamingService] Starting
            15:40:01,915 INFO [NamingService] Starting jnp server
            15:40:02,015 INFO [NamingService] Started jnpPort=2099, rmiPort=0, backlog=50, bindAddress=null, Client SocketFactory=null, Server SocketFactory=null
            ******jndi.properties***** 15:40:02,025 WARN [NamingService] Context.PROVIDER_URL in server jndi.properties, url=localhost:1099
            ****jboss-service.xml***** 15:40:02,025 INFO [NamingService] Listening on port 2099
            15:40:02,025 INFO [NamingService] Started
            15:40:02,025 INFO [JNDIView] Starting
            15:40:02,025 INFO [JNDIView] Started
            15:40:02,025 INFO [SecurityConfig] Starting
            15:40:02,025 INFO [SecurityConfig] Started
            15:40:02,085 INFO [JaasSecurityManagerService] Starting
            15:40:02,095 INFO [JaasSecurityManagerService] Started
            15:40:02,095 INFO [TransactionManagerService] Starting
            15:40:02,125 INFO [TransactionManagerService] Started
            15:40:02,125 INFO [ClientUserTransactionService] Starting
            15:40:03,146 WARN [NamingContext] Failed to connect to localhost:1099
            javax.naming.CommunicationException: Failed to connect to server localhost:1099.
            Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099.
            Root exception is java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
            at java.net.Socket.connect(Socket.java:425)
            at java.net.Socket.connect(Socket.java:375)
            at java.net.Socket.(Socket.java:290)
            at java.net.Socket.(Socket.java:198)
            at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
            at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
            at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:156)
            at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:995)
            at org.jnp.interfaces.NamingContext.bind(NamingContext.java:393)
            at org.jnp.interfaces.NamingContext.bind(NamingContext.java:386)
            at javax.naming.InitialContext.bind(InitialContext.java:355)
            at org.jboss.tm.usertx.server.ClientUserTransactionService.startService(ClientUserTransactionService.java:73)

            You are starting a naming service on 2099,
            but then trying to bind a client user transaction service
            onto port 1099 because you have that set that in
            your server/[config]/conf/jndi.properties.
            Or do you have jndi.properties somewhere else in
            the boot classpath?

            Regards,
            Adrian

            • 3. Re: JBoss 3.0.1 Server Configuration Port Changes
              Kevin Urciolo Newbie

              I originally changed the naming service port in the /server/[config]/conf/jboss-service.xml. I am not currently using the jndi.properties file, and verified that I don't have one in my classpath.

              If I start JBoss by the run.bat file, I get:

              16:48:56,845 INFO [NamingService] Started jnpPort=2099, rmiPort=0, backlog=50, bindAddress=null, Client SocketFactory=null, Server SocketFactory=null
              16:48:56,855 WARN [NamingService] Context.PROVIDER_URL in server jndi.properties, url=localhost:2099
              16:48:56,865 INFO [NamingService] Listening on port 2099

              This seems to indicate that picked it up from the jboss-services.xml file somehow, correct? When I start JBoss programmatically I get the error shown previously.

              I wonder if it has to do with the JBoss jars in the classpath. When I start JBoss from the command line, JBoss somehow goes out and "loads" the jars without them being in the classpath (run.jar is all that is needed). However, from the client, I need to include the jars so my code can function using the client APIs. I wonder if this is confusion JBoss somehow?

              Thanks for the help...

              • 4. Re: JBoss 3.0.1 Server Configuration Port Changes
                Adrian Brock Master

                Could be?

                Anything you specify on the classpath will be
                loaded in preference to server/[config]/conf
                Check the jars for a jndi.properties

                Last time I checked the conf directory was set
                as the thread context classloader during the
                jboss-service.xml deploy sequence.


                Regards,
                Adrian

                • 5. Re: JBoss 3.0.1 Server Configuration Port Changes
                  Kevin Urciolo Newbie

                  How would you suggest a user solve the problem of running both the client and server within a single VM? I cannot attribute this problem directly to jndi issues, and cannot find evil jndi.properies files causing problems.

                  I have tried multiple jar combinations:
                  1. All client, lib, server jars, and run.jar

                  This combination allows the client to run, but the server does not function properly because of the jndi 1099 port issues discussed above.

                  2. Just jbossjmx-ant.jar, jboss-j2ee.jar and run.jar

                  This combination does not allow the client or server to run. The client compiles, but produces the following error when run:
                  ...
                  Another exception has been detected while we were handling last error.
                  Dumping information about last error:
                  ERROR REPORT FILE = (N/A)
                  PC = 0x6D35DF98
                  SIGNAL = -1073741819
                  FUNCTION NAME = (N/A)
                  OFFSET = 0xFFFFFFFF
                  at java.lang.IncompatibleClassChangeError.(IncompatibleClassChangeError.java:26)
                  at java.lang.AbstractMethodError.(AbstractMethodError.java:27)
                  LIBRARY NAME = C:\j2sdk1.4.0_01\jre\bin\client\jvm.dll
                  Please check ERROR REPORT FILE for further information, if there is any.
                  Good bye.


                  The server produces the following error when run:

                  java.lang.RuntimeException: Unable to create the MBean server instance. Class org.jboss.mx.server.MBeanServerImpl has raised an exception in constructor: java.lang.RuntimeException: Unable to create the MBean registry instance. Class org.jboss.mx.server.registry.BasicMBeanRegistry has raised an exception in constructor: java.lang.NoClassDefFoundError: org/jboss/mx/util/AgentID

                  at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:148)

                  at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:66)

                  at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:252)

                  at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)

                  at org.jboss.Main.boot(Main.java:142)

                  at org.cmis.appserver.servicemanager.JBossStarter$1.run(JBossStarter.java:35)

                  at java.lang.Thread.run(Thread.java:536)


                  3. Just run.jar

                  This combination allows the server to start successfully, but the client code cannot compile or run.

                  Questions:

                  What do I need to do to fix these classloader problems?

                  Are only the jars in the client directory required to have the client run without errors?

                  Thanks a bunch,

                  Kevin

                  • 6. Re: JBoss 3.0.1 Server Configuration Port Changes
                    Adrian Brock Master

                    Can you explain why you want to run
                    client and server in the same VM?

                    If you are trying to do this, you
                    should not have the jars from both client and server.
                    That will produce a lot of confusion, since you
                    will be duplicating classes.

                    The version of of jbossjmx-ant.jar that I have for 3.0
                    has a jndi.properties with the port set to 1099

                    The "ERROR REPORT FILE" is a bug in the JVM,
                    the original error it was trying to report is
                    due to javax.management classes not in client/jbossjmx-ant.jar (which has only the client classes)
                    but in lib/jboss-jmx.jar (the full implementation)

                    Regards,
                    Adrian

                    • 7. Re: JBoss 3.0.1 Server Configuration Port Changes
                      Kevin Urciolo Newbie

                      We are providing our customer with a "fat" client as well as a thin client. The fat client will have offline capabilities when not connected to the internet. We are basically mirroring certain parts of the server locally (JBoss, McKoi). Memory is a major concern, so even combining VMs for a few MBs is a plus.

                      Your suggestions proved to be correct.

                      I removed the jndi.properties file from jbossjmx.jar and the server started correctly.

                      I also don't need both the server and client jars when running in a single VM, the lib and server jars are sufficient. This removes the need to modify jbossjmx.jar too.

                      Thanks for your help.

                      • 8. Re: JBoss 3.0.1 Server Configuration Port Changes
                        Kevin Urciolo Newbie

                        We are providing our customer with a "fat" client as well as a thin client. The fat client will have offline capabilities when not connected to the internet. We are basically mirroring certain parts of the server locally (JBoss, McKoi). Memory is a major concern, so even combining VMs for a few MBs is a plus.

                        Your suggestions proved to be correct.

                        I removed the jndi.properties file from jbossjmx.jar and the server started correctly.

                        I also don't need both the server and client jars when running in a single VM, the lib and server jars are sufficient. This removes the need to modify jbossjmx.jar too.

                        Thanks for your help.

                        • 9. Re: JBoss 3.0.1 Server Configuration Port Changes
                          Kevin Urciolo Newbie

                          We are providing our customer with a "fat" client as well as a thin client. The fat client will have offline capabilities when not connected to the internet. We are basically mirroring certain parts of the server locally (JBoss, McKoi). Memory is a major concern, so even combining VMs for a few MBs is a plus.

                          Your suggestions proved to be correct.

                          I removed the jndi.properties file from jbossjmx.jar and the server started correctly.

                          I also don't need both the server and client jars when running in a single VM, the lib and server jars are sufficient. This removes the need to modify jbossjmx.jar too.

                          Thanks for your help.

                          • 10. Re: JBoss 3.0.1 Server Configuration Port Changes
                            Kevin Urciolo Newbie

                            We are providing our customer with a "fat" client as well as a thin client. The fat client will have offline capabilities when not connected to the internet. We are basically mirroring certain parts of the server locally (JBoss, McKoi). Memory is a major concern, so even combining VMs for a few MBs is a plus.

                            Your suggestions proved to be correct.

                            I removed the jndi.properties file from jbossjmx.jar and the server started correctly.

                            I also don't need both the server and client jars when running in a single VM, the lib and server jars are sufficient. This removes the need to modify jbossjmx.jar too.

                            Thanks for your help.