开发者

Compile Error when using Spring JMS

开发者 https://www.devze.com 2023-02-13 05:26 出处:网络
I\'m running into a compile error while trying to use Spring-JMS.A quick Google search only turned up one matching result, bu开发者_如何学编程t I was unable to get anything useful out of it.

I'm running into a compile error while trying to use Spring-JMS. A quick Google search only turned up one matching result, bu开发者_如何学编程t I was unable to get anything useful out of it.

I'm using the following code:

public class Class extends AbstractClass {

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

        template.convertAndSend(item);
    }
}

When I try to compile it, I receive the following compile error:

cannot access javax.jms.Destination

and

class file for javax.jms.Destination not found

Nowhere in my code to I reference javax.jms.Destination. Do any of you have any idea why that error would crop up?


JmsOperations requires the javax jms classes for some of its methods, so you need them in your build path. You are going to need your JMS provider's implementations on your classpath at runtime, anyway.


I'm using activemq and in my case it was solved by adding this to the pom:

    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-broker</artifactId>
    </dependency>
0

精彩评论

暂无评论...
验证码 换一张
取 消