2

我在尝试使用 Spring-JMS 时遇到编译错误。一个快速的谷歌搜索只出现了一个匹配的结果,但我无法从中得到任何有用的东西。

我正在使用以下代码:

public class Class extends AbstractClass {

    /** {@inheritDoc} */
    @Override
    public void acceptImportableItem(final ImportableItem<File> item) {
        JmsOperations template = getJmsTemplate();

        template.convertAndSend(item);
    }
}

当我尝试编译它时,我收到以下编译错误:

cannot access javax.jms.Destination

class file for javax.jms.Destination not found

在我的代码中没有任何地方引用 javax.jms.Destination。你们中有人知道为什么会出现这个错误吗?

4

2 回答 2

2

JmsOperations 的某些方法需要 javax jms 类,因此您需要在构建路径中使用它们。无论如何,您将需要在运行时在您的类路径上实现 JMS 提供程序。

于 2011-02-23T22:18:37.400 回答
0

我正在使用activemq,在我的情况下,它是通过将它添加到pom中来解决的:

    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-broker</artifactId>
    </dependency>
于 2018-02-27T15:08:16.087 回答