Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9096C200CA3 for ; Wed, 3 May 2017 04:23:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8EEF4160BAC; Wed, 3 May 2017 02:23:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AEA43160B9D for ; Wed, 3 May 2017 04:23:23 +0200 (CEST) Received: (qmail 77263 invoked by uid 500); 3 May 2017 02:23:17 -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 77251 invoked by uid 99); 3 May 2017 02:23:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 May 2017 02:23:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0F654C1518 for ; Wed, 3 May 2017 02:23:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.235 X-Spam-Level: **** X-Spam-Status: No, score=4.235 tagged_above=-999 required=6.31 tests=[HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_FAIL=0.919, URIBL_BLOCKED=0.001, URI_HEX=1.313, URI_TRY_3LD=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 30d0LKhPxFA9 for ; Wed, 3 May 2017 02:23:13 +0000 (UTC) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C102B5F5CA for ; Wed, 3 May 2017 02:23:12 +0000 (UTC) Received: from mjoe.nabble.com (unknown [162.253.133.57]) by mwork.nabble.com (Postfix) with ESMTP id 9965D3E8F4A1D for ; Tue, 2 May 2017 19:23:11 -0700 (MST) Date: Tue, 2 May 2017 19:11:26 -0700 (PDT) From: Chester_Zheng To: users@activemq.apache.org Message-ID: <2017050310230034369417@sina.com> In-Reply-To: References: <1493274335523-4725268.post@n4.nabble.com> Subject: Re: Re: The connection is already closed MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_227134_131747269.1493777486581" archived-at: Wed, 03 May 2017 02:23:24 -0000 ------=_Part_227134_131747269.1493777486581 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, Tim First of all, Thanks for your response. I know the exception message is on the factory, and the close() method is a public-method that anywhere can invoke it if it has the factory instance. I've seen the source code and found the exception message. But, I can't understand why ActiveMQ appear this exception without any explicitly invoke. I've used debugger and set a breakpoint on the connection's close() method. Unfortunately, I still don't meet the exception after that day. I don't know how it can reproduce. I extremely wanna know when ActiveMQ will invoke the close() method implicitly or explicitly. Thanks. Chester chester_zheng@sina.com From: Tim Bain [via ActiveMQ] Date: 2017-05-01 04:20 To: Chester_Zheng Subject: Re: The connection is already closed The close() methods you referenced are on the factory, while the error message you're getting is about the close() method of the connections returned by the factory. If you can reproduce the problem in a non-operational environment, attach a debugger and set a breakpoint on the connection's close() method to see where it's being called. If not, you could use Eclipse's Find References feature to look for it. Keep in mind that a try-with-resources calls close(), so you may not find the call to close() written out explicitly. Tim On Apr 27, 2017 8:00 AM, "Chester_Zheng" <[hidden email]> wrote: > Hi, Dear All > I match a strange problem. We built a master/slave cluster of ActiveMQ by > using zookeeper as a registration center. > First of all, we use the "CachingConnectionFactory" which get from "Spring" > to create the ActiveMQ connection. > Then, we establish a custom session pool that it's easy to get a session > for > the high-concurrency scenarios. > > Strangely, both of test and pulbic enviornment java code is the same, but I > didn't find this problem on own test enviornment. > > P.S.I did the pressure test on the test-enviornment. > > Is it my wrong way to use or a real bug of ActiveMQ? When And where the > ActiveMQ will invoke the method named "close" by itself? > > I've already seen the ActiveMQ-source. The "CachingConnectionFactory" is > extended "SingleConnectionFactory".And I seen the method named "close". > There is a private final field named "closed". And the default value is > "false". When somewhere invokes the close method, then the filed "closed" > will change to "true". > > If you guys met similar like what I described, Please let me know. Thanks a > lot. > > Here is the error message: > > org.apache.activemq.ConnectionClosedException: The connection is already > closed > at > org.apache.activemq.ActiveMQConnection.checkClosed( > ActiveMQConnection.java:1477) > at > org.apache.activemq.ActiveMQConnection.checkClosedOrFailed( > ActiveMQConnection.java:1464) > at > org.apache.activemq.ActiveMQConnection.createSession( > ActiveMQConnection.java:323) > at > org.springframework.jms.connection.SingleConnectionFactory.createSession( > SingleConnectionFactory.java:416) > at > org.springframework.jms.connection.CachingConnectionFactory.getSession( > CachingConnectionFactory.java:234) > at > org.springframework.jms.connection.SingleConnectionFactory$ > SharedConnectionInvocationHandler.invoke(SingleConnectionFactory.java:556) > at com.sun.proxy.$Proxy16.createSession(Unknown Source) > at > com.bs.pid.link.dc.activemq.util.SessionFactory$1.run( > SessionFactory.java:120) > at > java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:745) > > The configuration is : > > schedulePeriodForDestinationPurge="10000" useShutdownHook="false" > dataDirectory="${activemq.data}" > splitSystemUsageForProducersConsumers="true" producerSystemUsagePortion=" > 50" > consumerSystemUsagePortion="50"> > > > > > > > > > > inactiveTimoutBeforeGC="30000" producerFlowControl="true" > memoryLimit="512mb"> > > > > > > > > > > > > > > > > > > > > > directory="activemq-data" > replicas="3" > bind="tcp://0.0.0.0:61619" > > zkAddress="xxx.xxx.xxx.xxx:2181,xxx.xxx.xxx.xxx:2181,xxx.xxx.xxx.xxx:2181" > zkPath="/opt/apache-activemq-5.13.4/data/leveldb-stores" > zkSessionTimeout="3s" > hostname="xxx.xxx.xxx.xxx" > weight="1" > /> > > > > > > > > > > > > > > > > > > > uri="tcp://0.0.0.0:61616?maximumConnections=3000& > wireFormat.maxFrameSize=104857600"/> > > > > > class="org.apache.activemq.hooks.SpringContextHook" /> > > > > > The client URL is : > > failover\://(tcp\:/xxx.xxx.xxx.xxx:61616?tcpNoDelay\= > true,tcp\://xxx.xxx.xxx.xxx:61616?tcpNoDelay\=true,tcp\:// > xxx.xxx.xxx.xxx:61616?tcpNoDelay\=true)?nested.wireFormat. > maxInactivityDuration\=3000&nested.wireFormat.tightEncodingEnabled=false& > nested.connectionTimeout\=0&timeout\=200&initialReconnectDelay\=10& > startupMaxReconnectAttempts\=2&maxReconnectDelay\=100&jms. > prefetchPolicy.all\=2&randomize\=false&backup\=true > > > > > > > -- > View this message in context: http://activemq.2283324.n4. > nabble.com/The-connection-is-already-closed-tp4725268.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > If you reply to this email, your message will be added to the discussion below: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-13-4-The-connection-is-already-closed-tp4725268p4725379.html To unsubscribe from ActiveMQ-5.13.4 "The connection is already closed", click here. NAML -- View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-13-4-The-connection-is-already-closed-tp4725268p4725493.html Sent from the ActiveMQ - User mailing list archive at Nabble.com. ------=_Part_227134_131747269.1493777486581--