Passing varargs to Spring spEL causes “Method cannot be found on com.sun.proxy”
I try to write custom class for permissions evaluation, so it can be used with Spring Security @PreAuthorize and Spring Expression Language like for example this ( authority is just a regular Spring component with some role names): @PreAuthorize("@permissionEvaluator.anyOfRoles(@authority.ADMIN)") The PermissionEvaluator#anyOfRoles method declaration looks like follows: boolean anyOfRoles(String... roles) As shown this method takes varargs of String type. It works fine when only one parameter is passed (as on the example above) but calling it with more than one argument, eg. @PreAuthorize("