Caused by: com.rabbitmq.client.ShutdownSignalException: connection error

Posted 太白的技术博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Caused by: com.rabbitmq.client.ShutdownSignalException: connection error相关的知识,希望对你有一定的参考价值。

周五下午的时候升级了一个环境,跑了批处理sh升级脚本后,启动时报下列错误:

INFO   | jvm 1    | 2017/02/24 17:39:09 | java.io.IOException
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:378)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:36)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:91)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:640)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:615)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.ld.net.rabbitmq.MutiConnectionFactory.newConnection(MutiConnectionFactory.java:28)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.ld.net.route.ExchangeManager.init(ExchangeManager.java:163)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at java.lang.reflect.Method.invoke(Method.java:498)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1710)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1649)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.ld.net.spring.ContainerInitilzation.start(ContainerInitilzation.java:9)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.ld.net.spring.StartServer.main(StartServer.java:38)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at java.lang.reflect.Method.invoke(Method.java:498)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:325)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at java.lang.Thread.run(Thread.java:745)
INFO   | jvm 1    | 2017/02/24 17:39:09 | Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:361)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:226)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     ... 33 more
INFO   | jvm 1    | 2017/02/24 17:39:09 | Caused by: java.net.SocketException: Connection reset
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at java.net.SocketInputStream.read(SocketInputStream.java:209)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at java.net.SocketInputStream.read(SocketInputStream.java:141)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:536)
INFO   | jvm 1    | 2017/02/24 17:39:09 |     ... 1 more

配置文件、/etc/hosts、防火墙这些都仔细检查了,就是看不出有任何问题,关键连接到另外一个MQ时就没有问题,着实折腾了半个多小时在反复回撤验证。

于是不得不一个个对比,瞬间会想起这套环境的配置和其他机器都不一样,其他环境对外的虚拟主机名都是/route,这台是/,由于2B给客户使用,上线之后就不得不维持着不一致在哪儿,然后就出现上面这个错误了。

只是这错误提示相当坑爹哇,改为正确的vhost之后,问题即解决。这样看来,后面所有的升级都得带上backup/clean的脚本,保不齐有些环境可能因为历史遗留问题就存在不一致的情况。

以上是关于Caused by: com.rabbitmq.client.ShutdownSignalException: connection error的主要内容,如果未能解决你的问题,请参考以下文章

Mathematical Problems Caused by CCD

Caused by SSLError

Caused by: java.lang.NoClassDefFoundError:

caused by a circular import.

异常Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationExcep

Caused by org hibernate DuplicateMappingException Duplicat