I haven't tried this, so I'm guessing; but the Redhat documentation uses a starting "/" in the script attribute:
<groovy-listener name="orderJmsListener" script="/com/acme/OrderListener.groovy">
<property name="queueName" value="..."/>
Have you tried that?
Actually, I have tried with a starting "/" and also without. In both case, I'm getting the same exception
I'm not sure what's going on here, but the groovy_gateway quickstart does the same exact thing. If you want an example to compare against to see where your error may be, check that example out.
What does the jar tvf <youresbname>.esb look like?
I have tried the sample groovy_gateway and seems to run without problems. I think there is some problem with the groovy script, the exception seems to be misleading, becasue it works correctly with MessageInjectionConsole script. I have no experience with Groovy, I will have a closer look if the syntax is correct.
OrderListener orderListener = new OrderListener();
// Start the listener (passing the config)...
// Wait until the Groovy Gateway is signaled to stop...
def stopped = false;
stopped = gateway.waitUntilStopping(200);
// Now stop the listener...
Ok, luckily I got it working ... Seems there was some problem with class loading, not sure what exaclty. I don't fully understand the groovy code, so I would like to ask the following:
Is the connection to foreign queue permanent and every time a message is received, groovy calls onMessage?
OrderListener.java has also stop method, which is called from groovy. Is this necessarily? I would prefer a permanent subscription with a possibility to try and reconnect (infinite times), in case the queue is down.
I'm trying to achieve the following: After server starts, it connects to a foreign JMS queue and listens for messages. If a message arrives, it transforms the message and sends it to a different system. Can you please advise me, if I need to make some changes to the groovy script.
Thanks and regards,