When the custom Security Policy is implemented within the Spring Boot applications to restrict permissions for the user defined plugin code, below mentioned exception will be thrown while building the beans from the plugin code. This change will solve this issue. Same approach is already followed in SimpleInstantiationStrategy, ConstructorResolver and even in ReflectUtils (for some other statements but not this)

Issue:

org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.batch.JpaBatchConfigurer]: Factory method 'batchConfigurer' threw exception; nested exception is java.security.AccessControlException: access denied ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")

Refer the attachment for complete stack trace. Exception_Stacktrace.txt

Comment From: pivotal-issuemaster

@kalmeshcs Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-issuemaster

@kalmeshcs Thank you for signing the Contributor License Agreement!