File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Groovy and the fly likes Errors upon trying to use ActiveMQ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Errors upon trying to use ActiveMQ" Watch "Errors upon trying to use ActiveMQ" New topic
Author

Errors upon trying to use ActiveMQ

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.


GenRocket - Experts at Building Test Data
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

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

Joined: Nov 08, 2003
Posts: 3479

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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Nov 08, 2003
Posts: 3479

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

Joined: Nov 08, 2003
Posts: 3479

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
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6



Thanks for posting a link to the solution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Errors upon trying to use ActiveMQ