Compile Error when using Spring JMS

5k views Asked by At

I'm running into a compile error while trying to use Spring-JMS. A quick Google search only turned up one matching result, but 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?

2

There are 2 answers

2
Chris Nash On BEST ANSWER

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.

0
Albert Hendriks On

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>