private methods in service

406 views
Skip to first unread message

Nish

unread,
Nov 24, 2011, 6:01:47 PM11/24/11
to javamelody
I have a private method defined in a service. When calling it, I get
missingMethodException. Does javamelody not support private methods?

Thanks,
Nish

Emeric Vernat

unread,
Nov 24, 2011, 6:18:00 PM11/24/11
to javam...@googlegroups.com
Hi,

javamelody has nothing to do with private methods as far as I know.
So javamelody does not seem the cause of the issue at first sight.

By the way, the only missingMethodException(s) I find on the web comes
from .Net or perhaps groovy.
And so, you are perhaps the very first able to use javamelody in .Net or
perhaps you are using the grails plugin.
Is this a miracle or just the javamelody grails plugin?

Bye,
Emeric


Le 25/11/2011 00:01, Nish a �crit :

Nish

unread,
Nov 24, 2011, 7:49:10 PM11/24/11
to javamelody
Yeah, I am using the grails plugin.

tgrip

unread,
Nov 26, 2011, 10:47:18 AM11/26/11
to javamelody
Hi Nish,

it is probably some error in your app code, the cause can be obscured
by JavaMelody.
What method is it, and how do you call it?
We are using the Grails plugin without any problem.

Best regards
Theo

Nish

unread,
Nov 27, 2011, 4:02:51 PM11/27/11
to javamelody
Hello Theo,

Here is how I am executing the method"

class UserService {
    def doStuff(params)     {        if(isAdmin()) { //
missingMethodException because of the grailsmelody plugin         
  ....        }    }
    private def isAdmin() {        ....    }
}
Thanks,
Nish

tgrip

unread,
Nov 28, 2011, 10:57:47 AM11/28/11
to javamelody
Hi Nish,

hmm, it looks strange, it should work as you say it.
I would recommend to add some printlns in order to debug, to see if it
enters the method and what is the value of the parameter.
I was telling you this because it had happened to me too, I got
MissingMethodExceptions, but it was always something wrong with the
parameters.

Best regards
Theo

Nish

unread,
Nov 28, 2011, 12:00:12 PM11/28/11
to javamelody
I fixed it. It had to do with how method was declared. I am not
exactly sure as to why this fixed the problem.

Failed: private def isAdmin( name, Class c ) { .... }
Worked: private def isAdmin( name, c ) { .... }

Nish

tgrip

unread,
Nov 28, 2011, 2:09:25 PM11/28/11
to javamelody
Cool, this is the kind of problems I was referring to

evernat

unread,
Dec 4, 2011, 8:15:43 AM12/4/11
to javamelody
Hi,

I have created an issue to track the problem:
http://code.google.com/p/javamelody/issues/detail?id=165

Feel free to submit a patch in the issue.

bye,
Emeric

Reply all
Reply to author
Forward
0 new messages