Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1216F10A5F for ; Thu, 25 Jul 2013 21:48:36 +0000 (UTC) Received: (qmail 46166 invoked by uid 500); 25 Jul 2013 21:48:35 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 46129 invoked by uid 500); 25 Jul 2013 21:48:35 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 46121 invoked by uid 99); 25 Jul 2013 21:48:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 21:48:35 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chiragpujara@gmail.com designates 74.125.82.169 as permitted sender) Received: from [74.125.82.169] (HELO mail-we0-f169.google.com) (74.125.82.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 21:48:31 +0000 Received: by mail-we0-f169.google.com with SMTP id n5so433418wev.14 for ; Thu, 25 Jul 2013 14:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=gaGxh3W8yoZk4SDue/KMLwvDj7W3ilkWFXVn9Z1jXs4=; b=A7A9wxFCsbehKlQjorVOhqNFmGisfkZ+9SioVvWX9MtfwRb9g2Pv4Yzb6kFzNyWJZO aMrrIS7GQJ/ehinxRkAXQEca3tc4BKO4KsCtLOMVV955UfMNFoWyKcou6TLdUHxvD4OZ 0aPVSon/e1BquYgyf6ZBU63fiJlY5sI2MgY9dkzSgsBMDFN8VGoP5PXU9B7FNafCtpCk msMotfwOi9BsJQpsPjbPqZKAvAE0dyWIZeQPdFex/+Db0LBeo2+1kIY1LYZvWr1OvnZt TEQ+lqKiZb3gLVoHnZY0TgxW9p2ica1nFlkAtfnOE57pys423LElGI3w8cj1U5j/eoYS WB7w== MIME-Version: 1.0 X-Received: by 10.194.83.74 with SMTP id o10mr4033801wjy.95.1374788889520; Thu, 25 Jul 2013 14:48:09 -0700 (PDT) Received: by 10.194.46.74 with HTTP; Thu, 25 Jul 2013 14:48:09 -0700 (PDT) In-Reply-To: References: Date: Thu, 25 Jul 2013 16:48:09 -0500 Message-ID: Subject: Re: Ativemq instance will not shutdown gracefully. From: Chirag Pujara To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=047d7bb04b3466aece04e25cfb1a X-Virus-Checked: Checked by ClamAV on apache.org --047d7bb04b3466aece04e25cfb1a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I think I figured out issue. It was user problem. I started process with diff. user and was trying to shutdown as root user. thanks, chirag On Thu, Jul 25, 2013 at 2:50 PM, Chirag Pujara wrot= e: > Hello, > > when I try to shutdown activemq instance it throws exception that it > cannot connect to jmxUrl for process. and then kills the process after 30 > secs. > > Here is stack strace: > > 14:34:39 # */opt/gwx/apache-activemq-5.8.0/activemq_8300/bin/activemq_830= 0 > stop "-Dactivemq.jmx.url=3Dservice:jmx:rmi:///jndi/rmi:// > 127.0.0.1:8300/jmxrmi"* > dirname_prg: /opt/gwx/apache-activemq-5.8.0/activemq_8300/bin > INFO: Loading '/etc/default/activemq' > INFO: Using java '/usr/bin/java' > INFO: Waiting at least 30 seconds for regular process termination of pid > '3234' : > Java Runtime: Oracle Corporation 1.7.0_25 /usr/java/jdk1.7.0_25/jre > Heap sizes: current=3D1004928k free=3D999683k max=3D1004928k > JVM args: -Xms1G -Xmx1G > -Djava.util.logging.config.file=3Dlogging.properties > -Dactivemq.classpath=3D/opt/gwx/apache-activemq-5.8.0/activemq_8300/conf; > -Dactivemq.home=3D/opt/gwx/apache-activemq-5.8.0 > -Dactivemq.base=3D/opt/gwx/apache-activemq-5.8.0/activemq_8300 > -Dactivemq.conf=3D/opt/gwx/apache-activemq-5.8.0/activemq_8300/conf > -Dactivemq.data=3D/opt/gwx/apache-activemq-5.8.0/activemq_8300/data > Extensions classpath: > > [/opt/gwx/apache-activemq-5.8.0/activemq_8300/lib,/opt/gwx/apache-activem= q-5.8.0/lib,/opt/gwx/apache-activemq-5.8.0/activemq_8300/lib/camel,/opt/gwx= /apache-activemq-5.8.0/activemq_8300/lib/optional,/opt/gwx/apache-activemq-= 5.8.0/activemq_8300/lib/web,/opt/gwx/apache-activemq-5.8.0/activemq_8300/li= b/extra,/opt/gwx/apache-activemq-5.8.0/lib/camel,/opt/gwx/apache-activemq-5= .8.0/lib/optional,/opt/gwx/apache-activemq-5.8.0/lib/web,/opt/gwx/apache-ac= tivemq-5.8.0/lib/extra] > ACTIVEMQ_HOME: /opt/gwx/apache-activemq-5.8.0 > ACTIVEMQ_BASE: /opt/gwx/apache-activemq-5.8.0/activemq_8300 > ACTIVEMQ_CONF: /opt/gwx/apache-activemq-5.8.0/activemq_8300/conf > ACTIVEMQ_DATA: /opt/gwx/apache-activemq-5.8.0/activemq_8300/data > ..Connecting to pid: 3234 > ......INFO: failed to resolve jmxUrl for pid:3234, using default JMX url > .......Connecting to JMX URL: > service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi > ..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] > 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(ShutdownComma= nd.java:116) > at > org.apache.activemq.console.command.AbstractCommand.execute(AbstractComma= nd.java:57) > at > org.apache.activemq.console.command.AbstractJmxCommand.execute(AbstractJm= xCommand.java:387) > at > org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.jav= a:150) > at > org.apache.activemq.console.command.AbstractCommand.execute(AbstractComma= nd.java:57) > at > org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:1= 04) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.activemq.console.Main.runTaskClass(Main.java:262) > at org.apache.activemq.console.Main.main(Main.java:115) > ERROR: 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] > 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] > at > org.apache.activemq.console.command.ShutdownCommand.runTask(ShutdownComma= nd.java:117) > at > org.apache.activemq.console.command.AbstractCommand.execute(AbstractComma= nd.java:57) > at > org.apache.activemq.console.command.AbstractJmxCommand.execute(AbstractJm= xCommand.java:387) > at > org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.jav= a:150) > at > org.apache.activemq.console.command.AbstractCommand.execute(AbstractComma= nd.java:57) > at > org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:1= 04) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.activemq.console.Main.runTaskClass(Main.java:262) > at org.apache.activemq.console.Main.main(Main.java:115) > 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] > at > javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:358) > at > javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.j= ava:268) > at > javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.j= ava:227) > at > org.apache.activemq.console.command.AbstractJmxCommand.createJmxConnector= (AbstractJmxCommand.java:279) > at > org.apache.activemq.console.command.AbstractJmxCommand.createJmxConnectio= n(AbstractJmxCommand.java:302) > at > org.apache.activemq.console.command.ShutdownCommand.runTask(ShutdownComma= nd.java:81) > ... 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] > at > com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:118= ) > at > com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:= 203) > at javax.naming.InitialContext.lookup(InitialContext.java:411) > at > javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.j= ava:1925) > at > javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:= 1892) > at > javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:275) > ... 16 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:619) > at > sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216) > at > sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) > at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:340) > at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) > at > com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:114= ) > ... 21 more > Caused by: java.net.ConnectException: Connection refused > at java.net.PlainSocketImpl.socketConnect(Native Method) > at > java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:3= 39) > at > java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl= .java:200) > at > java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182= ) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) > at java.net.Socket.connect(Socket.java:579) > at java.net.Socket.connect(Socket.java:528) > at java.net.Socket.(Socket.java:425) > at java.net.Socket.(Socket.java:208) > at > sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSock= etFactory.java:40) > at > sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSock= etFactory.java:146) > at > sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613) > ... 26 more > ............ > INFO: Regular shutdown not successful, sending SIGKILL to process with > pid '3234' > > > ----------------- > > Here is what my activemq_8100 script looks like: > > ## Figure out the ACTIVEMQ_BASE from the directory this script was run fr= om > PRG=3D"$0" > progname=3D`basename "$0"` > saveddir=3D`pwd` > # need this for relative symlinks > dirname_prg=3D`dirname "$PRG"` > cd "$dirname_prg" > echo "dirname_prg: $dirname_prg" > while [ -h "$PRG" ] ; do > ls=3D`ls -ld "$PRG"` > link=3D`expr "$ls" : '.*-> \(.*\)$'` > if expr "$link" : '.*/.*' > /dev/null; then > PRG=3D"$link" > else > PRG=3D`dirname "$PRG"`"/$link" > fi > done > ACTIVEMQ_BASE=3D`dirname "$PRG"`/.. > cd "$saveddir" > > ACTIVEMQ_BASE=3D`cd "$ACTIVEMQ_BASE" && pwd` > > ## Add system properties for this instance here (if needed), e.g > #export ACTIVEMQ_OPTS_MEMORY=3D"-Xms256M -Xmx1G" > #export ACTIVEMQ_OPTS=3D"$ACTIVEMQ_OPTS_MEMORY > -Dorg.apache.activemq.UseDedicatedTaskRunner=3Dtrue > -Djava.util.logging.config.file=3Dlogging.properties" > > export > ACTIVEMQ_SUNJMX_CONTROL=3D"-Dactivemq.jmx.url=3Dservice:jmx:rmi:///jndi/r= mi:// > 127.0.0.1:8100/jmxrmi" > # > ACTIVEMQ_SUNJMX_START=3D"-Dcom.sun.management.jmxremote.port=3D8100 " > ACTIVEMQ_SUNJMX_START=3D"$ACTIVEMQ_SUNJMX_START > -Dcom.sun.management.jmxremote.password.file=3D${ACTIVEMQ_BASE}/conf/jmx.= password" > ACTIVEMQ_SUNJMX_START=3D"$ACTIVEMQ_SUNJMX_START > -Dcom.sun.management.jmxremote.access.file=3D${ACTIVEMQ_BASE}/conf/jmx.ac= cess" > ACTIVEMQ_SUNJMX_START=3D"$ACTIVEMQ_SUNJMX_START > -Dcom.sun.management.jmxremote.ssl=3Dfalse" > #ACTIVEMQ_SUNJMX_START=3D"$ACTIVEMQ_SUNJMX_START > -Dcom.sun.management.jmxremote" > > export ACTIVEMQ_SUNJMX_START=3D$ACTIVEMQ_SUNJMX_START > export ACTIVEMQ_HOME=3D/opt/gwx/apache-activemq-5.8.0 > export ACTIVEMQ_BASE=3D$ACTIVEMQ_BASE > > ${ACTIVEMQ_HOME}/bin/activemq "$@" > > ----------------------------- > > here is my activemq_8100/conf/activemq.xml file: > > http://www.springframework.org/schema/beans" xmlns:amq=3D" > http://activemq.apache.org/schema/core" xmlns:xsi=3D" > http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D" > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd > http://activemq.apache.org/schema/core > http://activemq.apache.org/schema/core/activemq-core.xsd"> > > > class=3D"org.springframework.beans.factory.config.PropertyPlaceholderConf= igurer"> > > file:${activemq.conf}/credentials.properties > > > > > brokerName=3D"activemq_8100" dataDirectory=3D"${activemq.data}"> > > > > > > > > > > > > > queue=3D">"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ${openwirePort}?maximumConnections=3D1000&wireformat.maxFrameSize=3D1= 04857600"/> > ${amqpPort}?maximumConnections=3D1000&wireformat.maxFrameSize=3D10485= 7600"/> > > > > > class=3D"org.apache.activemq.hooks.SpringContextHook"/> > > > > > > > > > > > I have tried to stop without jmxUrl in in stop command and it had same > result. > > > thanks, > Chirag > > --047d7bb04b3466aece04e25cfb1a--