rabbitmq vhost /test not found

在尝试使用RabbitMQ建立连接时遇到了IOException,具体表现为AMQChannel的wrap方法抛出异常,导致ShutdownSignalException,原因是连接错误,协议方法显示不允许操作(NOT_ALLOWED)。此外,还发生了NullPointerException,在主线程中。这可能是由于RabbitMQ的连接配置问题,如虚拟主机不存在或配置错误所导致。

java.io.IOException
	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:129)
	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:125)
	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:147)
	at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:423)
	at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:64)
	at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:156)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1110)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1067)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1025)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1187)
	at rabbit2.RabbitMqUtil.getConn(RabbitMqUtil.java:33)
	at rabbit5.Task.main(Task.java:14)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - vhost /test not found, class-id=10, method-id=40)
	at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
	at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
	at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
	at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:293)
	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:141)
	... 9 more
Exception in thread "main" java.lang.NullPointerException
	at rabbit5.Task.main(Task.java:17)
11:57:48.451 [AMQP Connection 192.168.1.3:5673] ERROR com.rabbitmq.client.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:171)
	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:184)
	at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:645)
	at java.lang.Thread.run(Thread.java:748)

=======

2025-06-04 07:51:59.087849+00:00 [error] <0.9162.2> Error on AMQP connection <0.9162.2> (192.168.150.1:58853 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3934, user: 'tjxt', state: opening): 2025-06-04 07:51:59.087849+00:00 [error] <0.9162.2> vhost /tjxt not found 2025-06-04 07:51:59.087951+00:00 [error] <0.9165.2> Error on AMQP connection <0.9165.2> (192.168.150.1:58854 -> 172.21.0.7:5672 - rabbitConnectionFactory#5a8149f6:2424, user: 'tjxt', state: opening): 2025-06-04 07:51:59.087951+00:00 [error] <0.9165.2> vhost /tjxt not found 2025-06-04 07:51:59.088552+00:00 [info] <0.9162.2> closing AMQP connection <0.9162.2> (192.168.150.1:58853 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3934, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.088591+00:00 [info] <0.9165.2> closing AMQP connection <0.9165.2> (192.168.150.1:58854 -> 172.21.0.7:5672 - rabbitConnectionFactory#5a8149f6:2424, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.090987+00:00 [info] <0.9178.2> accepting AMQP connection <0.9178.2> (192.168.150.1:58856 -> 172.21.0.7:5672) 2025-06-04 07:51:59.092844+00:00 [info] <0.9178.2> Connection <0.9178.2> (192.168.150.1:58856 -> 172.21.0.7:5672) has a client-provided name: rabbitConnectionFactory#700596f9:3935 2025-06-04 07:51:59.093760+00:00 [error] <0.9178.2> Error on AMQP connection <0.9178.2> (192.168.150.1:58856 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3935, user: 'tjxt', state: opening): 2025-06-04 07:51:59.093760+00:00 [error] <0.9178.2> vhost /tjxt not found 2025-06-04 07:51:59.094560+00:00 [info] <0.9178.2> closing AMQP connection <0.9178.2> (192.168.150.1:58856 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3935, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.173739+00:00 [info] <0.9186.2> accepting AMQP connection <0.9186.2> (192.168.150.1:58858 -> 172.21.0.7:5672) 2025-06-04 07:51:59.175441+00:00 [info] <0.9186.2> Connection <0.9186.2> (192.168.150.1:58858 -> 172.21.0.7:5672) has a client-provided name: rabbitConnectionFactory#700596f9:3936 2025-06-04 07:51:59.176284+00:00 [error] <0.9186.2> Error on AMQP connection <0.9186.2> (192.168.150.1:58858 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3936, user: 'tjxt', state: opening): 2025-06-04 07:51:59.176284+00:00 [error] <0.9186.2> vhost /tjxt not found 2025-06-04 07:51:59.177442+00:00 [info] <0.9186.2> closing AMQP connection <0.9186.2> (192.168.150.1:58858 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3936, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.179772+00:00 [info] <0.9194.2> accepting AMQP connection <0.9194.2> (192.168.150.1:58860 -> 172.21.0.7:5672) 2025-06-04 07:51:59.208946+00:00 [info] <0.9194.2> Connection <0.9194.2> (192.168.150.1:58860 -> 172.21.0.7:5672) has a client-provided name: rabbitConnectionFactory#700596f9:3937 2025-06-04 07:51:59.218862+00:00 [error] <0.9194.2> Error on AMQP connection <0.9194.2> (192.168.150.1:58860 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3937, user: 'tjxt', state: opening): 2025-06-04 07:51:59.218862+00:00 [error] <0.9194.2> vhost /tjxt not found 2025-06-04 07:51:59.228782+00:00 [info] <0.9194.2> closing AMQP connection <0.9194.2> (192.168.150.1:58860 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3937, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.231093+00:00 [info] <0.9202.2> accepting AMQP connection <0.9202.2> (192.168.150.1:58864 -> 172.21.0.7:5672) 2025-06-04 07:51:59.232076+00:00 [info] <0.9202.2> Connection <0.9202.2> (192.168.150.1:58864 -> 172.21.0.7:5672) has a client-provided name: rabbitConnectionFactory#700596f9:3938 2025-06-04 07:51:59.232615+00:00 [error] <0.9202.2> Error on AMQP connection <0.9202.2> (192.168.150.1:58864 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3938, user: 'tjxt', state: opening): 2025-06-04 07:51:59.232615+00:00 [error] <0.9202.2> vhost /tjxt not found 2025-06-04 07:51:59.239051+00:00 [info] <0.9208.2> accepting AMQP connection <0.9208.2> (192.168.150.1:58866 -> 172.21.0.7:5672) 2025-06-04 07:51:59.248761+00:00 [info] <0.9202.2> closing AMQP connection <0.9202.2> (192.168.150.1:58864 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3938, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.248846+00:00 [info] <0.9208.2> Connection <0.9208.2> (192.168.150.1:58866 -> 172.21.0.7:5672) has a client-provided name: rabbitConnectionFactory#700596f9:3939 2025-06-04 07:51:59.253316+00:00 [error] <0.9208.2> Error on AMQP connection <0.9208.2> (192.168.150.1:58866 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3939, user: 'tjxt', state: opening): 2025-06-04 07:51:59.253316+00:00 [error] <0.9208.2> vhost /tjxt not found 2025-06-04 07:51:59.254859+00:00 [info] <0.9208.2> closing AMQP connection <0.9208.2> (192.168.150.1:58866 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3939, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.256543+00:00 [info] <0.9218.2> accepting AMQP connection <0.9218.2> (192.168.150.1:58868 -> 172.21.0.7:5672) 2025-06-04 07:51:59.257247+00:00 [info] <0.9218.2> Connection <0.9218.2> (192.168.150.1:58868 -> 172.21.0.7:5672) has a client-provided name: rabbitConnectionFactory#700596f9:3940 2025-06-04 07:51:59.257664+00:00 [error] <0.9218.2> Error on AMQP connection <0.9218.2> (192.168.150.1:58868 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3940, user: 'tjxt', state: opening): 2025-06-04 07:51:59.257664+00:00 [error] <0.9218.2> vhost /tjxt not found 2025-06-04 07:51:59.258960+00:00 [info] <0.9218.2> closing AMQP connection <0.9218.2> (192.168.150.1:58868 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3940, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.264548+00:00 [info] <0.9226.2> accepting AMQP connection <0.9226.2> (192.168.150.1:58870 -> 172.21.0.7:5672) 2025-06-04 07:51:59.266612+00:00 [info] <0.9226.2> Connection <0.9226.2> (192.168.150.1:58870 -> 172.21.0.7:5672) has a client-provided name: rabbitConnectionFactory#700596f9:3941 2025-06-04 07:51:59.267287+00:00 [error] <0.9226.2> Error on AMQP connection <0.9226.2> (192.168.150.1:58870 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3941, user: 'tjxt', state: opening): 2025-06-04 07:51:59.267287+00:00 [error] <0.9226.2> vhost /tjxt not found 2025-06-04 07:51:59.267928+00:00 [info] <0.9226.2> closing AMQP connection <0.9226.2> (192.168.150.1:58870 -> 172.21.0.7:5672 - rabbitConnectionFactory#700596f9:3941, vhost: 'none', user: 'tjxt') 2025-06-04 07:51:59.285898+00:00 [info] <0.9234.2> accepting AMQP connection <0.9234.2> (192.168.150.1:58872 -> 172.21.0.7:5672) 2025-06-04 07:51:59.286718+00:00 [info] <0.9234.2> Connection <0.9234.2> (192.168.150.1:58872 -> 172.21.0.7:5672) has a client-provided name: rabbitConnectionFactory#700596f9:3942 2025-06-04 07:51:59.287088+00:00 [error] <0.9234.2> Error on AMQP connection <0.9234.2> (192.168.150^C
06-28
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

13805029595

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值