Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Errors upon trying to use ActiveMQ

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,
I'm trying to use ActiveMQ in our application.
I installed JMS plugin and ActiveMQ is running.
activemq-all.jar is under lib dir.
Here is resources.groovy:

I defined this service:

And the unit test:

But upon running the test, I got:
Cannot invoke method sendMessage() on null object
java.lang.NullPointerException: Cannot invoke method sendMessage() on null object
It looks that the service isn't get injected, right?
What is going wrong?
Platform:
JDK 6
Grails 1.2.1
ActiveMQ 5.3
JMS plugin 0.5
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it is a true Unit Test (not integration test) then you're not going to get services and jms stuff wired in. You'll either need to mock it or write an integration test.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Indeed, thanks for help Gregg.
But what is really annoying to me:
1. Lack of good documentations.
In resources.groovy, jmsConnectionFactory should be defined but the http://www.grails.org/JMS+Plugin defined connectionFactory which isn't working.
2. Grails is about 70% available.
So slow to run, slow to run tests, slow to get plugins list.
Rails and Django really beat Grails hard in this aspect.
Any way, thanks for help and time.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more thing :p
I defined this consumer:

But I got this exception:
javax.jms.InvalidDestinationException: Cannot determine response destination: Request message does not contain reply-to destination, and no default response destination set
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Questions about plugins are often times better asked on the grails mailing list. That's where all the plugin devs typically hang out. I'd post this question to them. I personally can't help with this. I've only used the JMS plugin one time and as a test. Sorry.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Todd wrote:Indeed, thanks for help Gregg.
But what is really annoying to me:
1. Lack of good documentations.
In resources.groovy, jmsConnectionFactory should be defined but the http://www.grails.org/JMS+Plugin defined connectionFactory which isn't working.
2. Grails is about 70% available.
So slow to run, slow to run tests, slow to get plugins list.
Rails and Django really beat Grails hard in this aspect.
Any way, thanks for help and time.



I doubt anyone is forcing you to use grails. If you like Rails and django better, well, use them.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, no one is forcing me to use Grails.
I just wishing if Grails team overcome these issues (IMO).
Thanks again.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I contacted the plugin author and he helped me.
http://alkemist.github.com/grails-jms/manual/guide/5.%20Receiving%20Messages.html#5.1%20Service%20Listeners
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Todd wrote:I contacted the plugin author and he helped me.
http://alkemist.github.com/grails-jms/manual/guide/5.%20Receiving%20Messages.html#5.1%20Service%20Listeners



Thanks for posting a link to the solution.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic