You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Badri <ba...@fxall.com> on 2008/05/13 23:03:55 UTC

activemq-admin error during stop

Hi

I am using AMQ 5.1.0. I am unable to stop Active MQ. 

First I get FailoverTransport error when it's trying to connect to
localhost:61616. Connection refused error.

2008-05-13 16:39:48,568 DEBUG FailoverTransport              - Attempting
connect to: tcp://localhost:61616
2008-05-13 16:39:48,568 DEBUG FailoverTransport              - Connect fail
to: tcp://localhost:61616, reason: java.net.ConnectException: Connection
refused
2008-05-13 16:39:48,568 DEBUG FailoverTransport              - Waiting 30000
ms before attempting connection. 

This is my activemq.xml config file:

    <broker xmlns="http://activemq.apache.org/schema/core" useJmx="false"
persistent="false">
  
<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

<!-- The store and forward broker networks ActiveMQ will listen to -->
        <networkConnectors>
          <!-- by default just auto discover the other brokers -->
          <networkConnector name="default-nc" uri="multicast://default"/>
          <!-- Example of a static configuration:
          <networkConnector name="host1 and host2"
uri="static://(tcp://host1:61616,tcp://host2:61616)"/> -->
        </networkConnectors>

        <!-- The transport connectors ActiveMQ will listen to -->
       <transportConnectors>
         <transportConnector name="openwire" uri="tcp://localhost:2506"/>
        <!-- <transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
            <transportConnector name="ssl" uri="ssl://localhost:61617"/>
            <transportConnector name="stomp" uri="stomp://localhost:61613"/>
            <transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
-->
        </transportConnectors>
    </broker>

I am trying to figure out why is port 61616 being used even though I have
commented in activemq.xml

Upon stop,

2008-05-13 16:37:18,561 DEBUG FailoverTransport              - Attempting
connect to: tcp://localhost:61616
2008-05-13 16:37:18,562 DEBUG FailoverTransport              - Connect fail
to: tcp://localhost:61616, reason: java.net.ConnectException: Connection
refused
2008-05-13 16:37:18,562 DEBUG FailoverTransport              - Waiting 30000
ms before attempting connection. 
[JRockit] Local management server started.
ACTIVEMQ_HOME: /opt/fxall/activemq
ACTIVEMQ_BASE: /opt/fxall/activemq
ERROR: java.lang.RuntimeException: Failed to execute stop task. Reason:
java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exc
eption is java.rmi.ConnectException: Connection refused to host: localhost;
nested exception is: 
        java.net.ConnectException: Connection refused]
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]
        at
org.apache.activemq.console.command.ShutdownCommand.runTask(ShutdownCommand.java:104)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        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:585)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:222)
        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.ConnectException: Connect
ion refused to host: localhost; nested exception is: 
        java.net.ConnectException: Connection refused]
java.lang.Exception: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exception is
java.rmi.ConnectException: Connection ref
used to host: localhost; nested exception is: 
        java.net.ConnectException: Connection refused]
        at
org.apache.activemq.console.command.ShutdownCommand.runTask(ShutdownCommand.java:105)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
        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:585)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:222)
        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 ho
st: localhost; nested exception is: 
        java.net.ConnectException: Connection refused]
        at
javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:317)
        at
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:207)
        at
org.apache.activemq.console.filter.MBeansObjectNameQueryFilter.createJmxConnector(MBeansObjectNameQueryFilter.java:162)
        at
org.apache.activemq.console.filter.MBeansObjectNameQueryFilter.queryMBeans(MBeansObjectNameQueryFilter.java:114)
        at
org.apache.activemq.console.filter.MBeansObjectNameQueryFilter.query(MBeansObjectNameQueryFilter.java:101)
        at
org.apache.activemq.console.filter.AbstractQueryFilter.query(AbstractQueryFilter.java:43)
        at
org.apache.activemq.console.util.JmxMBeansUtil.getAllBrokers(JmxMBeansUtil.java:44)
        at
org.apache.activemq.console.command.ShutdownCommand.runTask(ShutdownCommand.java:68)
        ... 10 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]
        at
com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
        at
com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at
javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1817)
        at
javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1787)
        at
javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:259)
        ... 18 more
Caused by: java.rmi.ConnectException: Connection refused to host: localhost;
nested exception is: 
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
        at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
        at
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at
com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:93)
        ... 23 more


The process keeps running. Can someone let me know if I have configured  the
Active MQ wrongly?

Previously we used 4.0.1 & we want to upgrade to 5.1. We used to start using
command line ./activemq broker:tcp://localhost:2506 >> ~/logs/activemq.log
2>&1 &
So we never used the xml to configure active mq.

Thanks for your guidance & help.

-- 
View this message in context: http://www.nabble.com/activemq-admin-error-during-stop-tp17218304s2354p17218304.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: activemq-admin error during stop

Posted by Hiram Chirino <hi...@hiramchirino.com>.
The activemq-admin stop command also supports passing in the JMX url
for the broker.. So you just need to pass in the JMX url (which would
just change the 1199 port)

On Wed, May 14, 2008 at 2:53 PM, Mike Miljour <mm...@idanalytics.com> wrote:
>
> I should have added this to my boker config above:
>  <managementContext>
>       <managementContext connectorPort="1199"
> jmxDomainName="org.apache.activemq"/>
>    </managementContext>
>
> Setting the connectionPort to 1099 allows stop to work, but prevents us from
> having multiple brokers on the same machine.
> --
> View this message in context: http://www.nabble.com/activemq-admin-error-during-stop-tp17218304s2354p17238405.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Re: activemq-admin error during stop

Posted by Mike Miljour <mm...@idanalytics.com>.
I should mention that the reason I was using this script was because there
were no activemq scripts in either of the linux directories.  But since I
noticed this bug:  https://issues.apache.org/activemq/browse/AMQ-1728
https://issues.apache.org/activemq/browse/AMQ-1728 
I have just copied the script from the macos directory (as was instructed in
another post) and am working again.
-- 
View this message in context: http://www.nabble.com/activemq-admin-error-during-stop-tp17218304s2354p17239975.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: activemq-admin error during stop

Posted by Mike Miljour <mm...@idanalytics.com>.
I should have added this to my boker config above:
 <managementContext>
       <managementContext connectorPort="1199"
jmxDomainName="org.apache.activemq"/>
    </managementContext>

Setting the connectionPort to 1099 allows stop to work, but prevents us from
having multiple brokers on the same machine.
-- 
View this message in context: http://www.nabble.com/activemq-admin-error-during-stop-tp17218304s2354p17238405.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: activemq-admin error during stop

Posted by Mike Miljour <mm...@idanalytics.com>.
Actually, I have overridden my port to use JMX on 1199.  If I set the value
back to the default of 1099, stop works. Could this shutdown value be hard
coded?


Hiram Chirino wrote:
> 
> could you run netstat -a and make sure that port 1099 is open.  That's
> the JMX management port that the broker will open to receive those JMX
> commands like shutdown.
> 
> 

-- 
View this message in context: http://www.nabble.com/activemq-admin-error-during-stop-tp17218304s2354p17237827.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: activemq-admin error during stop

Posted by Hiram Chirino <hi...@hiramchirino.com>.
could you run netstat -a and make sure that port 1099 is open.  That's
the JMX management port that the broker will open to receive those JMX
commands like shutdown.

On Tue, May 13, 2008 at 6:36 PM, Mike Miljour <mm...@idanalytics.com> wrote:
>
> I am encountering the same problem.  Even if I use the default port of 61616,
> I get the exact same exceptions.  I am trying to upgrade from a snapshot 5.0
> from January.  We need the ability to shutdown ActiveMQ from a script.
>
> Here is my configuration:
>  <broker xmlns="http://activemq.org/config/1.0"
>        deleteAllMessagesOnStartup="true"
>        dataDirectory="//data"
>        persistent="true">
>
>    <!-- The transport connectors ActiveMQ will listen to -->
>    <transportConnectors>
>       <transportConnector name="openwire"
> uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"/>
>     </transportConnectors>
>
>  </broker>
>
>
>
> Badri wrote:
>>
>> Hi
>>
>> I am using AMQ 5.1.0. I am unable to stop Active MQ.
>>
>
> --
> View this message in context: http://www.nabble.com/activemq-admin-error-during-stop-tp17218304s2354p17219861.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Re: activemq-admin error during stop

Posted by Mike Miljour <mm...@idanalytics.com>.
I am encountering the same problem.  Even if I use the default port of 61616,
I get the exact same exceptions.  I am trying to upgrade from a snapshot 5.0
from January.  We need the ability to shutdown ActiveMQ from a script.

Here is my configuration:
  <broker xmlns="http://activemq.org/config/1.0" 
	deleteAllMessagesOnStartup="true"  
	dataDirectory="//data" 
	persistent="true">
	
    <!-- The transport connectors ActiveMQ will listen to -->
    <transportConnectors>
       <transportConnector name="openwire"
uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"/>
     </transportConnectors>

 </broker>



Badri wrote:
> 
> Hi
> 
> I am using AMQ 5.1.0. I am unable to stop Active MQ. 
> 

-- 
View this message in context: http://www.nabble.com/activemq-admin-error-during-stop-tp17218304s2354p17219861.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.