[SPRING] 내장 된 BrokerService.stop 호출을 사용하여 내장 된 activeMQ 서비스를 종료 할 수 없습니다.
SPRING내장 된 BrokerService.stop 호출을 사용하여 내장 된 activeMQ 서비스를 종료 할 수 없습니다.
필자는 임베디드 activeMQ 서버 구성을 사용하고 있습니다 (구성은 임베디드 activeMQ 서버 / 수신기의 개념을 보여주는 예제와 매우 유사합니다). 애플리케이션의 일부로 디렉토리를 모니터링하는 모니터링 스레드가 있습니다. activeMQ 서버를 종료하기 위해 프로세스를 죽이는 대신 "STOP"파일에 대한 검사를 도입했으며 파일이 존재하면 서버가 종료됩니다. 브로커에서 stop 함수를 호출하여 수행하려는 종료입니다.
(broker.stop ()) 이것은 서비스를 종료하는 것 같습니다. 그러나 System.exit에서 Exception 오류가 발생합니다.
나는 비슷한 행동을 언급 한 다른 게시물이 "This is normal"행동을 나타내는 반응을 보였다. 다른 하나의 게시물은 shutdownshook을 비활성화해야한다는 것을 나타 냈습니다 (useShutdownHook = "false"로 설정하여 브로커의 Spring 구성을 통해). 이 문제도 해결되지 않았습니다.
이 문제와 관련된 도움을 주시면 감사하겠습니다.
감사
다음은 예외 스택 추적입니다.
17:10:20.056 [Thread-9] DEBUG org.apache.activemq.AdvisoryConsumer - Failed to send remove command: javax.jms.JMSException: Peer (vm://localhost#3) disposed.
javax.jms.JMSException: Peer (vm://localhost#3) disposed.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1267) [activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1259) [activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.AdvisoryConsumer.dispose(AdvisoryConsumer.java:56) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.close(ActiveMQConnection.java:615) [activemq-core-5.5.1.jar:5.5.1]
at org.springframework.jms.connection.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:426) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:321) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.destroy(SingleConnectionFactory.java:312) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:211) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:474) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:442) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1066) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1040) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:958) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://localhost#3) disposed.
at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:89) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1265) [activemq-core-5.5.1.jar:5.5.1]
... 13 common frames omitted
17:10:20.069 [Thread-9] DEBUG o.s.j.c.SingleConnectionFactory - Could not close shared JMS Connection
javax.jms.JMSException: Peer (vm://localhost#3) disposed.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.doSyncSendPacket(ActiveMQConnection.java:1342) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.close(ActiveMQConnection.java:660) ~[activemq-core-5.5.1.jar:5.5.1]
at org.springframework.jms.connection.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:426) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:321) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.destroy(SingleConnectionFactory.java:312) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:211) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:474) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:442) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1066) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1040) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:958) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://localhost#3) disposed.
at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:89) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:81) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:91) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.doSyncSendPacket(ActiveMQConnection.java:1329) ~[activemq-core-5.5.1.jar:5.5.1]
... 11 common frames omitted
17:10:20.069 [Thread-9] DEBUG o.s.b.f.s.DisposableBeanAdapter - Invoking destroy() on bean with name 'jmsProducerConnectionFactory'
17:10:20.069 [Thread-9] DEBUG o.s.j.c.SingleConnectionFactory - Closing shared JMS Connection: ActiveMQConnection {id=ID:u0102180-MacA.local-57101-1331074458547-2:1,clientId=ID:u0102180-MacA.local-57101-1331074458547-3:1,started=false}
17:10:20.070 [Thread-9] DEBUG org.apache.activemq.AdvisoryConsumer - Failed to send remove command: javax.jms.JMSException: Peer (vm://localhost#1) disposed.
javax.jms.JMSException: Peer (vm://localhost#1) disposed.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1267) [activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1259) [activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.AdvisoryConsumer.dispose(AdvisoryConsumer.java:56) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.close(ActiveMQConnection.java:615) [activemq-core-5.5.1.jar:5.5.1]
at org.springframework.jms.connection.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:426) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:321) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.destroy(SingleConnectionFactory.java:312) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:211) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:474) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:442) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1066) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1040) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:958) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://localhost#1) disposed.
at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:89) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnection.java:1265) [activemq-core-5.5.1.jar:5.5.1]
... 13 common frames omitted
17:10:20.071 [Thread-9] DEBUG o.s.j.c.SingleConnectionFactory - Could not close shared JMS Connection
javax.jms.JMSException: Peer (vm://localhost#1) disposed.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.doSyncSendPacket(ActiveMQConnection.java:1342) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.close(ActiveMQConnection.java:660) ~[activemq-core-5.5.1.jar:5.5.1]
at org.springframework.jms.connection.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:426) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:321) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.jms.connection.SingleConnectionFactory.destroy(SingleConnectionFactory.java:312) [spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:211) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:474) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:442) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1066) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1040) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:958) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]
Caused by: org.apache.activemq.transport.TransportDisposedIOException: Peer (vm://localhost#1) disposed.
at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:89) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:81) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:91) ~[activemq-core-5.5.1.jar:5.5.1]
at org.apache.activemq.ActiveMQConnection.doSyncSendPacket(ActiveMQConnection.java:1329) ~[activemq-core-5.5.1.jar:5.5.1]
... 11 common frames omitted
(@ TimBish - 코멘트 주셔서 감사합니다)
해결법
-
==============================
1.ActiveMQ는 자체 종료 훅을 등록하고 프로세스가 종료 될 때 자동으로 중지합니다. 따라서 stop ()을 호출하기 전에 이미 중지되었으며 예외가 나타납니다.
ActiveMQ는 자체 종료 훅을 등록하고 프로세스가 종료 될 때 자동으로 중지합니다. 따라서 stop ()을 호출하기 전에 이미 중지되었으며 예외가 나타납니다.
Spring을 통해 수동으로 중지하는 경우 useShutdownHook = "false"속성을 설정하여 종료 후크를 비활성화해야합니다.
<broker brokerName="broker" useShutdownHook="false">
from https://stackoverflow.com/questions/9591203/unable-to-shutdown-embedded-activemq-service-using-the-built-in-brokerservice-st by cc-by-sa and MIT license
'SPRING' 카테고리의 다른 글
[SPRING] 삽입에 NamedParameterJDBCTemplate를 사용하는 동안 "잘못된 열 유형"예외가 발생합니다. (0) | 2019.04.22 |
---|---|
[SPRING] 동일한 Java 클래스에 대한 다중 MongoDB 콜렉션 이름 (0) | 2019.04.22 |
[SPRING] intellij-idea가있는 창에서 Tomcat 시작 문제 (0) | 2019.04.22 |
[SPRING] JNDI로 스프링 부트에서 다중 데이터 소스 설정하기 (0) | 2019.04.21 |
[SPRING] HTTP 상태 500 - 서블릿 Dispatcher에 대한 Servlet.init ()가 예외를 발생했습니다. (0) | 2019.04.21 |