Mach-II Error: A ResultArg/Key has been specified on a notify command method that is returning void.

{ Posted By : Eric Cobb on November 8, 2009 }
253 Views
Related Categories: Mach-II

I'm posting this mainly for my own recollection down the road, because the old gray matter doesn't seem to retain as much as it used to... ;^)

While working in Mach-II today, I came across the following error:

A ResultArg/Key has been specified on a notify command method that is returning void. This can also happen if your listener method returns a Java null.

After checking through the code in my listener about a dozen times, I finally realized that I was getting this error because my function in my listener had a returntype of "void", but my "notify listener" tag in my event-handler (in the mach-ii.xml file) had a resultArg specified.

Oops! I took out the resultArg and all was well.

Comments
Peter J. Farrell's Gravatar Good reminder for people Eric. FYI, I've improved the error message in 1.8 today to read:

"A ResultArg/Key has been specified on a notify command method that is returning void. This can also happen if your listener method returns a Java null. Return data from your listener or remove the resultArg/Key from your notify command."

Hopefully that is even more explicit for people that haven't come across this before.
# Posted By Peter J. Farrell | 11/8/09 4:58 PM
Eric Cobb's Gravatar Great Peter! Thanks for the update.
# Posted By Eric Cobb | 11/9/09 10:25 AM