cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Accessor not working

thanos_matzanas
Contributor

A client of mine is trying to set up a measure for “Method – Return Value”
that splits on the class name of a method return value. To that end, we created a method sensor and selected “Method return values will be
recorded.” The object we’re returning is a simple POJO, and in the
PurePath we can see the return object’s toString() data being recorded. When we set the “Accessor” field to a method like “getName()”, then it returns just
fine. If we instead set the “Accessor” field to the specific values
“getClass()” or “getClass().getName()” then the PurePaths show “accessor
failure.”

Why can’t we use the getClass() method as part of a sensor
accessor? Or is there another way to create a splitting based on the
classname of a method return value?

4 REPLIES 4

c_schwarzbauer
Dynatrace Champion
Dynatrace Champion

hi Thanos,

you can find out more about this by enabling the agent debug flag "debugIntrospectionJava".

to do so go into client debug mode (Ctrl+Shift+F9), go to the corerct system profile -> agent group -> agent mapping -> debug... and add this debug flag with value "true".

after that you should get way bigger log files for those agents.

just search for "while evaluating accessor" in there and see what comes up.

HTH,
Christian

oscar_atienza
Helper

in my case it says it is because the method is not found on the class. it is because the method is on object (grandparent) class?

Hi Thanos,
Please check the below SO posts which might be related to your case:
https://stackoverflow.com/questions/21666026/java-getclass-getname-it-returns-the-class-not-the-name
https://stackoverflow.com/questions/5381431/what-does-class-getname-do-for-a-given-class

oscar_atienza
Helper

in my case .. it is not working ... i mean, i was expecting to get the class name ... but i cant call it. but i dont know why