Swager-ui is not working with spring boot 2.7.0 and java-17 with war file deploy tomcat 8.5

1.6k Views Asked by At

Deploying war file in tomcat 8.5 which is developed using java-17 and spring boot 2.7.2 and swagger2.0. After deploying swagger is not working. enter image description here

enter image description here

The above issue I am getting when run tomcat as a service.

If I run tomcat in interactive(command line) mode it is working fine.

Also when downgrade Java 17 -> 1.8 also swagger is working fine.

The local java version: enter image description here

And the below is my pom.xml file:

<properties>
    <java.version>17</java.version>
</properties>
<dependencies>
    <!-- Swagger2 -->
    <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.9.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.9.2</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>*</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>*</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>*</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Could you please give solution for run java-17 war file in tomcat 8.5 with swagger running. Thanks in advance.

0

There are 0 best solutions below