即日起在codingBlog上分享您的技术经验即可获得积分,积分可兑换现金哦。

rabbitmq helloworld程序异常

编程语言 yjb7268888 7℃ 0评论

如果运行出现如下异常,可能创建的用户没有访问权限。

Exception in thread "main" java.io.IOException
 at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
 at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
 at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124)
 at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:388)
 at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:516)
 at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:533)
 at cn.slimsmart.rabbitmq.demo.test.Test.main(Test.java:18)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; reason: java.net.SocketException: Connection reset
 at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
 at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)
 at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:343)
 at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:216)
 at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118)
 ... 4 more
Caused by: java.net.SocketException: Connection reset
 at java.net.SocketInputStream.read(Unknown Source)
 at java.net.SocketInputStream.read(Unknown Source)
 at java.io.BufferedInputStream.fill(Unknown Source)
 at java.io.BufferedInputStream.read(Unknown Source)
 at java.io.DataInputStream.readUnsignedByte(Unknown Source)
 at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
 at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
 at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:515)

需要对该用户进行授权,登录web控制台后,点击”admin”,进入需要授权的用户,在Admin标签页下点击新增的用户”admin”,进入授权页面,默认直接点击”set permission”即可




转载请注明:CodingBlog » rabbitmq helloworld程序异常

喜欢 (0)or分享 (0)
发表我的评论
取消评论

*

表情