开发者社区> 问答> 正文

SpringBoot项目启动时报错

今天在网上下载了一个SpringBoot项目,用idea运行时报错,网上也没有找到好的解决方案。特来想大神求助。下面是报错信息:

26-Mar-2020 10:21:18.951 信息 [RMI TCP Connection(2)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。
26-Mar-2020 10:21:18.966 严重 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
26-Mar-2020 10:21:18.968 严重 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [/demo_war] startup failed due to previous errors
2020-03-26 10:21:18.977  INFO 58883 --- [on(2)-127.0.0.1] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
26-Mar-2020 10:21:18.998 警告 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc Web应用程序 [demo_war] 注册了JDBC驱动程序 [com.mysql.jdbc.Driver],但在Web应用程序停止时无法注销它。 为防止内存泄漏,JDBC驱动程序已被强制取消注册。
[2020-03-26 10:21:19,024] Artifact demo:war: Error during artifact deployment. See server log for details.
26-Mar-2020 10:21:22.058 信息 [Abandoned connection cleanup thread] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1385)
        at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1038)
        at com.mysql.jdbc.AbandonedConnectionCleanupThread.checkContextClassLoaders(AbandonedConnectionCleanupThread.java:90)
        at com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:63)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

遇到了同样的问题,在CSDN看到了,希望阿里云团队能够给出正确、标准的答案~请查看

展开
收起
刘刚_ 2020-05-22 21:20:05 1685 0
1 条回答
写回答
取消 提交回答
  • application.yml(application.properties)

    极其简单的配置,但是跑起来不是问题。 程序入口类 在这里插入图片描述 当然也是没有问题的,就是加了一个@EnableEurekaServer注解,表示是一个服务注册中心 pom.xml 放在最后不是没道理的

    4.0.0 com.ecjtu demo 0.01-SNAPSHOT jar demo UTF-8 Finchley.SR1 org.springframework.boot spring-boot-starter-parent 2.0.2.RELEASE org.springframework.cloud spring-cloud-starter-netflix-eureka-server org.springframework.boot spring-boot-starter-logging org.springframework.boot spring-boot-starter-log4j2 junit junit 4.12 test org.springframework.cloud spring-cloud-dependencies ${spring-cloud.version} pom import build> demo org.springframework.boot spring-boot-maven-plugin -server -Xmx2048m -Xms2048m -XX:MaxPermSize=512m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9090 com.lelian.Application true 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 我是左看右看,就是解决不了,但是如果我把@EnableEurekaServer注解和关于eureka的配置都去掉,就完全是一个普通的Springboot项目,但是项目可以跑起来。我也是很奇怪啊!!! 最后想了一下是不是java版本的问题,网上许多教程都是在java8的环境下搭建的,但是我用的java版本是java10,这是一个你知道但是不知道他有什么特性的版本,然后百度了一下他的特性,从java9开始,模块化的概念使得JAXB默认没有加载;jaxb-api是存在jdk中的,只是默认没有加载而已,我们需要手动引入。要问这个jaxb-api是什么作用,大家可以自行百度,反正我引入了这个模块问题得到了解决。 jaxb模块引用 - start com.sun.xml.bind jaxb-core 2.2.11 javax.xml.bind jaxb-api com.sun.xml.bind jaxb-impl 2.2.11 org.glassfish.jaxb jaxb-runtime 2.2.10-b140310.1920 javax.activation activation 1.1.1 jaxb模块引用 - end
    2021-02-24 11:16:06
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载
微服务架构模式与原理Spring Cloud开发实战 立即下载
阿里特邀专家徐雷Java Spring Boot开发实战系列课程(第18讲):制作Java Docker镜像与推送到DockerHub和阿里云Docker仓库 立即下载

相关实验场景

更多