Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-8700

Not able to enable swagger documentation when using spring-boot-kieserver

    Details

    • Fix Build:
      CR1
    • Steps to Reproduce:
      Hide

      1. added kieserver.swagger.enabled=true in application.properties file
      2. added below dependencies in pom.xml of business-application-service project:

      <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>swagger-ui</artifactId>
              <version>2.2.10</version>
          </dependency>
          <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
            <version>3.1.11</version>
          </dependency>
          <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-jaxrs</artifactId>
            <version>1.5.20</version>
            <exclusions>
              <exclusion>
                <groupId>javax.ws.rs</groupId>
                <artifactId>jsr311-api</artifactId>
              </exclusion>
            </exclusions>
      </dependency>
      

      When I try to access http://localhost:8090/rest/api-docs/?url=../swagger.json it fails with below exception:

      WARN 2252 --- [0.1-8090-exec-5] o.a.c.j.i.WebApplicationExceptionMapper  : javax.ws.rs.NotFoundException: HTTP 404 Not Found
          at org.apache.cxf.jaxrs.swagger.Swagger2Feature$SwaggerUIService.getResource(Swagger2Feature.java:437)
          at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
      . . .
      Caused by: java.io.FileNotFoundException: JAR entry META-INF/resources/webjars/swagger-ui/2.2.10/api-docs/lib/swagger-oauth.js not found in /NotBackedUp/BRMS/BPMS-7/RHPAM7.2/spring-boot/business-application/business-application-service/target/business-application-service-1.0-SNAPSHOT.jar!/BOOT-INF/lib/swagger-ui-2.2.10.jar
          at org.springframework.boot.loader.jar.JarURLConnection.throwFileNotFound(JarURLConnection.java:186)
          at org.springframework.boot.loader.jar.JarURLConnection.connect(JarURLConnection.java:105)
          at org.springframework.boot.loader.jar.JarURLConnection.getInputStream(JarURLConnection.java:170)
          at java.net.URL.openStream(URL.java:1038)
          at org.apache.cxf.jaxrs.swagger.Swagger2Feature$SwaggerUIService.getResource(Swagger2Feature.java:431)
          ... 93 more
      
      

      In the web console I can see, css files from swagger-ui-2.2.10.jar are loaded without any issue, but it failed to load js files. Take a look at attached screenshot. Debug enabled logs also attached.

      Show
      1. added kieserver.swagger.enabled=true in application.properties file 2. added below dependencies in pom.xml of business-application-service project: <dependency> <groupId>org.webjars</groupId> <artifactId>swagger-ui</artifactId> <version>2.2.10</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-rs-service-description-swagger</artifactId> <version>3.1.11</version> </dependency> <dependency> <groupId>io.swagger</groupId> <artifactId>swagger-jaxrs</artifactId> <version>1.5.20</version> <exclusions> <exclusion> <groupId>javax.ws.rs</groupId> <artifactId>jsr311-api</artifactId> </exclusion> </exclusions> </dependency> When I try to access http://localhost:8090/rest/api-docs/?url=../swagger.json it fails with below exception: WARN 2252 --- [0.1-8090-exec-5] o.a.c.j.i.WebApplicationExceptionMapper : javax.ws.rs.NotFoundException: HTTP 404 Not Found at org.apache.cxf.jaxrs.swagger.Swagger2Feature$SwaggerUIService.getResource(Swagger2Feature.java:437) at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) . . . Caused by: java.io.FileNotFoundException: JAR entry META-INF/resources/webjars/swagger-ui/2.2.10/api-docs/lib/swagger-oauth.js not found in /NotBackedUp/BRMS/BPMS-7/RHPAM7.2/spring-boot/business-application/business-application-service/target/business-application-service-1.0-SNAPSHOT.jar!/BOOT-INF/lib/swagger-ui-2.2.10.jar at org.springframework.boot.loader.jar.JarURLConnection.throwFileNotFound(JarURLConnection.java:186) at org.springframework.boot.loader.jar.JarURLConnection.connect(JarURLConnection.java:105) at org.springframework.boot.loader.jar.JarURLConnection.getInputStream(JarURLConnection.java:170) at java.net.URL.openStream(URL.java:1038) at org.apache.cxf.jaxrs.swagger.Swagger2Feature$SwaggerUIService.getResource(Swagger2Feature.java:431) ... 93 more In the web console I can see, css files from swagger-ui-2.2.10.jar are loaded without any issue, but it failed to load js files. Take a look at attached screenshot. Debug enabled logs also attached.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Not able to see Swagger documentation of the REST api as part of kie-server Spring Boot application.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  elguardian Enrique González Martínez
                  Reporter:
                  elguardian Enrique González Martínez
                  Tester:
                  Karel Suta
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: