Spring MQTT: java.util.MissingResourceException: Can't find bundle for base name org.eclipse.paho.client.mqttv3.internal.nls.logcat, locale en_US

强颜欢笑 提交于 2019-12-10 23:32:26

问题


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:


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...



来源:https://stackoverflow.com/questions/44164397/spring-mqtt-java-util-missingresourceexception-cant-find-bundle-for-base-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!