在我的 gradle 基础项目中,我正在尝试将 spring (
spring-boot-starter-jetty
) 依赖项从 2.7.6 升级到 3.0.5
看起来一切都启动并且工作正常。然而,在启动过程中,我注意到来自 JNDI 的日志循环了。
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.group]
DEBUG o.s.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.group] not found - trying original name [logging.group]. javax.naming.NameNotFoundException: env is not bound; remaining name 'env/logging.group'
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.group]
DEBUG o.s.jndi.JndiPropertySource - JNDI lookup for name [logging.group] threw NamingException with message: null. Returning null.
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.group]
DEBUG o.s.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.group] not found - trying original name [logging.group]. javax.naming.NameNotFoundException: env is not bound; remaining name 'env/logging.group'
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.group]
DEBUG o.s.jndi.JndiPropertySource - JNDI lookup for name [logging.group] threw NamingException with message: null. Returning null.
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.level]
DEBUG o.s.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.level] not found - trying original name [logging.level]. javax.naming.NameNotFoundException: env is not bound; remaining name 'env/logging.level'
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.level]
DEBUG o.s.jndi.JndiPropertySource - JNDI lookup for name [logging.level] threw NamingException with message: null. Returning null.
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.level]
DEBUG o.s.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.level] not found - trying original name [logging.level]. javax.naming.NameNotFoundException: env is not bound; remaining name 'env/logging.level'
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.level]
DEBUG o.s.jndi.JndiPropertySource - JNDI lookup for name [logging.level] threw NamingException with message: null. Returning null.
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.level.org.springframework]
DEBUG o.s.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.level.org.springframework] not found - trying original name [logging.level.org.springframework]. javax.naming.NameNotFoundException: env is not bound; remaining name 'env/logging.level.org.springframework'
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.level.org.springframework]
DEBUG o.s.jndi.JndiPropertySource - JNDI lookup for name [logging.level.org.springframework] threw NamingException with message: null. Returning null.
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/logging.level.org.hibernate]
DEBUG o.s.jndi.JndiLocatorDelegate - Converted JNDI name [java:comp/env/logging.level.org.hibernate] not found - trying original name [logging.level.org.hibernate]. javax.naming.NameNotFoundException: env is not bound; remaining name 'env/logging.level.org.hibernate'
DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [logging.level.org.hibernate]
DEBUG o.s.jndi.JndiPropertySource - JNDI lookup for name [logging.level.org.hibernate] threw NamingException with message: null. Returning null.
因为我发现关闭JNDI我应该在春天设置
application.properties
spring.jndi.enabled=false 和 org.eclipse.jetty.jndi=假
但看起来这个选项在 spring boot 3 中不起作用,因为我仍然看到 JNDI 查找日志。有人遇到过这个问题并知道如何解决吗?