小编典典

启动时未映射控制器映射

spring-boot

我需要将在jdk 8上运行的现有代码升级到jdk11,升级后在启动期间不会显示控制器映射。在此应用程序中,我们定义了一些入站网关进行集成,还定义了一些剩余控制器,他们在jdk1.8上获得日志记录,但在我升级后没有得到日志记录。这些记录是否有任何打印方式。我们正在使用spring boot 2.1.0 Release,jdk 11进行spring集成。第一个映像是在jdk 8上运行的代码,第二个映像是在jdk11上运行的代码。这是我们正在使用http://maven.apache.org/xsd/maven-4.0.0.xsd的pomfile。 “> 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 descriptionhere


阅读 207

收藏
2020-05-30

共1个答案

小编典典

如果您还升级了Spring Boot,这也意味着项目中的所有其他依赖项,那么您就不能将apples与apples进行比较,因为它已经不仅仅是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);
        }
2020-05-30