1

我无法在 .xmpp 队列中发送消息activemq。我得到以下示例。根据文档,我下载了 wstx jar 并放在activemq/lib/optional文件夹中。

我得到以下异常:

Caught: javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [xmpp]
javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [xmpp]
        at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
        at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:252)
        at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:265)
        at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:238)
        at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:184)
        at App$HelloWorldProducer.run(App.java:41)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Transport scheme NOT recognized: [xmpp]
        at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
        at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:196)
        at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:66)
        at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:250)
        ... 5 more
Caused by: java.io.IOException: Could not find factory class for resource: META-INF/services/org/apache/activemq/transport/xmpp
        at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.loadProperties(FactoryFinder.java:96)
        at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.create(FactoryFinder.java:58)
        at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:146)
        at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:193)
        ... 7 more

任何帮助表示赞赏。

4

1 回答 1

1

你需要给你的maven pom.xml添加activemq-xmpp依赖

  <dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-xmpp</artifactId>
<version>5.8.0</version>
 </dependency>            

如果您不使用 maven ,请将activemq-xmpp.jar与所有其他 jars 添加到您的 /lib

于 2013-10-09T13:36:50.373 回答