java - 使用 Spring JMS 时编译错误

标签 java spring jms jmstemplate

我在尝试使用 Spring-JMS 时遇到编译错误。快速的 Google 搜索只找到一个匹配结果,但我无法从中得到任何有用的信息。

我正在使用以下代码:

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。你们中有人知道为什么会出现该错误吗?

最佳答案

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

关于java - 使用 Spring JMS 时编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5097849/

相关文章:

java - (LeetCode) 包含 Duplicate III

java - org.springframework.beans.NotWritablePropertyException

java - Spring JPA : Using multiple projection on same query interface

java - hibernate 错误 "net.sf.ehcache.CacheException"

playframework - 无法在 Play Framework 上获取 WebLogic 服务器的初始上下文

jms - Apama JMS Correlator Adapter 动态流控制

JMS 主题与队列

java - 作为过程的功能的动态(树形)结构(以及Clojure中的实现)

java - 按国家/地区获取日期格式模式

java - 需要帮助提出 Java 中的蛋糕排序算法