File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Errors upon trying to use ActiveMQ

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • 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
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 3479
Clojure Mac Objective C
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Thanks for posting a link to the solution.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic