proxy - Spring proxied class with CGLIB - how to discover names of function's arguments -


i want use @eventlistener annotation condition attribute on proxied object. el expression uses function's argument. during runtime org.springframework.core.localvariabletableparameternamediscoverer cannot read debug information cglib generated proxy , why parameters not accessible. result

org.springframework.expression.spel.spelevaluationexception: el1007e:(pos 92): property or field 'prop' cannot found on null

class interestedinevent {      @eventlistener(classes = someevent.class, condition="#event.prop!=null")     @cacheevict(cachenames = cache_for_something, allentries = true)     public void onevent(someevent event) {         logger.debug("chache {} has been cleaned, event={}", cache_for_something, event);     }  } 

how can expose names of arguments or how make spring analyse original class , not proxy?

i've had similar problem , found workaround using #root.event instead of #event.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -