Spring启动报错:java.lang.ClassNotFoundException: org.springframework.expression.ParserContext
程序员文章站
2022-04-14 20:41:52
...
1.记录一次启动报错:
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/expression/ParserContext
at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:629)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:517)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at com.gaosi.squirrel.start.Main.start(Main.java:69)
at com.gaosi.squirrel.start.Main.main(Main.java:48)
Caused by: java.lang.ClassNotFoundException: org.springframework.expression.ParserContext
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 6 more
解决办法:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>【和你所用的Spring版本匹配】</version>
</dependency>
我是在用spring-data-mongodb时exclusion掉了spring-expression:
最后,把exclusion掉的spring-expression注释起来,就OK了,同时maven依赖里也有了spring-expression包,最后启动就OK了。
上一篇: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException
下一篇: UVA 548 - Tree(树)
推荐阅读
-
idea启动项目报错Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
-
spring cloud boot 启动报错java.lang.IllegalStateException: Service id not legal hostname (/user-service)
-
2021-08-10spring boot启动报错Error starting ApplicationContext(application和前端问题)
-
spring boot项目IDEA启动报错问题解决
-
spring boot项目IDEA启动报错问题解决
-
spring-cloud 启动报错 NoSuchMethodError: SpringApplicationBuilder.<init>([Ljava/lang/Class;)V
-
spring boot集成selenium,chromedriver 自动化测试 启动不报错com.google.common.util.concurrent(从安装配置到运行成功)
-
现有web系统替换成Spring Boot2框架 之20 启动报错处理 spring boot启动报错@SpringBootApplicationUnable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
-
现有web系统替换成Spring Boot2框架 之20 启动报错处理 spring boot启动报错@SpringBootApplicationUnable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
-
启动spring boot项目时报错:java.lang.ClassNotFoundException: javax.servlet.Filter