thufir

Untitled

Mar 9th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. thufir@doge:~/groovy$
  2. thufir@doge:~/groovy$ groovy jms.groovy
  3. Caught: groovy.lang.MissingMethodException: No signature of method: static GroovyJMSExample.sendMessage() is applicable for argument types: () values: []
  4. Possible solutions: sendMessage()
  5. groovy.lang.MissingMethodException: No signature of method: static GroovyJMSExample.sendMessage() is applicable for argument types: () values: []
  6. Possible solutions: sendMessage()
  7. at GroovyJMSExample.main(jms.groovy:21)
  8. thufir@doge:~/groovy$
  9. thufir@doge:~/groovy$ cat jms.groovy
  10. @Grab(group='net.sf.gtools.jms', module='JmsCategory', version='0.2')
  11. @Grab(group='org.apache.activemq',module = 'activemq-all', version='5.9.0')
  12. @Grab(group="junit", module="junit", version="4.11")
  13. import net.sf.gtools.jms.JmsCategory
  14. import org.apache.activemq.ActiveMQConnectionFactory
  15.  
  16.  
  17. class GroovyJMSExample {
  18. def sendMessage() {
  19. use(JmsCategory) {
  20. def jms = new ActiveMQConnectionFactory('tcp://localhost:61616')
  21. jms.connect { c ->
  22. c.queue("TEST-queue") { q ->
  23. def msg = createTextMessage("test")
  24. q.send(msg)
  25. }
  26. }
  27. }
  28. }
  29. static void main(String[] args) {
  30. sendMessage()
  31. }
  32. }
  33.  
  34. thufir@doge:~/groovy$
Advertisement
Add Comment
Please, Sign In to add comment