Spring MQTT: java.util.MissingResourceException: C

2019-07-18 09:58发布

NOTE WELL: I am NOT running eclipse. I am running a standalone Spring application from the command line with maven.

When I attempt to send a message to an outbound channel adapter created with IoC using spring-integration-mqtt 4.3.8, I get

java.lang.ExceptionInInitializerError
    at org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory.getAsyncClientInstance(DefaultMqttPahoClientFactory.java:147)
    at org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler.checkConnection(MqttPahoMessageHandler.java:170)
    at org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler.publish(MqttPahoMessageHandler.java:189)
    at org.springframework.integration.mqtt.outbound.AbstractMqttMessageHandler.handleMessageInternal(AbstractMqttMessageHandler.java:150)
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127)
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:148)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:121)
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:89)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:423)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:373)
    at com.ssn.nmrlistener.MilliSecurePacketHandler.forwardTrapToChannel(MilliSecurePacketHandler.java:201)
    at com.ssn.nmrlistener.MilliSecurePacketHandler.run(MilliSecurePacketHandler.java:177)
    ... 7 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name org.eclipse.paho.client.mqttv3.internal.nls.logcat, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
    at org.eclipse.paho.client.mqttv3.logging.LoggerFactory.getLogger(LoggerFactory.java:72)
    at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<clinit>(MqttAsyncClient.java:89)
    ... 20 more

This suggests I am missing a dependency, but I have no idea what it might be.

1条回答
再贱就再见
2楼-- · 2019-07-18 10:24

Perhaps a corrupt jar in your maven repo? Clearly you have the org.eclipse.paho.client.mqttv3.logging.LoggerFactory class; I see the logcat bundle in my jar... enter image description here

查看更多
登录 后发表回答