The type org.springframework.context.ConfigurableApplicationContext cannot be resolved
来源:互联网 发布:js设置button不可点击 编辑:程序博客网 时间:2024/06/07 00:55
当我在start.spring.io 上创建freemarker Test程序时,发生了以下错误。
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.jun</groupId><artifactId>springInitializr</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>springInitializr</name><description>Demo project for Spring Boot</description><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.5.3.RELEASE</version><relativePath/> <!-- lookup parent from repository --></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-freemarker</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>
import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class SpringInitializrApplication {public static void main(String[] args) {SpringApplication.run(SpringInitializrApplication.class, args);}}在main中的run方法报出异常,“The project was not built since its build path is incomplete. Cannot find the class file for org.springframework.context.ConfigurableApplicationContext. Fix the build path then try building this project ” project前有小红叹号,但是在 java Build Path中并没有出现任何异常。
在markers view 中提示:“The type org.springframework.context.ConfigurableApplicationContext cannot be resolved. It is indirectly referenced from required .class files”
经查询发现 在 这里 发生了和我类似的问题, 原来问题是出现在maven中缓存上,maven的缓存已损坏
按照以下步骤解决:
在命令行中转到项目目录。
确保您的POM.xml与您的命令行在同一个目录中
运行命令 mvn dependency:purge-local-repository
如果您收到构建成功的消息,表示错误已解决。
如果仍然存在错误,请删除(〜/ .m2 / repository / org / springframework)文件夹并运行 mvn package
它现在可以正常工作
阅读全文
5 0
- The type org.springframework.context.ConfigurableApplicationContext cannot be resolved
- The type org.springframework.context.ConfigurableApplicationContext cannot be resolved. It is indire
- The import org.springframework.context.support.ClassPathXmlApplicationContext cannot be resolved
- The type org.springframework.dao.support.DaoSupport cannot be resolved.
- The type org.springframework.dao.support.DaoSupport cannot be resolved.
- The type org.springframework.dao.support.DaoSupport cannot be resolved.
- The import org.springframework.test.context.junit4.SpringJUnit4ClassRunner cannot be resolved
- 异常 The type org.springframework...DaoSupport cannot be resolved. It is indirectly...
- [ssh ][异常]The type org.springframework.dao.support.DaoSupport cannot be resolved........
- The type org.springframework.orm.hibernate3.support.HibernateDaoSupport cannot be resolved. It is in
- The type org.springframework.dao.support.DaoSupport cannot be resolved
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- 异常The type org.springframework.dao.support.DaoSupport cannot be resolved.
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced
- The type org.springframework...DaoSupport cannot be resolved. It is indirectly..
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced
- Qt5之QLCDNumber
- 在vs2008环境下编译opencv程序时遇到的问题
- 【CSS3】纯css3悬停文字线条边框动画特效
- token
- 老司机带你飞——图解html和css
- The type org.springframework.context.ConfigurableApplicationContext cannot be resolved
- android字符串换行不正常的问题
- 企业服务市场面临洗礼,如何才能从竞争中脱颖而出?
- Redis的接触之旅---菜鸟级由0开始安装与使用
- java生成二维码使用QRCode和ZXing两种方式
- 设计模式(Design Patterns)-可复用面向对象软件的基础 01:简介(Abstract)
- openfire+spark 登录不上问题
- Git Stash用法
- 【软考】总结