首页 > 编程语言 >springboot项目启动报错java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplication...

springboot项目启动报错java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplication...

时间:2023-05-24 21:04:57浏览次数:61  
标签:lang ... java boot springframework SimpleApplicationEventMulticaster 报错 SpringAp


产生此问题的原因是由于spring boot版本兼容性导致的:

java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
2019-08-29 18:04:54.089 ERROR [restartedMain][SpringApplication.java:842] - Application run failed
java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:120)
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:84)
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:62)
	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:358)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:317)
	at com.soft.site.CmsApplication.main(CmsApplication.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)

在pom.xml中修改配置文件,修改前:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.0.1.RELEASE</version>
	<relativePath/>
    </parent>

    .......
    .......
</project>

修改后的版本

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>1.5.3.RELEASE</version>
	<relativePath/>
    </parent>

    .......
    .......
</project>

修改完后再次启动项目,成功。

标签:lang,...,java,boot,springframework,SimpleApplicationEventMulticaster,报错,SpringAp
From: https://blog.51cto.com/u_16128050/6342858

相关文章

  • Linux配置各种yum源地址,阿里、清华、网易.....
    Linux配置各种yum源地址,阿里、清华、网易.....各种源地址汇总:https://developer.aliyun.com/article/869790国外的yum源访问速度较慢,一般情况下建议替换成国内的免费yum源。国内提供了不少优秀的yum源,例如:•搜狐开源镜像站:http://mirrors.sohu.com/•网易开源镜像站:http://......
  • Centos7显卡驱动安装及报错解决
    注意实际安装版本(最后直接安装Anaconda3,无需再安装Python)1.1查看显卡型号1.2下载显卡驱动访问https://www.nvidia.cn/Download/index.aspx搜索显卡所需要的驱动型号并下载1.3禁用集成显卡驱动nouveaumv/boot/initramfs-$(uname-r).img/boot/initramfs-$(uname-r).img.bakd......
  • 【Java读取串口】[rxtxSerial.dll+0x5b00]报错(使用RXTXcomm.dll)
    使用RXTXcomm报错EXCEPTION_ACCESS_VIOLATION(0xc0000005)C[rxtxSerial.dll+0x5b00]原文链接:https://blog.csdn.net/Loveme_CN/article/details/1159184931.背景项目中需要将信息通过串口方式发送至单片机,从而使用了RXTXxcomm这个工具包,本机已完成与串口工具的调试,在迁移至......
  • springcloud 第一个项目遇到的报错
    在创建模块springcloud-provider-8001的时候出现两个错误,一个是CLASSNOTFOUND,另一个是错误的类文件:/D:/apache-maven-3.8.8/maven-repo/org/springframework/spring-beans/6.0.4/spring-beans-6.0.4.jar!/org/springframework/beans/factory/annotation/Autowired.class   ......
  • sshpass报错 Permission denied, please try again.和 connect to host localhost po
    最近在做自动化时,自动化脚本用sshpass给远程机器发送命令(sshpass-p"123456"ssh-p10022root@localhost-oStrictHostKeyChecking=no"poweroff")报错:Permissiondenied,pleasetryagain.和 ssh:connecttohostlocalhostport10022:Connectionrefused   1.......
  • 新建项目git push报错
    连接好远程仓库之后push,发现报错git要求我们在第一次push之前先进行pull操作而执行pull之后,又报错:git提示:Thereisnotrackinginformationforthecurrentbranch.解决方法在终端输入:gitbranch--set-upstream-to=GYKG-invoice/mastermasterpull还报错:fatal:r......
  • selenium 启动ie浏览器报错:Unexpected error launching Internet Explorer. Protected
    解决selenium启动ie浏览器报错:UnexpectederrorlaunchingInternetExplorer.ProtectedModesettingsarenotthesameforallzones错误原因是IE浏览器中的安全选项设置不一致。打开IE浏览器,进入Internet选项, 确保这四个区域的启用保护模式设置保持一致应用即可。......
  • 【剑指offer】- 求1+2+3+...+n -47/67
    1.题目描述求1+2+3+…+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。2.题目分析对于这种求1+2+3+…+n的题,我们可以采取3中方法第一种:直接利用等差数列的思想来进行求和return(1+n)*n/2;第二种:利用迭代的思想进行求和intres=......
  • Ubuntu18.04 安装 clang
    官网:https://apt.llvm.org 一、添加源: 根据官方页面提示,找到系统分类,ubuntu18.04源: -debhttp://apt.llvm.org/bionic/llvm-toolchain-bionicmaindeb-srchttp://apt.llvm.org/bionic/llvm-toolchain-bionicmain#Needs'sudoadd-apt-repositoryppa:ubuntu-to......
  • nrm 安装报错解决
    在执行nrmls时出现错误Error[ERR_REQUIRE_ESM]:MustuseimporttoloadESModule:...require()ofESmodulesisnotsupported....原因:应该使用open的CommonJs规范的包,现在openv9.0.0是ESModule版本的包解决办法:执行以下命令即可npminstall-gnrm......