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:578)
at java.lang.Thread.run(Thread.java:745)
后台管理能够正常访问,但是代码就是不能获取连接。
注意注意注意:看你的rabbitMQ配置文件,端口配置
我认为port=5672是写错了,应该写成RabbitMQ请求web的端口15672(太无知),所以一直请求失败,后来才发现服务请求就是要用port=5672,而不是15672
原文地址:https://www.cnblogs.com/enzoluo-blog/p/10905221.html