You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Johannes Frank <jo...@kisters.de> on 2009/05/29 10:45:59 UTC

Activemq-admin stop does not work

Hello I'm trying to use "activemq-admin stop" to stop a running activemq
instance (it is running, I have the other console spitting out output all
the time). I'm using the standard activemq 5.2 I downloaded from you.
However, as soon as I'm doing the stop command: the following Exception
jungle is generated:

ACTIVEMQ_HOME:
D:\work\rms\D-Scheduler\KIDSM\JMSBroker\kidsm_jmsbroker\bin\..
ACTIVEMQ_BASE:
D:\work\rms\D-Scheduler\KIDSM\JMSBroker\kidsm_jmsbroker\bin\..
ERROR: java.lang.RuntimeException: Failed to execute stop task. Reason:
java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection refused to host: localhost; nested
exception is:
        java.net.ConnectException: Connection refused: connect]
java.lang.RuntimeException: Failed to execute stop task. Reason:
java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection refused to host: localhost; nested
exception is:
        java.net.ConnectException: Connection refused: connect]
        at
org.apache.activemq.console.command.ShutdownCommand.runTask(ShutdownCommand.java:106)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.AbstractJmxCommand.execute(AbstractJmxCommand.java:224)
        at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:129)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:79)
        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.apache.activemq.console.Main.runTaskClass(Main.java:225)
        at org.apache.activemq.console.Main.main(Main.java:106)
ERROR: java.lang.Exception: java.io.IOException: Failed to retrieve
RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is
java.rmi.Connect
Exception: Connection refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused: connect]
java.lang.Exception: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection refused to host: localhost; nested
exception is:
        java.net.ConnectException: Connection refused: connect]
        at
org.apache.activemq.console.command.ShutdownCommand.runTask(ShutdownCommand.java:107)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.AbstractJmxCommand.execute(AbstractJmxCommand.java:224)
        at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:129)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:79)
        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.apache.activemq.console.Main.runTaskClass(Main.java:225)
        at org.apache.activemq.console.Main.main(Main.java:106)
Caused by: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection refused to host: localhost; nested
exception is:
        java.net.ConnectException: Connection refused: connect]
        at
javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
        at
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:207)
        at
org.apache.activemq.console.command.AbstractJmxCommand.createJmxConnector(AbstractJmxCommand.java:146)
        at
org.apache.activemq.console.command.AbstractJmxCommand.createJmxConnection(AbstractJmxCommand.java:169)
        at
org.apache.activemq.console.command.ShutdownCommand.runTask(ShutdownCommand.java:70)
        ... 11 more
Caused by: javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection refused to host: localhost; nested
exception is:
        java.net.ConnectException: Connection refused: connect]
        at
com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
        at
com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at
javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
        at
javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
        at
javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
        ... 16 more
Caused by: java.rmi.ConnectException: Connection refused to host: localhost;
nested exception is:
        java.net.ConnectException: Connection refused: connect
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
        at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
        at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at
com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
        ... 21 more
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at java.net.Socket.connect(Socket.java:469)
        at java.net.Socket.<init>(Socket.java:366)
        at java.net.Socket.<init>(Socket.java:180)
        at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
        at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
        ... 26 more

What can I do here?
-- 
View this message in context: http://www.nabble.com/Activemq-admin-stop-does-not-work-tp23776414p23776414.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


RE: Activemq-admin stop does not work

Posted by Nawaz Ahmed <na...@progress.com>.
Hello Bruce,

  Even After making the changes in the Activemq.bat file as mentioned in


  your mail, I was not able to stop the Broker using the command
"Activemq-

  admin stop hostname"

  

  Starting the ActiveMQ after making the changes in the activemq.bat
file 

  gives me the following errors in the console : 

  

'SUNJMX' is not recognized as an internal or external command,operable
program or batch file.

'-Dcom.sun.management.jmxremote.authenticate' is not recognized as an
internal or external command, operable program or batch file.

'-Dcom.sun.management.jmxremote.ssl' is not recognized as an internal or
external command,operable program or batch file.

 

  What changes need to be done in order to make it work properly?

  Eagerly waiting for your reply. 

  NOTE: ActiveMQ.bat file is attached with this mail in the text format.

 

Thanks and Regards,

Nawaz Ahmed

Progress Software Development Pvt Ltd 

 

-----Original Message-----
From: Bruce Snyder [mailto:bruce.snyder@gmail.com] 
Sent: Saturday, May 30, 2009 12:16 AM
To: users@activemq.apache.org
Subject: Re: Activemq-admin stop does not work

 

On Fri, May 29, 2009 at 2:45 AM, Johannes Frank

<jo...@kisters.de> wrote:

> 

> Hello I'm trying to use "activemq-admin stop" to stop a running
activemq

> instance (it is running, I have the other console spitting out output
all

> the time). I'm using the standard activemq 5.2 I downloaded from you.

> However, as soon as I'm doing the stop command: the following
Exception

> jungle is generated:

 

You just need to edit the ActiveMQ startup script a bit so that JMX

authentication and SSL are disabled and a port number is specified.

Just make the following edits to lines 76-77 to the bin/activemq.bat

script:

 

if "%SUNJMX%" == "" set

SUNJMX=-Dcom.sun.management.jmxremote.port=1099

-Dcom.sun.management.jmxremote.authenticate=false

-Dcom.sun.management.jmxremote.ssl=false

REM set SUNJMX=-Dcom.sun.management.jmxremote

 

After making this quick change to the script, start up ActiveMQ again

and the 'activemq-admin stop' command should work properly.

 

Bruce

-- 

perl -e 'print
unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

);'

 

ActiveMQ in Action: http://bit.ly/2je6cQ

Blog: http://bruceblog.org/

Twitter: http://twitter.com/brucesnyder


Re: Activemq-admin stop does not work

Posted by Bruce Snyder <br...@gmail.com>.
On Fri, May 29, 2009 at 2:45 AM, Johannes Frank
<jo...@kisters.de> wrote:
>
> Hello I'm trying to use "activemq-admin stop" to stop a running activemq
> instance (it is running, I have the other console spitting out output all
> the time). I'm using the standard activemq 5.2 I downloaded from you.
> However, as soon as I'm doing the stop command: the following Exception
> jungle is generated:

You just need to edit the ActiveMQ startup script a bit so that JMX
authentication and SSL are disabled and a port number is specified.
Just make the following edits to lines 76-77 to the bin/activemq.bat
script:

if "%SUNJMX%" == "" set
SUNJMX=-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
REM set SUNJMX=-Dcom.sun.management.jmxremote

After making this quick change to the script, start up ActiveMQ again
and the 'activemq-admin stop' command should work properly.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder