gpt4 book ai didi

java - Controller 映射未在启动时记录

转载 作者:搜寻专家 更新时间:2023-10-31 19:59:29 24 4
gpt4 key购买 nike

enter image description here我需要将在 jdk 8 上运行的现有代码升级到 jdk 11他们在 jdk 1.8 上时获取日志记录,但在我升级后他们没有获取日志记录。是否有任何方式打印这些日志。我们正在使用 spring boot 2.1.0 Release,jdk 11 spring 集成。第一张图片是在 jdk 8 上运行的代码,第二张图片是在 jdk 11 上运行的代码。这是我们正在使用的 pomfilehttp://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>com.oms.integration</groupId>
<artifactId>oms-integration</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>oms-integration</name>
<description>Integration between OMS and other systems</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-http</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-xml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.5</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.version}</release>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

enter image description here

最佳答案

如果您还升级了 Spring Boot,这意味着您的项目中的所有其他依赖项也将随之升级,那么您不能将苹果与苹果进行比较,因为它已经不仅仅是 Java 切换。

看起来从 5.1 版开始,Spring Framework 不会在 INFO 下记录这些端点。考虑为 org.springframework.web 类别配置 DEBUG,您将再次使用它们。

您的问题是您没有与我们分享有关依赖项版本不匹配的重要信息...

更新

抱歉,必须是 TRACE。这是 AbstractHandlerMethodMapping 中的一段相关代码:

if (logger.isTraceEnabled()) {
logger.trace("Mapped " + methods.size() + " handler method(s) for " + userType + ": " + methods);
}

关于java - Controller 映射未在启动时记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53327836/

24 4 0
文章推荐: java - Spring Data JDBC是否支持自定义类型转换器
文章推荐: java - 即使显式提供了模块路径,Eclipse 也找不到模块
文章推荐: java - Scala List[Int] 在 Java 中变成 List