com.rabbitmq.client.impl.ForgivingExceptionHandler.log:119 -An unexpected connection driver error occured

在服务器上安装了一个RabbitMq,并新创建了一个用户授予了管理员角色,登录控制台查看一切正常,兴高采烈启动项目进行连接,结果一盆冷水下来,报如下错误:

o.s.a.r.l.SimpleMessageListenerContainer : Failed to check/redeclare auto-delete queue(s).

org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
    at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62) ~[spring-rabbit-1.7.4.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:368) ~[spring-rabbit-1.7.4.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:573) ~[spring-rabbit-1.7.4.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1430) ~[spring-rabbit-1.7.4.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1411) ~[spring-rabbit-1.7.4.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1387) ~[spring-rabbit-1.7.4.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.core.RabbitAdmin.getQueueProperties(RabbitAdmin.java:336) ~[spring-rabbit-1.7.4.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.redeclareElementsIfNecessary(SimpleMessageListenerContainer.java:1171) ~[spring-rabbit-1.7.4.RELEASE.jar:na]
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1422) [spring-rabbit-1.7.4.RELEASE.jar:na]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]

2018-09-21 14:44:55.695 ERROR [bootstrap,,,] 9248 --- [.168.4.201:5672] c.r.c.impl.ForgivingExceptionHandler     : An unexpected connection driver error occured

java.net.SocketException: socket closed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
    at java.net.SocketInputStream.read(SocketInputStream.java:170)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
    at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288)
    at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91)
    at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:164)
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:571)
    at java.lang.Thread.run(Thread.java:745)

起先以为是配置错误,确认配置没问题后,百度一下,发现是给用户授予了角色,只能登录控制台,但是没有给读写以及管理队列的权限,通过控制台admin按钮查看

通过命令授权

语法: set_permissions [-p <vhostpath>] <user> <conf> <write> <read>

执行: rabbitmqctl set_permissions -p / admin .* .* .* 完成对admin的授权,然后启动项目就正常了

原文地址:https://www.cnblogs.com/lykbk/p/zxzxzxzxsfesfdgfdfdfdfdfdfdfdfdfdfd.html

时间: 2024-11-10 08:29:48

com.rabbitmq.client.impl.ForgivingExceptionHandler.log:119 -An unexpected connection driver error occured的相关文章

com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)

RabbitMQ 基于Erlang 实现, 客户端可以用Python | Java | Ruby | PHP | C# | Javascript | Go等语言来实现.这里做个java语言的测试.首先安装好RabbitMQ 服务端. maven依赖 <dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-client</artifactId> <version>3.0

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.

com.rabbitmq.client.ShutdownSignalException: connection error

com.rabbitmq.client.ShutdownSignalException: connection error. 最近研究rabbitMQ,写的第一个例子的时候,是参照网上的例子.但是环境是centos6.7.之前遇到的小问题,在网上都好找到,就不写了. 在使用浏览器可以访问,但是用程序就访问不到了.是因为浏览器访问的端口是15672. 但是用java程序连接,端口就变成了5672. 所有需要在linux中,将5672端口开放. -A INPUT -m state --state N

对RabbitMQ.Client进行一下小小的包装,绝对实用方便

RabbitMQ是一个老牌的非微软的消息队列组件,一般来说应该能满足中小型公司对消息队列生产的需求,平时我们在.NET开发环境下运用它是可能会需要RabbitMQ.Client的SDK库,此库是官网提供,目前最新发布版本是v4.1.3.在我们对接项目时有时需要碰到对接上的注意,随之而来感觉对官方提供的SDK客户端还可以进行一次包装开发. Nuget安装命令:Install-Package RabbitMQ.Client.Wrap GitHub地址:https://github.com/rjf19

The transaction log for database &#39;xx&#39; is full,Error: 9002, Severity: 17, State: 2

检查数据库日志,有如下报错信息: Error: 9002, Severity: 17, State: 4. The transaction log for database 'SharedServices1_Search_DB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases 查看当前日志的使用情况: 这里日志并没有完全满

Golang RabbitMQ Client amqp -&gt; “Hello World!”

发送程序 package main import ( "fmt" "log" "github.com/streadway/amqp" ) func failOnError(err error, msg string) { if err != nil { log.Fatalf("%s: %s", msg, err) panic(fmt.Sprintf("%s: %s", msg, err)) } } func

RabbitMQ client ( java )

Maven 依赖 <dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-client</artifactId> <version>3.5.4</version> </dependency> GitHub https://github.com/rabbitmq/rabbitmq-java-client/archives/master 文档 ht

spring继承Rabbitmq client

一:概述 1.官网 https://spring.io/ 2.进入project 3.找到spring AMQP 二:程序 1.结构 2.pom 1 <?xml version="1.0" encoding="UTF-8"?> 2 <project xmlns="http://maven.apache.org/POM/4.0.0" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchem

使用Rabbitmq.client反序列化包含Mongo.Bson.ObjectId属性实体类时抛异常

原因分析: 队列中存储的objectId属性是字符串,反序列化字符串转换成objectid类型时报错 解决方法: 1.定义ObjectIdConverter属性类,反序列化时将字符串转换成ObjectId class ObjectIdConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { serializer.S