3 Replies Latest reply on Nov 27, 2010 9:03 AM by jaikiran pai

    twiddle localhost jboss 6.0

    David Bettenhausen Newbie

      /var/jboss6/bin/twiddle.sh get "jboss.system:type=ServerInfo"

      I have an ant script that deploys my ear from eclipse to my remote server. This script works when I have jboss 5 running and fails when I have jboss 6   (jboss-6.0.0.20101110-CR1) running. The only change I make to the script is to change the jboss home directory.

       

      /var/jboss6/bin/twiddle.sh -q -s localhost invoke "jboss.system:service=MainDeployer" deploy "file:///home/websrc/ThirdEAR.ear"

       

      I execute this with an ant but I also tried it from the command line. Works fine with 5.1 but with 6.0 it fails with

       

        [sshexec] 11:37:47,800 ERROR [Twiddle] Exec failed

        [sshexec] org.jboss.util.NestedRuntimeException: Service URL must start with service:jmx:; - nested throwable: (java.net.MalformedURLException: Service URL must start with service:jmx:)

        [sshexec] at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:208)

        [sshexec] at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:64)

        [sshexec] at org.jboss.console.twiddle.command.MBeanServerCommand.queryMBeans(MBeanServerCommand.java:71)

        [sshexec] at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:284)

        [sshexec] at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:357)

        [sshexec] Caused by: java.net.MalformedURLException: Service URL must start with service:jmx:

        [sshexec] at javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:143)

        [sshexec] at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:308)

        [sshexec] at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:318)

        [sshexec] at org.jboss.console.twiddle.Twiddle.access$400(Twiddle.java:60)

        [sshexec] at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:204)

        [sshexec] ... 4 more

       

      As a test I tried this simpler command on both 5.1 and 6.0

       

       

      Either of these two command work when I have jboss 5.1 started.

       

       

      /var/jboss5/bin/twiddle.sh get "jboss.system:type=ServerInfo"

      /var/jboss5/bin/twiddle.sh -s localhost get "jboss.system:type=ServerInfo"

       

       

       

      This command works when jboss 6 is started:

       

      /var/jboss6/bin/twiddle.sh get "jboss.system:type=ServerInfo"

       

      But this one with the -s localhost option:

       

       

      /var/jboss6/bin/twiddle.sh -s localhost get "jboss.system:type=ServerInfo"

       

      fails with:

       

       

      11:27:58,215 ERROR [Twiddle] Exec failed

      org.jboss.util.NestedRuntimeException: Service URL must start with service:jmx:; - nested throwable: (java.net.MalformedURLException: Service URL must start with service:jmx:)

      at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:208)

      at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:64)

      at org.jboss.console.twiddle.command.GetCommand.execute(GetCommand.java:149)

      at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:357)

      Caused by: java.net.MalformedURLException: Service URL must start with service:jmx:

      at javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:143)

      at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:308)

      at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:318)

      at org.jboss.console.twiddle.Twiddle.access$400(Twiddle.java:60)

      at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:204)

      ... 3 more

       

      Obviously this is not a bug but something I am not understanding. If one of you could toss me a clue that would be great. Hope you had a nice Thanksgiving. Thanks.

       

       

        • 1. Re: twiddle localhost jboss 6.0
          jaikiran pai Master

          This is what twiddle.sh --help gives in 6.0 CR1:

           

          ./twiddle.sh --help
          A JMX client to 'twiddle' with a remote JBoss server.
          
          usage: twiddle.sh [options] <command> [command_arguments]
          
          options:
              -h, --help                Show this help message
                  --help-commands       Show a list of commands
              -H<command>               Show command specific help
              -c=command.properties     Specify the command.properties file to use
              -D<name>[=<value>]        Set a system property
              --                        Stop processing options
              -s, --server=<url>        The JMX service URL of the remote server (e.g. service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi) 
              -o, --host=<HOSTNAME>     The name of the remote server (e.g. localhost) 
              -r, --port=<PORTNUMBER>   The rmiRegistryPort of the remote server (e.g. 1090) 
              -u, --user=<name>         Specify the username for authentication
              -p, --password=<name>     Specify the password for authentication
              -q, --quiet               Be somewhat more quiet
              -v, --verbose             Be noisy
          
          for convenience, you can specify --host and --port but not with the --server=<url> which overrides host + port.
          

           

          Notice what it says for the -s param.

          1 of 1 people found this helpful
          • 2. Re: twiddle localhost jboss 6.0
            David Bettenhausen Newbie

            ok. using

            service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi

            for the -s param works. Or I can leave it off and that works.

             

            Thanks jaikiran. If I could impose for one additional question I would be most grateful.

             

            I am still having trouble with my deploy command. After replacing "localhost" with that string from the help text I get

             

            /var/jboss6/bin/twiddle.sh -q -s service:jmx:rmi:///jndi/rmi//localhost:1090/jmxrmi invoke "jboss.system:service=MainDeployer" deploy "file:///home/websrc/ThirdEAR.ear"

             

            When I execute this as root it can't seem to find the file I am deploying. This file does exist in the /home/websrc directory.

             

            jboss.system:service=MainDeployer,deploy,file:///home/websrc/ThirdEAR.ear
            12:23:31,560 DEBUG [InvokeCommand] query: jboss.system:service=MainDeployer
            12:23:31,560 DEBUG [InvokeCommand] operation name: deploy
            12:23:31,560 DEBUG [InvokeCommand] operation arguments: [file:///home/websrc/ThirdEAR.ear]
            12:23:31,670 DEBUG [InvokeCommand] Query matches: [jboss.system:service=MainDeployer]
            12:23:31,670 DEBUG [InvokeCommand] Invoke jboss.system:service=MainDeployer
            12:23:31,702 DEBUG [InvokeCommand] Using params: file:///home/websrc/ThirdEAR.ear
            12:23:31,736 ERROR [Twiddle] Exec failed
            javax.management.MBeanException
            at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:184)
            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:165)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
            at org.jboss.system.server.jmx.MBeanServerWrapper.invoke(MBeanServerWrapper.java:138)
            at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
            at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
            at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
            at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
            at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
            at sun.rmi.transport.Transport$1.run(Transport.java:159)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
            at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
            at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
            at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:993)
            at org.jboss.console.twiddle.command.InvokeCommand.invoke(InvokeCommand.java:235)
            at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:292)
            at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:357)
            Caused by: org.jboss.deployment.DeploymentException: Failed to deploy: file:/home/websrc/ThirdEAR.ear
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:393)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:347)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
            at org.jboss.system.server.jmx.MBeanServerWrapper.invoke(MBeanServerWrapper.java:138)
            at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
            at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
            at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
            at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
            at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
            at sun.rmi.transport.Transport$1.run(Transport.java:159)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: java.io.FileNotFoundException: /home/websrc/ThirdEAR.ear (Permission denied)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:106)
            at org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:55)
            at org.jboss.vfs.protocol.FileURLConnection.getInputStream(FileURLConnection.java:73)
            at java.net.URL.openStream(URL.java:1010)
            at org.jboss.deployment.MainDeployer.copy(MainDeployer.java:433)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:371)
            ... 30 more

            12:23:31,560 DEBUG [InvokeCommand] query: jboss.system:service=MainDeployer

            12:23:31,560 DEBUG [InvokeCommand] operation name: deploy

            12:23:31,560 DEBUG [InvokeCommand] operation arguments: [file:///home/websrc/ThirdEAR.ear]

            12:23:31,670 DEBUG [InvokeCommand] Query matches: [jboss.system:service=MainDeployer]

            12:23:31,670 DEBUG [InvokeCommand] Invoke jboss.system:service=MainDeployer

            12:23:31,702 DEBUG [InvokeCommand] Using params: file:///home/websrc/ThirdEAR.ear

            12:23:31,736 ERROR [Twiddle] Exec failed

            javax.management.MBeanException

            at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:184)

            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:165)

            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)

            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)

            at org.jboss.system.server.jmx.MBeanServerWrapper.invoke(MBeanServerWrapper.java:138)

            at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)

            at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)

            at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)

            at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)

            at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)

            at sun.rmi.transport.Transport$1.run(Transport.java:159)

            at java.security.AccessController.doPrivileged(Native Method)

            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

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

            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)

            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)

            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)

            at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)

            at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)

            at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:993)

            at org.jboss.console.twiddle.command.InvokeCommand.invoke(InvokeCommand.java:235)

            at org.jboss.console.twiddle.command.InvokeCommand.execute(InvokeCommand.java:292)

            at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:357)

            Caused by: org.jboss.deployment.DeploymentException: Failed to deploy: file:/home/websrc/ThirdEAR.ear

            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:393)

            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:347)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)

            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)

            at org.jboss.system.server.jmx.MBeanServerWrapper.invoke(MBeanServerWrapper.java:138)

            at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)

            at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)

            at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)

            at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)

            at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:597)

            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)

            at sun.rmi.transport.Transport$1.run(Transport.java:159)

            at java.security.AccessController.doPrivileged(Native Method)

            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

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

            Caused by: java.io.FileNotFoundException: /home/websrc/ThirdEAR.ear (Permission denied)

            at java.io.FileInputStream.open(Native Method)

            at java.io.FileInputStream.<init>(FileInputStream.java:106)

            at org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:55)

            at org.jboss.vfs.protocol.FileURLConnection.getInputStream(FileURLConnection.java:73)

            at java.net.URL.openStream(URL.java:1010)

            at org.jboss.deployment.MainDeployer.copy(MainDeployer.java:433)

            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:371)

            ... 30 more

            • 3. Re: twiddle localhost jboss 6.0
              jaikiran pai Master
              Caused by: java.io.FileNotFoundException: /home/websrc/ThirdEAR.ear  (Permission denied)

              It's a Permission denied error. Which user do you use to run JBoss and what permissions does the folder/file have?