项目Spring引导1..5.7版本。我正在使用Intellij IDEA 2017.2.4和gradle进行依赖性管理。当我构建项目时,它成功构建,没有错误。当我用bootRun gradle任务运行应用程序时,它显示以下错误。
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.boot.SpringApplicationRunListener : org.springframework.boot.context.event.EventPublishingRunListener at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:413) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:392) at org.springframework.boot.SpringApplication.getRunListeners(SpringApplication.java:378) at org.springframework.boot.SpringApplication.run(SpringApplication.java:291) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) at com.kifiya.lmanagement.LmanagementApplication.main(LmanagementApplication.java:13) Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.event.EventPublishingRunListener]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava/lang/Object;)Ljava/lang/Object; at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154) at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:409) ... 6 more Caused by: java.lang.NoSuchMethodError: org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava/lang/Object;)Ljava/lang/Object; at org.springframework.context.event.AbstractApplicationEventMulticaster.addApplicationListener(AbstractApplicationEventMulticaster.java:105) at org.springframework.boot.context.event.EventPublishingRunListener.(EventPublishingRunListener.java:56) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142) ... 7 more
老问题,但是在将Spring应用程序转换为Spring Boot后,我遇到了同样的错误。使用 spring-boot-starter-aop
而不是直接依赖于特定版本的 spring-aop
为我解决了这个问题,例如在 build.gradle
中:
plugins {
id 'org.springframework.boot' version '1.5.17.RELEASE'
}
apply plugin: 'io.spring.dependency-management'
dependencies {
compile 'org.springframework.boot:spring-boot-starter-aop'
}
代替
dependencies {
compile 'org.springframework:spring-aop:4.2.4.RELEASE'
}
看起来 spring-aop
与您的其他库不匹配。尝试运行 gradle
依赖项并检查所有 Spring 依赖项是否处于同一版本中。有关检查依赖项的更多信息,请参阅 Gradle 用户手册。
正如上面提到的,这似乎是Spring中的一个依赖问题。最简单的方法是检查你的POM文件。
查看此处了解更多信息: https://docs.gradle.org/current/userguide/introduction_dependency_management.html
我对Spring靴不熟悉。任何时候我运行我的Spring启动应用程序,我得到错误。需要帮助运行我的Spring启动应用程序。 错误信息:白标签错误页 此应用程序没有/error的显式映射,因此您将其视为回退。 2016年10月10日星期一10:39:54 WAT出现意外错误(类型=未找到,状态=404)。没有可用的消息 代码:
我在启动spring boot应用程序时遇到以下错误。这是我的第一个spring boot项目。因此,我不确定错误以及如何修复它。 申请启动失败 描述: 配置为侦听端口8080的Tomcat连接器无法启动。端口可能已在使用中,或者连接器可能配置错误。 行动: 验证连接器的配置,识别并停止在端口8080上侦听的任何进程,或者将此应用程序配置为在另一个端口上侦听。
我试图在Intellij终极版15.0.4中配置Spring Boot运行配置。完成以下工作。 单击以创建新的Spring Boot配置 添加了主类、VM选项、JRE和环境变量 我无法在Spring Boot设置下找到启用启动优化和启用JMX代理?谁能推荐一下吗
这是我第一次使用Javafx与Spring Boot我有以下错误时运行我的应用程序 主课 } 控制器类 } pom.xml http://maven.apache.org/xsd/maven-4.0.0.xsd" 拜托这是怎么回事。为什么org.springframework.boot:sping-boo-maven-plugin:2.0.0。释放:运行不能被执行? 场景fxml代码 我正在用Ne
问题内容: 我想在我的spring-boot应用程序开始监视目录更改后运行代码。 我尝试运行新线程,但此时尚未设置服务。 我已经能够找到,它会在设置注释之前触发。理想情况下,一旦应用程序准备处理http请求,我希望触发该事件。 在Spring Boot中启动应用程序后,是否有更好的事件可以使用,或者有更好的代码运行方式? 问题答案: 尝试:
几天来,我一直在尝试使用WebFlux在Spring启动中运行一个简单的H2/R2dbc数据库。该应用程序启动正常,但当我调用 /todosendpoint以获取数据库中的所有对象时,我收到以下错误: 我的理解是,如果我用创建表命令在类路径上添加一个schema.sql文件,它将在启动时使用它来创建表,但看起来这并不起作用。对我可能做错了什么有什么想法吗?任何帮助都将不胜感激,我想得到的是一个工作