-
1. Re: Groovy script not found on classpath
mimra Feb 21, 2012 6:58 AM (in response to rimarvladimir)Hi Vladimir
I haven't tried this, so I'm guessing; but the Redhat documentation uses a starting "/" in the script attribute:
<listeners>
<groovy-listener name="orderJmsListener" script="/com/acme/OrderListener.groovy">
<property name="queueName" value="..."/>
</groovy-listener>
</listeners>Have you tried that?
/Michael
-
2. Re: Groovy script not found on classpath
rimarvladimir Feb 21, 2012 7:40 AM (in response to mimra)Actually, I have tried with a starting "/" and also without. In both case, I'm getting the same exception
-
3. Re: Groovy script not found on classpath
tcunning Feb 21, 2012 11:15 AM (in response to rimarvladimir)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?
-
4. Re: Groovy script not found on classpath
rimarvladimir Feb 21, 2012 12:08 PM (in response to tcunning)Hi Tom,
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.
import com.frox.itsm.cmdb.integrator.ncinv.OrderListener;
OrderListener orderListener = new OrderListener();
// Start the listener (passing the config)...
orderListener.start(config);
// Wait until the Groovy Gateway is signaled to stop...
def stopped = false;
while(!stopped) {
stopped = gateway.waitUntilStopping(200);
}
// Now stop the listener...
orderListener.stop();
-
5. Re: Groovy script not found on classpath
rimarvladimir Feb 21, 2012 1:46 PM (in response to rimarvladimir)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,
Vladimir