我在尝试使用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。你们有谁知道为什么会突然出现这个错误吗?
发布于 2011-02-24 06:18:37
JmsOperations的一些方法需要javax jms类,因此您需要在构建路径中使用它们。无论如何,您在运行时都需要在类路径上使用JMS提供程序的实现。
发布于 2018-02-27 23:08:16
我使用的是activemq,在我的例子中,它是通过将以下代码添加到pom中来解决的:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</dependency>https://stackoverflow.com/questions/5097849
复制相似问题