4

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?

rodrigoap
  • 7,405
  • 35
  • 46
dskiles
  • 851
  • 1
  • 13
  • 24

2 Answers2

2

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.

Chris Nash
  • 2,941
  • 19
  • 22
  • Spring abstracts complexity of jms from developer; internaly it uses interfaces provided by javax.jms classes. – Dhananjay Feb 24 '11 at 05:35
  • It's odd that my source doesn't reference any of this stuff. That said, you're correct: it is needed at compile time. – dskiles Feb 24 '11 at 21:12
0

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>
Albert Hendriks
  • 1,979
  • 3
  • 25
  • 45