0

I asked this question yesterday and it turned out to be a Maven issue. Although I was able to find a workaround (going with Geronimo instead of Java JMS) I was unable to figure out why the Java JMS solution isn't working.

I don't like to duplicate questions, but I don't believe this is a dupe because it is an entirely different original question.

So, I am trying to get JMS working with my application so I can push messages to a local queue. In my Maven pom.xml I add the following dependency declaration:

<dependencies> <dependency> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> <version>1.1</version> <scope>provided</scope> </dependency> </dependencies> 

And right off the bat get a (red) highlighted error (using Eclipse) stating:

Missing artifact javax.jms:jms:jar:1.1

When I replace this with another JMS API, such as Geronimo, the error goes away. Is this a problem with the reference (Java) JMS dependency? Or is something configured wrong in my sandbox?

2
  • A highlighted error? I guess that means you use Eclipse? Did you try it on the console? Or Project's context menu > Maven > Update Dependencies. Commented Feb 7, 2012 at 14:37
  • 1
    Try removing the scope part. Commented Feb 7, 2012 at 14:44

3 Answers 3

4

You can see in maven repo browser here http://mvnrepository.com/artifact/javax.jms/jms that size of artifact is 0 bytes. Seems some problems or special policy for that artifact.

Sign up to request clarification or add additional context in comments.

Comments

4

The jms 1.1 jar is not available in the default maven repository - you need to add a reference to one of other public repositories (jboss one for eg)

This answer has details https://stackoverflow.com/a/5272660/672586

Comments

2

The error might come because of the log4j transitive dependencies. You can exclude such dependencies as given below.

<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> <exclusions> <exclusion> <artifactId>jms</artifactId> <groupId>javax.jms</groupId> </exclusion> <exclusion> <artifactId>jmxri</artifactId> <groupId>com.sun.jmx</groupId> </exclusion> <exclusion> <artifactId>jmxtools</artifactId> <groupId>com.sun.jdmk</groupId> </exclusion> </exclusions> </dependency> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.