1
votes

I'm pretty new to grails so it's possible that i've missed something obvious, but I am trying to utilise the JMS plugin. I've included the following within the plugins section of my BuildConfig.groovy

compile ":jms:1.2"

However when I compile the app I get lots of "unable to resolve class" exceptions for imports within the jms plugin (40 in total, javax.jms.* and org.springframework.jms.* mostly).

e.g.

| Error Compilation error: startup failed:
C:\dev\prj\grails\tApp\target\work\plugins\jms-1.2\grails-app\utils\DefaultJmsBe
ans.groovy: 16: unable to resolve class org.springframework.jms.listener.Default
MessageListenerContainer
@ line 16, column 1.
import org.springframework.jms.listener.DefaultMessageListenerContainer
^

C:\dev\prj\grails\tApp\target\work\plugins\jms-1.2\grails-app\services\grails\pl
ugin\jms\JmsService.groovy: 22: unable to resolve class javax.jms.Message
@ line 22, column 1.
import javax.jms.Message

Is anyone able to point me in the right direction? The issue can be reproduced just by adding the plugin to the BuildConfig.groovy as mentioned above to a new grails project .

Grails version 2.3.3

Many thanks

Tom

3

3 Answers

0
votes

While doing a Grails 2.2 -> 2.3.4 upgrade I ran into a similar issue and was able to get things working by manually adding spring-jms to my dependencies in BuildConfig.groovy:

compile 'org.springframework:spring-jms:3.2.5.RELEASE'

It's odd that this would stop working now of course, since the jms plugin hasn't changed in a very long time. My guess is that it depends on the spring-jms lib, but didn't have it listed as a dependency, instead relying on grails to bring it in. According to the 2.3.x upgrade guide, there have been changes to what grails brings in now, so perhaps spring-jms stopped getting a free ride.

0
votes

The Grails MX website has a write-up that might help; it's built using 2.3.4:

http://grails.org.mx/2013/12/20/quickstart-jms-en-grails/

It was pretty helpful to me in getting a sample application up and running. It's in Spanish though, so may need to have Google translate it for you...

0
votes

Have you tried executing the command grails refresh-dependencies before running grails run-app?

I wrote a blog post on installing a Grails plugin if you need more details.