RabbitMQ客户端中127.0.0.1的未知主机异常

时间:2014-12-01 12:07:13

标签: java rabbitmq

我的申请中有一个非常奇怪的例外。 127.0.0.1是未知主机。我不知道它是怎么发生的。详情如下:

ShardedAmqpSpout [WARN] Failed to reconnect to AMQP broker
  java.net.UnknownHostException: 127.0.0.1
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
    at java.net.Socket.connect(Socket.java:579)
    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 pl.mbank.storm.amqp.ShardedAmqpSpout.setupAMQP(ShardedAmqpSpout.java:220)
    at pl.mbank.storm.amqp.ShardedAmqpSpout.reconnect(ShardedAmqpSpout.java:239)
    at pl.mbank.storm.amqp.ShardedAmqpSpout.open(ShardedAmqpSpout.java:201)
    at backtype.storm.daemon.executor$fn__3985$fn__3997.invoke(executor.clj:460)
    at backtype.storm.util$async_loop$fn__465.invoke(util.clj:375)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Thread.java:722)

1 个答案:

答案 0 :(得分:0)

清除127.0.0.1之前和之后的空格。我已经解决了。