-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Bug Report: ClassNotFoundException when enabling DEBUG logging for org.springframework.ai
Spring AI version: 1.0.1
Spring Boot version: 3.5.5
Java version: 21
Description:
When setting the logging level to DEBUG for org.springframework.ai, the application fails to start due to a ClassNotFoundException.
However, using INFO level works without issues.
This behavior makes logging level affect runtime stability, which should not happen.
Steps to Reproduce:
- Create a Spring Boot project with Spring AI 1.0.1.
- Do not add the spring-security-oauth2-client dependency.
3.Configure logging in application.properties:
logging.level.org.springframework.ai=DEBUG - Run the application.
Actual Behavior:
Application fails with:
java.lang.ClassNotFoundException: org.springframework.security.oauth2.client.ClientAuthorizationException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
...
at org.springframework.ai.model.tool.autoconfigure.ToolCallingAutoConfiguration.toolExecutionExceptionProcessor(ToolCallingAutoConfiguration.java:87)
...
Expected Behavior:
Enabling DEBUG logging should not trigger ClassNotFoundException.
If spring-security-oauth2-client is not present, Spring AI should gracefully skip OAuth2-related configuration.
Logging level should never change the runtime behavior of auto-configuration.