dskiles
dskiles

Reputation: 851

Compile Error when using Spring JMS

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?

Upvotes: 4

Views: 6052

Answers (2)

Albert Hendriks
Albert Hendriks

Reputation: 2145

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>

Upvotes: 0

Chris Nash
Chris Nash

Reputation: 3061

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.

Upvotes: 2

Related Questions