目录

Exception-in-thread-main-java.lang.IllegalArgumentException异常解决

目录

Exception in thread “main” java.lang.IllegalArgumentException:异常解决

Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.context.logging.ClasspathLoggingApplicationListener
	at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:418)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:409)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:261)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:240)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1230)
	at cn.jcb2b.property.application.JCapplication.main(JCapplication.java:19)
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/event/GenericApplicationListener
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:275)
	at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:431)
	... 7 more
Caused by: java.lang.ClassNotFoundException: org.springframework.context.event.GenericApplicationListener
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 21 more
Disconnected from the target VM, address: '127.0.0.1:57630', transport: 'socket'

Process finished with exit code 1

解决:把context4.0.0 换成context 5.0.10

点击

https://i-blog.csdnimg.cn/blog_migrate/b82947f16a42936175d48062a5640413.png

https://i-blog.csdnimg.cn/blog_migrate/528b8c8e8259c8bc4ed8ea9885aaa999.png

https://i-blog.csdnimg.cn/blog_migrate/5a80205a93a8818d91425ac856d13513.png

https://i-blog.csdnimg.cn/blog_migrate/ca938f02a56108cdde167a89bbcbdea0.png