Could not evaluate condition on org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration#characterEncodingFilter due to internal class not found

原创 Laughing  2019-07-18 13:44  阅读 94 次 评论 0 条

这个问题一般是pom.xml文件配置导致的

以下是我配置错误的

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"  
  3.          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  4.          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  5.     <modelVersion>4.0.0</modelVersion>  
  6.   
  7.     <groupId>Net.XiangCaoWuYu.Idea</groupId>  
  8.     <artifactId>Net.XiangCaoWuYu.Idea</artifactId>  
  9.     <version>1.0-SNAPSHOT</version>  
  10.     <packaging>jar</packaging>  
  11.     <name>Net.XiangCaoWuYu.Idea</name>  
  12.     <description>Demo project for Spring Boot</description>  
  13.   
  14.     <parent>  
  15.         <groupId>org.springframework.boot</groupId>  
  16.         <artifactId>spring-boot-starter-parent</artifactId>  
  17.         <version>1.2.7.RELEASE</version>  
  18.     </parent>  
  19.   
  20.     <properties>  
  21.         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
  22.         <start-class>Application.App</start-class>  
  23.     </properties>  
  24.   
  25.     <dependencies>  
  26.         <!--开发web项目相关依赖-->  
  27.         <dependency>  
  28.             <groupId>org.springframework.boot</groupId>  
  29.             <artifactId>spring-boot-starter-web</artifactId>  
  30.         </dependency>  
  31.         <!--springboot单元测试-->  
  32.         <dependency>  
  33.             <groupId>org.springframework.boot</groupId>  
  34.             <artifactId>spring-boot-starter-test</artifactId>  
  35.             <scope>test</scope>  
  36.         </dependency>  
  37.         <!-- 添加mysql-->  
  38.         <dependency>  
  39.             <groupId>org.springframework.boot</groupId>  
  40.             <artifactId>spring-boot-starter-jdbc</artifactId>  
  41.         </dependency>  
  42.         <dependency>  
  43.             <groupId>mysql</groupId>  
  44.             <artifactId>mysql-connector-java</artifactId>  
  45.             <scope>runtime</scope>  
  46.         </dependency>  
  47.         <dependency>  
  48.             <groupId>org.springframework.boot</groupId>  
  49.             <artifactId>spring-boot-starter-data-jpa</artifactId>  
  50.         </dependency>  
  51.         <!-- 添加thymeleaf-->  
  52.         <dependency>  
  53.             <groupId>org.springframework.boot</groupId>  
  54.             <artifactId>spring-boot-starter-thymeleaf</artifactId>  
  55.         </dependency>  
  56.         <dependency>  
  57.             <groupId>org.thymeleaf</groupId>  
  58.             <artifactId>thymeleaf</artifactId>  
  59.             <version>3.0.9.RELEASE</version>  
  60.         </dependency>  
  61.         <dependency>  
  62.             <groupId>org.thymeleaf</groupId>  
  63.             <artifactId>thymeleaf-spring4</artifactId>  
  64.         </dependency>  
  65.     </dependencies>  
  66.     <!--maven构建-->  
  67.     <build>  
  68.         <plugins>  
  69.             <plugin>  
  70.                 <groupId>org.springframework.boot</groupId>  
  71.                 <artifactId>spring-boot-maven-plugin</artifactId>  
  72.             </plugin>  
  73.         </plugins>  
  74.     </build>  
  75.   
  76. </project>  

修改方法为,去掉thymeleaf的version

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"  
  3.          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  4.          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  5.     <modelVersion>4.0.0</modelVersion>  
  6.   
  7.     <groupId>Net.XiangCaoWuYu.Idea</groupId>  
  8.     <artifactId>Net.XiangCaoWuYu.Idea</artifactId>  
  9.     <version>1.0-SNAPSHOT</version>  
  10.     <packaging>jar</packaging>  
  11.     <name>Net.XiangCaoWuYu.Idea</name>  
  12.     <description>Demo project for Spring Boot</description>  
  13.   
  14.     <parent>  
  15.         <groupId>org.springframework.boot</groupId>  
  16.         <artifactId>spring-boot-starter-parent</artifactId>  
  17.         <version>1.2.7.RELEASE</version>  
  18.     </parent>  
  19.   
  20.     <properties>  
  21.         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
  22.         <start-class>Application.App</start-class>  
  23.     </properties>  
  24.   
  25.     <dependencies>  
  26.         <!--开发web项目相关依赖-->  
  27.         <dependency>  
  28.             <groupId>org.springframework.boot</groupId>  
  29.             <artifactId>spring-boot-starter-web</artifactId>  
  30.         </dependency>  
  31.         <!--springboot单元测试-->  
  32.         <dependency>  
  33.             <groupId>org.springframework.boot</groupId>  
  34.             <artifactId>spring-boot-starter-test</artifactId>  
  35.             <scope>test</scope>  
  36.         </dependency>  
  37.         <!-- 添加mysql-->  
  38.         <dependency>  
  39.             <groupId>org.springframework.boot</groupId>  
  40.             <artifactId>spring-boot-starter-jdbc</artifactId>  
  41.         </dependency>  
  42.         <dependency>  
  43.             <groupId>mysql</groupId>  
  44.             <artifactId>mysql-connector-java</artifactId>  
  45.             <scope>runtime</scope>  
  46.         </dependency>  
  47.         <dependency>  
  48.             <groupId>org.springframework.boot</groupId>  
  49.             <artifactId>spring-boot-starter-data-jpa</artifactId>  
  50.         </dependency>  
  51.         <!-- 添加thymeleaf-->  
  52.         <dependency>  
  53.             <groupId>org.springframework.boot</groupId>  
  54.             <artifactId>spring-boot-starter-thymeleaf</artifactId>  
  55.         </dependency>  
  56.         <dependency>  
  57.             <groupId>org.thymeleaf</groupId>  
  58.             <artifactId>thymeleaf</artifactId>  
  59.         </dependency>  
  60.         <dependency>  
  61.             <groupId>org.thymeleaf</groupId>  
  62.             <artifactId>thymeleaf-spring4</artifactId>  
  63.         </dependency>  
  64.     </dependencies>  
  65.     <!--maven构建-->  
  66.     <build>  
  67.         <plugins>  
  68.             <plugin>  
  69.                 <groupId>org.springframework.boot</groupId>  
  70.                 <artifactId>spring-boot-maven-plugin</artifactId>  
  71.             </plugin>  
  72.         </plugins>  
  73.     </build>  
  74.   
  75. </project>  

历史上的今天:

发表评论


表情