简体   繁体   English

spring boot 登录应用程序

[英]spring boot login application

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:450)
    at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:429)
    at org.springframework.boot.SpringApplication.getRunListeners(SpringApplication.java:415)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
    at com.csi.app1.ApplicationDemo1.ApplicationDemo1Application.main(ApplicationDemo1Application.java:14)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.boot.context.event.EventPublishingRunListener]: Constructor threw exception; nested exception is java.lang.NoSuchFieldError: INSTANCE
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
    at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:446)
    ... 6 more
Caused by: java.lang.NoSuchFieldError: INSTANCE
    at org.springframework.boot.SpringApplication.asUnmodifiableOrderedSet(SpringApplication.java:1326)
    at org.springframework.boot.SpringApplication.getListeners(SpringApplication.java:1236)
    at org.springframework.boot.context.event.EventPublishingRunListener.<init>(EventPublishingRunListener.java:57)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
    ... 7 more

Roshni, it seems somewhere in your code you are writing, Roshni,它似乎在你正在编写的代码中的某个地方,

YOUR_INTERFACE_NAME objectname = new YOUR_INTERFACE_NAME();

means you are trying to create new instance of an interface.意味着您正在尝试创建接口的新实例。

Please check and remove that line, and insted implement that interface in a class and then initialize the class.请检查并删除该行,并在类中插入实现该接口,然后初始化该类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM