大家好,又见面了,我是全栈君。
1、假设写错了host (如:factory.setHost(“locathost”); )报错:
Exception in thread “main” java.net.UnknownHostException: locathost at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at com.rabbitmq.client.impl.FrameHandlerFactory.create(FrameHandlerFactory.java:32) at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:588) at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:612) at com.aaa.test.Send.main(Send.java:19)
2、假设写错了HOST的IP(如:factory.setHost(“192.168.1.10”); )无此地址, 报错:
Exception in thread “main” java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at com.rabbitmq.client.impl.FrameHandlerFactory.create(FrameHandlerFactory.java:32) at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:588) at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:612) at com.aaatest.Send.main(Send.java:19)
3、假设写错portPORT(如:factory.setPort(5678);) 报错:
Exception in thread “main” java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at com.rabbitmq.client.impl.FrameHandlerFactory.create(FrameHandlerFactory.java:32) at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:588) at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:612) at com.aaa.test.Send.main(Send.java:19)
4、假设写错username或者password,报错:
Exception in thread “main” com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED – Login was refused using authentication mechanism PLAIN. For details see the broker logfile. at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:338) at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:590) at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:612) at com.aaa.test.Send.main(Send.java:19)
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/115358.html原文链接:https://javaforall.cn