On Fri, Apr 23, 2010 at 4:03 PM, K. Michael Wille <mike...@flowz.com> wrote:
On Apr 23, 2010, at 4:42 PM, gmail wrote:
On Apr 23, 2010, at 4:03 PM, Jeff Brown wrote:
Are you really sure that both are being called? Is it possible that
only one is being called and that it is doing something that would
make it look like the other one was being called as well?
I originally grabbed the mail plugin's source and added debug statements to key locations like MailService.sendMail. However, I just noticed that I didn't add any debug statements to the mail plugin's doWtihApplicationContext where things are setup. After doing that, I saw that the Mail Plugin's closure was never called. But but the sendMail method in MailService was!
My plugin's service was in the same package as the mail plugin's MailService: org.grails.plugins.mail. It had a different class name. But the method being called in the closure was the same name in both classes: sendMail. Nowhere in my code am I calling MailService.sendMail. If I rename my service method name to something like rockAndRoll(), the problem goes away. I'm not quite sure why that is... But at least the problem is fixed.
Thanks a ton for your help Scott and Jeff!
Just in case people think I'm crazy, I'm able to reproduce this issue just by using the same method names in two differently named services in the same package. Though, mabye this is the expected behavior?
No, that isn't the expected behavior. I expect that something else is
going on in your application that explains this. If it really is the
case that both methods are being called and you can create a simple
demonstrative application, please file a JIRA and attach that app.