Spring Boot version : 3.0.3 and 3.0.2 Java version : 17
There is a demo java spring boot application which consumes a logger java spring boot project (which is exposed as a maven dependency) which basically has some aspects written to intercept the controller and service class method to print ENTRY and EXIT logs. Post performing the upgrade to the logger library project with spring boot 3.0.3 there were no beans getting created for the classes like the aspect classes, classes annotated with @RestController etc. Then, I downgraded the version of spring boot to 3.0.2 and with this beans started getting created and I was able to see the beans reflecting in /actuator/beans endpoint for logger application.
Now, this upgraded library (logger application) got consumed in the demo application which is also running on spring boot 3.0.2 and when I tried to hit /actuator/beans inside the demo application, I was not getting any classes (aspect classes) which are exposed as a beans from the logger application.
Is there any changes made to spring aop as part of the spring framework 6 ? or is there any additional steps got added to expose a bean so that it can be utilized in different application where the logger application is getting consumed.
Sample Configuration class (logger project) :
@Configuration
public class LoggerAutoConfiguration {
@Bean
@ConditionalProperty(name = "logger.logging.enabled", matchIfMissing = true)
@ConditionalOnMissingBean
public LoggerLoggingAspect configureLoggerAspect() {
return new LoggerLoggingAspect();
}
}
````
POM demo application :
.....
Comment From: wilkinsona
This sounds like a duplicate of https://github.com/spring-projects/spring-boot/issues/34379. Do you have any spaces or other unusual characters in the path of the application?
Comment From: pawank0411
I was having some spaces in both the logger and demo application. Post removing the spaces, yes the beans were reflecting with spring boot 3.0.3.
But I am still not able to see the beans of logger application in /actuator/beans endpoint for demo application. That means beans are still not getting exposed from logger application to demo application, provided there is no space in the application path.
Spring Boot version : 3.0.0 Spring Framework version : 6.0.4 Java : 17
Comment From: wilkinsona
Thanks for the update.
But I am still not able to see the beans of logger application in /actuator/beans endpoint for demo application. That means beans are still not getting exposed from logger application to demo application, provided there is no space in the application path.
I can't tell why that would be happening from the little that you have described so far. One guess is that your logger library hasn't been updated to use the new AutoConfiguration.imports file. If that doesn't help and you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
Comment From: pawank0411
Thanks @wilkinsona - Updated the library with new AutoConfiguration.imports.file
It works now.
Comment From: wilkinsona
Thanks for letting us know.