spring boot启动报错 java.lang.IllegalAccessError: tried to access class LoggingSystemProperties

编程入门 行业动态 更新时间:2024-10-08 22:58:40

spring boot启动<a href=https://www.elefans.com/category/jswz/34/1771188.html style=报错 java.lang.IllegalAccessError: tried to access class LoggingSystemProperties"/>

spring boot启动报错 java.lang.IllegalAccessError: tried to access class LoggingSystemProperties

spring boot在本地tomcat中正常启动,放在linux服务器上报错,错误信息如下:

Caused by: java.lang.IllegalAccessError: tried to access class org.springframework.boot.logging.LoggingSystemProperties from class org.springframework.boot.context.logging.LoggingApplicationListener at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:231) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:173) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325) at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:154) at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:134) at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:87) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5352) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 6 more

最后的解决方式是,去掉了spring boot的默认日志框架Logback,引入log4j。

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><!-- 移除嵌入式tomcat插件 -->
   <exclusions><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-logging</artifactId></exclusion></exclusions>
</dependency>

更多推荐

spring boot启动报错 java.lang.IllegalAccessError: tried to access class LoggingSyste

本文发布于:2024-02-13 17:54:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1759958.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报错   java   spring   boot   lang

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!