bugsnag / bugsnag-java

BugSnag error reporting for Java.
https://www.bugsnag.com/platforms/java/
MIT License
56 stars 34 forks source link

add aopproxyutils dependancy and add handling in scheduledTaskConfig class #218

Closed clr182 closed 2 months ago

clr182 commented 2 months ago

Goal

The following warning appears when starting the SpringBootWeb application. “com.bugsnag.ScheduledTaskConfiguration : Bugsnag scheduled task exception handler could not be configured”. This happens when adding the @EnableScheduling annotation

Design

Checked the ScheduledTaskRegister to determine whether it is a proxy of the original object, then get the target class of the original object if it is and cast it as the taskSchedular before configuring the existing taskScheduler.

Changeset

Added new AoP springboot dependencies for accessing the original ScheduledTaskSchedular object.

Added checking to the ConfigureTasks method in ScheduledTaskConfiguration.java to determine whether the passed object is a proxy or not.

Handle cases where this is or isn't a proxy within the configureTasks method

Testing

Added two tests to determine if the taskScheduler object is a proxy.