6 Replies Latest reply on Feb 18, 2010 1:47 AM by rasa

    How to work with twiddle.sh

    rasa

      Hi,

       

      My application was giving OutofMemeoryError in one of our clinet location and i am not able to open the jboss-webconsole. The log was configured using log4j so i am not able to do thread dump also. Hence i used twiddle ,

       

      cd $JBOSS_HOME/bin/
      sh twiddle.sh invoke "jboss.system:type=ServerInfo" listThreadDump > dump.html

       

      And in html the contents are as follows. Since i dnt have persmission to access the server i didn't checked anything. I dont' know why the out pout is like this.

       

      17:58:49,489 WARN [NamingContext] Failed to connect to localhost:1099 javax.naming.CommunicationException: Failed to retrieve stub from server localhost:1099 [Root exception is java.io.EOFException] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:207) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1185) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509) at javax.naming.InitialContext.lookup(InitialContext.java:347) at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:239) at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:257) at org.jboss.console.twiddle.Twiddle.access$300(Twiddle.java:51) at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:128) at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:47) at org.jboss.console.twiddle.command.MBeanServerCommand.queryMBeans(MBeanServerCommand.java:54) at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:251) at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:288) Caused by: java.io.EOFException at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2425) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1245) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322) at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:195) ... 12 more 17:58:54,519 ERROR [Twiddle] Exec failed org.jboss.util.NestedRuntimeException: Receive timed out; - nested throwable: (javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]) at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:132) at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:47) at org.jboss.console.twiddle.command.MBeanServerCommand.queryMBeans(MBeanServerCommand.java:54) at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:251) at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:288) Caused by: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1119) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1196) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:516) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509) at javax.naming.InitialContext.lookup(InitialContext.java:347) at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:239) at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:257) at org.jboss.console.twiddle.Twiddle.access$300(Twiddle.java:51) at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:128) ... 4 more Caused by: java.net.SocketTimeoutException: Receive timed out at java.net.PlainDatagramSocketImpl.receive(Native Method) at java.net.DatagramSocket.receive(DatagramSocket.java:711) at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1089) ... 12 more

        • 1. Re: How to work with twiddle.sh
          peterj
          Are you running twiddle on the same machine as JBoss AS? Is port 1099 being used for JNDI or did you change the port?
          • 2. Re: How to work with twiddle.sh
            rasa

            Are you running twiddle on the same machine as JBoss AS?

            Yes, I am doing twiddle from the same machine where i have configured the JBOSS AS.

             

            Is port 1099 being used for JNDI or did you change the port?

            port is 1099 and i didn't made any change in that.

            • 3. Re: How to work with twiddle.sh
              jaikiran

              What's the output of

               

              telnet localhost 1099
              

               

              from that machine?

              • 4. Re: How to work with twiddle.sh
                rasa

                [appusr@server-180 jboss-3.2.5]$ telnet localhost 1099
                Trying 127.0.0.1...
                Connected to localhost (127.0.0.1).
                Escape character is '^]'.
                ¬ísrjava.rmi.MarshalledObject|½ícü>IhashlocBytest[BobjBytesq~xp¥Ýñur[B¬óTàxp&¬íthttp://server-180:8083/q~q~uq~¬ísr org.jnp.server.NamingServer_Stubxrjava.rmi.server.RemoteStubéþÜÉáexrjava.rmi.server.RemoteObjectÓa´
                                                                     a3xpw6
                                                                           UnicastRef2
                                                                                      199.1.112.180JƲ&Ñ·¹xConnection closed by foreign host.
                [appusr@server-180 jboss-3.2.5]$ VT102VT102VT102

                 

                I have changed the user name ,server name and ip  rest of the things are not changed.

                • 5. Re: How to work with twiddle.sh
                  peterj

                  Check your /etc/hosts file and make sure that the entry that has your hostname in it has the IP address from the telnet results: 199.1.112.180

                   

                  I bookmarked this web page that gives some detailed steps on ensuring that your hostname and IP address are properly configured, but it appears to be down at this time (I hope that is not permanent):

                  http://www.cpqlinux.com/hostname.html

                   

                  I think that the page moved to:

                  http://jblevins.org/computing/linux/hostname

                  • 6. Re: How to work with twiddle.sh
                    rasa
                    Yes the entries there and i have seen that it entered twice in etc/hosts file, i asked admin to remove one entry and then i will run the command once again. Is there anything else you want me to check ?