19

enter image description hereI have a requirement to upgrade the existing code which runs on jdk 8 to jdk 11 After upgrading it the controller mappings are not showing up during startup.In this application we have defined some inbound gateways for integration and we have also defined few rest controllers, They where getting logging when it was on jdk 1.8 but they are not getting logged after i upgraded.Is there any way those logs are printed. we are using spring boot 2.1.0 Release, jdk 11 spring integration. The first image is the the code running on the jdk 8 and the second image is the one running on jdk 11. Here is pomfile which we are using http://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

Sid
  • 255
  • 2
  • 12
  • Are the API accessible? – NiVeR Nov 15 '18 at 21:02
  • And how does it look, please, on JDK 1.8? Would be also great that your insert logs as a formatted code. Thanks – Artem Bilan Nov 15 '18 at 21:08
  • The API's are accessible the only thing is they are not logging at startup. Here is the screenshot of previous version startup log which was running in jdk1.8. I'm running the previous version of code in 8090 port. – Sid Nov 15 '18 at 22:18
  • Do you upgrade only JDK or Spring Boot version as well? What you show doesn’t make to much sense if it doesn’t fail – Artem Bilan Nov 16 '18 at 00:03
  • yes we did upgrade the spring boot 2.0.4.RELEASE to 2.1.0.RELEASE – Sid Nov 16 '18 at 00:38

1 Answers1

21

If you also upgrade Spring Boot, which means all other dependencies in your project as well, then you can’t compare apples with apples since it is already not just Java switching.

Looks like starting with version 5.1 Spring Framework doesn’t log those endpoints under INFO. Consider to configure DEBUG for the org.springframework.web category and you’ll them again.

Your problem was that you didn’t share with us important information about dependencies version mismatch...

UPDATE

Sorry, it must be TRACE. This is a relevant piece of code from the AbstractHandlerMethodMapping:

if (logger.isTraceEnabled()) {
            logger.trace("Mapped " + methods.size() + " handler method(s) for " + userType + ": " + methods);
        }
Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • I have updated my post with the latest pomfile which we are using and do i need to specify this property in my property file org.springframework.web=DEBUG. When i specify i'm getting unknown property – Sid Nov 16 '18 at 15:29
  • @Sid logging.level.= where level is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, or OFF. The root logger can be configured by using logging.level.root. https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html – PeterMmm Nov 16 '18 at 15:39
  • I have added this configuration but i still dont see any mapping logs spring.profiles.active=dev server.port=8080 logging.level.org.springframework.web=DEBUG – Sid Nov 16 '18 at 15:59
  • 3
    See an UPDATE in my answer. It must be `TRACE` now – Artem Bilan Nov 16 '18 at 16:33
  • 12
    @ArtemBilan This was driving me mad. Thank you. FWIW: What worked for me: `logging.level.org.springframework.web.servlet.mvc.method.annotation=TRACE` – JL_SO Jan 05 '19 at 22:46
  • For SB v2.1.4-RELEASE: `logging.level.org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping=TRACE` – Ronak Patel May 07 '19 at 14:21
  • @JL_SO Your hint in your comment worked for me. If you post it as an answer, I'll vote it up. – Matthias M Dec 09 '19 at 10:38