开发者社区 > 物联网 > 正文

用MQTTfx连接阿里云物联网平台,怎么一直MQTTException

我按官网格式配的设置,怎么就一直出MQTTException。 image.png 后面的用户名和密码也设置好了

2019-07-17 15:01:21,271  INFO --- BrokerConnectorController      : onConnect
2019-07-17 15:01:21,272  INFO --- ScriptsController              : Clear console.
2019-07-17 15:01:21,276  INFO --- MqttFX ClientModel             : MqttClient with ID 5CD6367ZYS|securemode=3,signmethod=hmacsha1,timestamp=10| assigned.
2019-07-17 15:01:21,294 ERROR --- MqttFX ClientModel             : Error when connecting
org.eclipse.paho.client.mqttv3.MqttException: MqttException
    at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
    at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:715) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:?]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
    at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalArgumentException: hostname can't be null
    at java.net.InetSocketAddress.checkHost(Unknown Source) ~[?:?]
    at java.net.InetSocketAddress.<init>(Unknown Source) ~[?:?]
    at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:76) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
    at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:701) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
    ... 7 more
2019-07-17 15:01:21,295 ERROR --- MqttFX ClientModel             : Please verify your Settings (e.g. Broker Address, Broker Port & Client ID) and the user credentials!
org.eclipse.paho.client.mqttv3.MqttException: MqttException
    at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
    at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:715) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:?]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
    at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalArgumentException: hostname can't be null
    at java.net.InetSocketAddress.checkHost(Unknown Source) ~[?:?]
    at java.net.InetSocketAddress.<init>(Unknown Source) ~[?:?]
    at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:76) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
    at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:701) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
    ... 7 more
2019-07-17 15:01:21,301  INFO --- ScriptsController              : Clear console.
2019-07-17 15:01:21,302 ERROR --- BrokerConnectService           : MqttException

遇到了同样的问题,在CSDN看到了,希望阿里云团队能够给出正确、标准的答案~请查看

展开
收起
刘刚_ 2020-05-23 21:06:31 3043 0
0 条回答
写回答
取消 提交回答

物联网领域前沿技术分享与交流

相关产品

  • 物联网平台
  • 热门讨论

    热门文章

    相关电子书

    更多
    美的物联平台的云上实践与应用--- 人机新世代战略下的智能化探索 立即下载
    使用Link Develop 进行物联网一站式开发 立即下载
    从创意到原型: 物联网应用快速开发 立即下载