8 Replies Latest reply on Aug 25, 2008 10:53 PM by S K

    Hostname problem while starting jboss

    S K Newbie

      The ip/hostname of my machine is set dynamically using a dhcp server. So my hostname changes to something other than localhost. In this scenario, attempt to start JBoss 4.2 fails. But if I change hostname manually to localhost, it works. Is there any work around such that I'll not need to set hostname manually? Please help me regarding this.

        • 1. Re: Hostname problem while starting jboss
          Andreas Heizenreder Newbie

          Hello,

          you can start your JBoss with bin/run.sh --host 0.0.0.0( or extend run.sh about it). The JBoss will be binded to all ip addresses on your computer.

          I hope it helps.

          Regards
          Andreas

          • 2. Re: Hostname problem while starting jboss
            S K Newbie

            Thank you Andreas for your response.

            But unfortunately it does not resolve my problem totally. I am using PPPoE for Internet.
            If I am not connected to Internet and try to start the JBoss your suggestion works.
            But if I try to start JBoss after connecting to Internet same problem occurs. I have to
            set the hostname manually for the later.

            Any more clue..?

            Regards,
            Sahid

            • 3. Re: Hostname problem while starting jboss
              jaikiran pai Master

               

              "sahidkhn" wrote:

              But if I try to start JBoss after connecting to Internet same problem occurs.



              What problem? Can you please provide more details about the issue? Which JBoss version (include the minor version of 4.2) and Java version are you using?


              • 4. Re: Hostname problem while starting jboss
                S K Newbie

                I am using jboss-4.2.2.GA and jdk 1.5.0_15-b04.

                The problem is jboss boot process fails with the following message


                [sahid@unknown001cc051e93b ~]$ /usr/local/jboss/bin/run.sh -c all --host 0.0.0.0
                =========================================================================

                JBoss Bootstrap Environment

                JBOSS_HOME: /usr/local/jboss

                JAVA: /usr/java/bin/java

                JAVA_OPTS: -Dprogram.name=run.sh -Djava.io.tmpdir=/usr/local/tmp -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true

                CLASSPATH: /usr/local/jboss/bin/run.jar:/usr/java/lib/tools.jar

                =========================================================================

                15:46:32,916 INFO [Server] Starting JBoss (MX MicroKernel)...
                15:46:32,916 INFO [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)
                15:46:32,917 INFO [Server] Home Dir: /usr/local/jboss-4.2.2.GA
                15:46:32,917 INFO [Server] Home URL: file:/usr/local/jboss-4.2.2.GA/
                15:46:32,917 INFO [Server] Patch URL: null
                15:46:32,917 INFO [Server] Server Name: all
                15:46:32,917 INFO [Server] Server Home Dir: /usr/local/jboss-4.2.2.GA/server/all
                15:46:32,918 INFO [Server] Server Home URL: file:/usr/local/jboss-4.2.2.GA/server/all/
                15:46:32,918 INFO [Server] Server Log Dir: /usr/local/jboss-4.2.2.GA/server/all/log
                15:46:32,918 INFO [Server] Server Temp Dir: /usr/local/jboss-4.2.2.GA/server/all/tmp
                15:46:32,918 INFO [Server] Root Deployment Filename: jboss-service.xml
                15:46:33,147 INFO [ServerInfo] Java version: 1.5.0_15,Sun Microsystems Inc.
                15:46:33,147 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_15-b04,Sun Microsystems Inc.
                15:46:33,148 INFO [ServerInfo] OS-System: Linux 2.6.18-53.el5,i386
                15:46:33,338 INFO [Server] Core system initialized
                15:46:35,598 WARN [BasicMBeanRegistry] javax.management.MBeanRegistrationException: preRegister() failed: [ObjectName='jboss.remoting:service=NetworkRegistry', Class=org.jboss.remoting.network.NetworkRegistry (org.jboss.remoting.network.NetworkRegistry@da2cef)]
                15:46:35,611 ERROR [MainDeployer] Could not create deployment: file:/usr/local/jboss-4.2.2.GA/server/all/conf/jboss-service.xml
                org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.InvocationTargetException)
                ...
                [snipped]
                ....
                Caused by: javax.management.MBeanRegistrationException: preRegister() failed: [ObjectName='jboss.remoting:service=NetworkRegistry', Class=org.jboss.remoting.network.NetworkRegistry (org.jboss.remoting.network.NetworkRegistry@da2cef)]
                at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:713)
                at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:211)
                at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                ... 51 more
                Caused by: java.lang.RuntimeException: Exception creating identity: unknown001cc051e93b: unknown001cc051e93b
                at org.jboss.remoting.ident.Identity.get(Identity.java:211)
                at org.jboss.remoting.network.NetworkRegistry.preRegister(NetworkRegistry.java:268)
                at org.jboss.mx.server.AbstractMBeanInvoker.invokePreRegister(AbstractMBeanInvoker.java:966)
                at org.jboss.mx.modelmbean.ModelMBeanInvoker.invokePreRegister(ModelMBeanInvoker.java:489)
                at org.jboss.mx.server.AbstractMBeanInvoker.preRegister(AbstractMBeanInvoker.java:654)
                at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:697)
                ... 56 more
                15:46:35,720 INFO [Server] Runtime shutdown hook called, forceHalt: true
                15:46:35,721 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
                15:46:35,724 INFO [Server] Shutdown complete
                Shutdown complete
                Halting VM




                • 5. Re: Hostname problem while starting jboss
                  jaikiran pai Master

                   

                  Caused by: java.lang.RuntimeException: Exception creating identity: unknown001cc051e93b: unknown001cc051e93b


                  Looks like a problem in the etc/hosts file. Can you post its contents? Also see this http://www.jboss.com/index.html?module=bb&op=viewtopic&t=124173

                  • 6. Re: Hostname problem while starting jboss
                    S K Newbie

                    My /etc/hosts looks like following:


                    [sahid@unknown001cc051e93b bin]$ cat /etc/hosts
                    127.0.0.1 localhost localhost.localdomain


                    But problem is once I starte PPPoE, my hostname changes to something else. And JBoss can not identify this hostname.

                    • 7. Re: Hostname problem while starting jboss
                      jaikiran pai Master

                      I work on a Windows system and hence can't test/reproduce anything related to this. Based on what i have seen the posts (that i referred in my earlier reply), JBoss expects the hostname entry to be present/mapped in the /etc/hosts file. So the simplest way to get this working is, every time your hostname changes, you will have to edit the /etc/hosts file to map the IP and the hostname.

                      • 8. Re: Hostname problem while starting jboss
                        S K Newbie

                        Yes I understand that JBoss expects machine's name to be mapped properly in /etc/hosts file.
                        But unfortunately, I am using DHCP to get ip/hostname of my machine. So there is no way
                        I can have static /etc/hosts file. Yes as you suggested, each time if I change it manually,
                        it will work perhaps. But, I was just trying to avoid this pain.

                        Anyway many thanks for your suggestion though.

                        Regards,
                        Sahid