java.lang.NoClassDefFoundError:orgspringframeworkcoreenvConfigurableEnvironment

java.lang.NoClassDefFoundError:orgspringframeworkcoreenvConfigurableEnvironment,第1张

java.lang.NoClassDefFoundError:org / springframework / core / env / ConfigurableEnvironment
  1. 转到Spring boot Initialzr站点,然后选择Web stack作为依赖项。
  2. 由于Spring Boot使用Opinionised依赖项和BOM表的概念,它将自动提取其他依赖项并解决classNotFoundException问题。在你的情况下,它会错过Spring-core-4.2.4.RELEASE.jar依赖项。
  3. 以全新安装spring-boot:run -e的身份执行Maven目标,你可以在IDE中找到你的maven依赖项,下面给出了一个示例POM文件。
  <?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.example</groupId>  <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging>     <name>demo</name>    <description>Demo project for Spring Boot</description>     <parent>       <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-starter-parent</artifactId>     <version>1.4.0.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-web</artifactId>     </dependency>     <dependency>          <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId>  <scope>provided</scope>      </dependency>    <dependency>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-actuator</artifactId>     </dependency>     <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-test</artifactId>        <scope>test</scope>      < /dependency>    </dependencies>  <build>    <finalName>demo</finalName>       <plugins>         <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>         </plugin>      </plugins>    </build>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5004591.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-14
下一篇 2022-11-14

发表评论

登录后才能评论

评论列表(0条)

保存