0
点赞
收藏
分享

微信扫一扫

Springboot 加载不到主类


问题描述:一般spring加载不到主类,都是jar包或版本的问题,但是eclipse中的problems没有报错,只有warning。


[html] 
​​view plain​​​
​​​copy​​


1. Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
2. at com.UnionPay.UserManageSys.UserManageSysApplication.main(UserManageSysApplication.java:15)
3. Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext
4. at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
5. at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
6. at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
7. at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
8. ... 1 more


处理方法如下:

直接通过命令行mvn clean install,进入项目目录

Springboot 加载不到主类_spring

然后就能看到相应的原始报错信息

Springboot 加载不到主类_java_02

找到有问题的jar包

再在eclipse中项目上 project->clean

然后再run,完美解决问题。

举报

相关推荐

0 条评论