9 Replies Latest reply on Oct 18, 2004 5:19 PM by Mark LaPolla

    multiple instances of jboss in the same machine

    jbossuserr Newbie

      I was able to start 2 instances of Jboss in the same machine with different IP addresses using "-h" switch to "run.bat". I got "receive timed out" from the application, so I added the properties to JNDI.properties to block the socket timeout under the server subdirectories of each instance. Now I am getting the error of "Classloader not found" for one of classes defined in jnpserver.jar even though I can find this jar file under the \lib of each copy. Has anyone come across the same problem? any input is appreciated!

      Thanks.

        • 1. Re: multiple instances of jboss in the same machine
          Andrew Swan Newbie

          Doesn't the "-h" switch invoke the help option? I think you need to specify the host address using either "-b" or "--host" (using the -h option will confirm this for you!).

          Hope this helps,

          &roo

          • 2. Re: multiple instances of jboss in the same machine
            xfabhe Newbie

            Hi.

            I have set upp JBoss with 5 diffrent instances. Maybe my way will help you out.

            To make JBoss work with 2 instances you have to create two directories, JBoss0 and JBoss1, like {jboss-home}/server/jboss0/ and {jboss-home}/server/jboss1/.
            In {jboss-home}/server/default/conf/jboss-service.xml you have to enable the ServiceBindingManager. Now you have to copy the directories conf/ lib/ and db/ from the default directory in to both jboss0 and jboss1. Next step is to define the ports. This is done in {jboss-home}/docs/examples/binding-service/sample-bindings.xml. Two server configurations named jboss0 and jboss1 are given. The jboss0 configuration uses the default settings for the ports, while the jboss1 configuration adds 10000 to each port number. This will make it easy to add even more instances.

            Now, to run you jbosses you have to start two terminal-consoles. Make sure you are standing in the correct directory, for instance 1 - {jboss-home}/server/jboss0 and write {jboss-home}/bin/run.sh -c jboss0. The same for instance no 2 in terminal 2. Make sure that the instances not are answering to the same ports.

            Hope this will help.
            Kindly
            /Helena

            • 3. Re: multiple instances of jboss in the same machine
              Benny De Vuyst Newbie

              I also configured multiple servers like this(jboss0, jboss1,...). The only problem I still encounter is that I can't seem to get the configuration right for the SSL connector. When I start up a server (e.G. jboss0) without the binding manager, it works fine, but once I start it up using the binding manager(service-binding.xml) it, won't work anymore.

              Anyone has a solution???? I already posted this problem a time ago but did't get a solution.

              Thx in advance

              • 4. Re: multiple instances of jboss in the same machine
                jeffrey huffman Newbie

                I have a client who has recently (successfully) marketed a "county-based" application to many counties in a state, and now must solve the problem of scaling the the system to meet the new demands. There isn't enough time to rearchitect the application (to include a "county layer") prior to initial go-live, and buying new hardware for each instance of jboss / application is also not an option. The existing instances of the application run on jboss 3.0.7 in production.

                I have four questions (plus one request).

                1. Is it possible, reasonable and safe to run separate instances of the same application in different "instances" of jboss as described in this thread (jboss0, jboss1)? I "made it work" but can and should are so very different.

                2. How many instances of an application might reasonably be deployed in this manner? (The ear for this dude is circa 35 megs.)

                3. What variables / measures should be used to determine the threshold for a particular server? (How do I know when enough is too much?)

                4. Do you have or know of any documentation about this topic outside of this wiki (which is Wunderbar! keine Frage!)? Simple is good.

                Plus, if anyone has experience in this area, please let me know how many application instances and what version of jboss you used.

                Thanks,
                -pointerweb

                • 5. Re: multiple instances of jboss in the same machine
                  Elias Ross Master


                  We've had 3 or 4 instances of JBoss running on a single machine, no problem. It depends more on your application behavior (ours were mostly idle) and memory (each used about 300MB, but we had about 1-2GB).

                  The trick is to create a script (using ant or whatever) which copies over different versions of the configuration that use different ports.

                  You can also pass in system settings on the command line (like with -Dhttp.port=8080) and put in the macro

                  ${http.port}
                  into your web.xml or jboss-service.xml. It'll be expanded when the server runs.


                  • 6. Re: multiple instances of jboss in the same machine
                    Mark LaPolla Newbie

                    I don't think I am doing this correctly. I am running Jboss-4.0.0. I cannot get this to work for one server. I do the following steps:

                    1. I create JBoss0 and JBoss1 under server
                    2. I then move, from the default server, lib, conf, and data.
                    3. I then go into the jboss-service.xml file in JBoss0 and I uncomment the ServiceBindingManager def:

                     <mbean code="org.jboss.services.binding.ServiceBindingManager"
                     name="jboss.system:service=ServiceBindingManager">
                     <attribute name="ServerName">ports-01</attribute>
                     <attribute name="StoreURL">file:/c:/java_env/jboss-4.0.0/docs/examples/binding-manager/sample-bindings.xml</attribute>
                     <attribute name="StoreFactoryClassName">
                     org.jboss.services.binding.XMLServicesStoreFactory
                     </attribute>
                     </mbean>
                    

                    and use the ServerName of ports-01 from the sample-bindings.xml. Just in case I used absolute pathnames.
                    4. I then go into the JBoss0 and run the following:
                    c:/java_env/jboss-4.0.0/bin/run -c JBoss0
                    

                    and I get
                    14:40:48,522 INFO [Server] Core system initialized
                    14:40:50,913 ERROR [MainDeployer] could not create deployment: file:/C:/Java_Env
                    /jboss-4.0.0/server/JBoss0/conf/jboss-service.xml
                    org.jboss.deployment.DeploymentException: No ClassLoaders found for: org.jboss.s
                    ervices.binding.ServiceBindingManager; - nested throwable: (java.lang.ClassNotFo
                    undException: No ClassLoaders found for: org.jboss.services.binding.ServiceBindi
                    ngManager)
                     at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java
                    :139)
                     at org.jboss.system.ServiceController.install(ServiceController.java:200
                    )
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:324)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                    er.java:141)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
                    java:242)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                     at $Proxy4.install(Unknown Source)
                     at org.jboss.deployment.SARDeployer.create(SARDeployer.java:208)
                     at org.jboss.deployment.MainDeployer.create(MainDeployer.java:889)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:745)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:324)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                    er.java:141)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
                    or.java:119)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
                    BeanOperationInterceptor.java:131)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
                    java:242)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                     at $Proxy5.deploy(Unknown Source)
                     at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
                     at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
                     at org.jboss.Main.boot(Main.java:151)
                     at org.jboss.Main$1.run(Main.java:405)
                     at java.lang.Thread.run(Thread.java:534)
                    Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jbos
                    s.services.binding.ServiceBindingManager
                     at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:198)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
                    assLoader.java:463)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
                    oader.java:374)
                     at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
                     at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
                    1183)
                     at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
                    269)
                     at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
                    327)
                     at org.jboss.system.ServiceCreator.install(ServiceCreator.java:125)
                     at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigura
                    tor.java:149)
                     at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java
                    :114)
                     ... 36 more
                    Failed to boot JBoss:
                    org.jboss.deployment.DeploymentException: No ClassLoaders found for: org.jboss.s
                    ervices.binding.ServiceBindingManager; - nested throwable: (java.lang.ClassNotFo
                    undException: No ClassLoaders found for: org.jboss.services.binding.ServiceBindi
                    ngManager)
                     at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java
                    :139)
                     at org.jboss.system.ServiceController.install(ServiceController.java:200
                    )
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:324)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                    er.java:141)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
                    java:242)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                     at $Proxy4.install(Unknown Source)
                     at org.jboss.deployment.SARDeployer.create(SARDeployer.java:208)
                     at org.jboss.deployment.MainDeployer.create(MainDeployer.java:889)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:745)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
                     at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                    java:39)
                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                    sorImpl.java:25)
                     at java.lang.reflect.Method.invoke(Method.java:324)
                     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                    er.java:141)
                     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                     at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
                    or.java:119)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                     at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
                    BeanOperationInterceptor.java:131)
                     at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
                    java:242)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                     at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                     at $Proxy5.deploy(Unknown Source)
                     at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
                     at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
                     at org.jboss.Main.boot(Main.java:151)
                     at org.jboss.Main$1.run(Main.java:405)
                     at java.lang.Thread.run(Thread.java:534)
                    Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jbos
                    s.services.binding.ServiceBindingManager
                     at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:198)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
                    assLoader.java:463)
                     at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
                    oader.java:374)
                     at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
                     at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
                    1183)
                     at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
                    269)
                     at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
                    327)
                     at org.jboss.system.ServiceCreator.install(ServiceCreator.java:125)
                     at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigura
                    tor.java:149)
                     at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java
                    :114)
                     ... 36 more
                    14:40:51,444 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
                    Shutting down
                    14:40:51,444 INFO [Server] Shutdown complete
                    Shutdown complete
                    Halting VM
                    Press any key to continue . . .
                    C:\Java_Env\jboss-4.0.0\server\JBoss0>c:\java_env/jboss-4.0.0/bin/run -c JBoss0
                    


                    Ouch! Am I missing a step? default-ports, ports-01 and ports-02 are all defined in the docs/example/binding-manager/sample-bindings.xml

                    I have tried all three servers and for grins I tried it with the deploy directory copied from the default server, just in case. (I assumed eventually I would need a deploy directory.)

                    Thanks for the help.



                    • 7. Re: multiple instances of jboss in the same machine
                      Piero Colagrosso Newbie

                      Hi,

                      I was having similar problems with using ServiceBinding Manager while migrating to JBoss 4.0.

                      In order to resolve the problem I had to copy the file bindingservice-plugin.jar
                      from the directory JBOSS_HOME/server/standard/lib
                      to the directory JBOSS_HOME/server//lib.

                      This plugin is included by default in the 'standard' configuration but not in the 'default' configuration. I assume that you are using the default configuration.

                      Cheers,

                      Piero

                      • 8. Re: multiple instances of jboss in the same machine
                        Mark LaPolla Newbie

                        Yes, thanks, that did the trick.

                        Now, when I started up, it complained about not having a deploy directory. So, I copied over the directory, with everything in it, and got this error.

                        14:13:31,297 INFO [NamingService] Started jnpPort=1099, rmiPort=1098, backlog=5
                        0, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jbo
                        ss.net.sockets.DefaultSocketFactory@ad093076
                        14:13:31,656 ERROR [AbstractDeploymentScanner$ScannerThread] Scanning failed; co
                        ntinuing
                        java.io.FileNotFoundException: C:\Java_Env\jboss-4.0.0\server\JBoss0\deploy
                         at org.jboss.net.protocol.file.FileURLLister.listMembers(FileURLLister.j
                        ava:38)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
                        canner.java:379)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                        doScan(AbstractDeploymentScanner.java:204)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
                        bstractDeploymentScanner.java:277)
                         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
                        upport.java:271)
                         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
                        eanSupport.java:221)
                         at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                        sorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:324)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                        er.java:141)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
                        java:242)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
                        ler.java:891)
                         at $Proxy0.start(Unknown Source)
                         at org.jboss.system.ServiceController.start(ServiceController.java:416)
                         at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                        sorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:324)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                        er.java:141)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
                        java:242)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                         at $Proxy4.start(Unknown Source)
                         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
                         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
                         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
                         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                        java:39)
                         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                        sorImpl.java:25)
                         at java.lang.reflect.Method.invoke(Method.java:324)
                         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                        er.java:141)
                         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
                        or.java:119)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
                        BeanOperationInterceptor.java:131)
                         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
                        java:242)
                         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
                         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                         at $Proxy5.deploy(Unknown Source)
                         at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
                         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
                         at org.jboss.Main.boot(Main.java:151)
                         at org.jboss.Main$1.run(Main.java:405)
                         at java.lang.Thread.run(Thread.java:534)
                        14:13:31,812 ERROR [AbstractDeploymentScanner$ScannerThread] Scanning failed; co
                        ntinuing
                        java.io.FileNotFoundException: C:\Java_Env\jboss-4.0.0\server\JBoss0\deploy
                         at org.jboss.net.protocol.file.FileURLLister.listMembers(FileURLLister.j
                        ava:38)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
                        canner.java:379)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                        doScan(AbstractDeploymentScanner.java:204)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                        loop(AbstractDeploymentScanner.java:215)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                        run(AbstractDeploymentScanner.java:194)
                        14:13:32,109 INFO [Server] JBoss (MX MicroKernel) [4.0.0 (build: CVSTag=JBoss_4
                        _0_0 date=200409200418)] Started in 7s:31ms
                        14:13:36,875 ERROR [AbstractDeploymentScanner$ScannerThread] Scanning failed; co
                        ntinuing
                        java.io.FileNotFoundException: C:\Java_Env\jboss-4.0.0\server\JBoss0\deploy
                         at org.jboss.net.protocol.file.FileURLLister.listMembers(FileURLLister.j
                        ava:38)
                         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
                        canner.java:379)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                        doScan(AbstractDeploymentScanner.java:204)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                        loop(AbstractDeploymentScanner.java:215)
                         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
                        run(AbstractDeploymentScanner.java:194)
                        14:14:38,062 INFO [Embedded] Catalina naming disabled
                        


                        Any ideas? Thanks again.

                        • 9. Re: multiple instances of jboss in the same machine
                          Mark LaPolla Newbie

                          Ah, never mind. That was confusing, I restarted and all problems went away. Thanks.