springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument

时间:2024-03-24 14:43:56

问题一.springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgumentException

问题二.或者IDEA启动tomcat抛出-------Error:java: 无效的目标发行版: 1.8

1.原因:spring3.2和java1.7不兼容。
2.解决方法:将项目环境全部换成1.7
1).点击File-Project Structure-Project

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument

2).点击File-Project Structure-Modules-Sources

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument

3).点击File-Project Structure-Modules-Dependencies

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument

4).点击File-Project Structure-SDKs

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument

5).点击Tomcat的Edit Configurations

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument

补充:与环境变量JDK1.7或者1.8无关。(附图)

springmvc运行时,Failed to read candidate component class;nested exception is java.lang.IllegalArgument
按照上述步骤1)------5),配好。我的环境变量是JKD1.8也也可。