Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-3406

JAX-RS on SpringBoot generated code is missing Application registration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Critical
    • 1.1.0.Final
    • 0.15.0
    • Core Engine
    • None
    • False
    • False
    • Undefined
      • Register the application and set a base path like "kogito". The problem is that now every resource we generate must start with kogito, that fails on the "domain first" premise.
    • Hide

      Just use any SpringBoot example from our repo

      Show
      Just use any SpringBoot example from our repo
    • ---
    • ---

    Description

      Right now, we rely on JAX-RS generated code for SpringBoot, the recommended implementation is RestEasy, which is causing a major impact when serving static content in a custom Kogito service. From the logs we can see the following:

      2020-09-22 11:52:07.303  INFO 20730 --- [           main] j.r.s.ResteasyEmbeddedServletInitializer : No JAX-RS Application classes have been found. A default, one mapped to '/', will be registered.
      

      This is related to the Application registration: https://github.com/resteasy/resteasy-spring-boot/blob/master/mds/USAGE.md#jax-rs-application-registration-methods

      Which we are not generating.

      If we try to fetch for the swagger.json file, it fails:

      ❯ curl -v localhost:8080/swagger.json
      *   Trying ::1:8080...
      * Connected to localhost (::1) port 8080 (#0)
      > GET /swagger.json HTTP/1.1
      > Host: localhost:8080
      > User-Agent: curl/7.69.1
      > Accept: */*
      > 
      * Mark bundle as not supporting multiuse
      < HTTP/1.1 404 
      < Vary: Origin
      < Vary: Access-Control-Request-Method
      < Vary: Access-Control-Request-Headers
      < Content-Type: text/html;charset=UTF-8
      < Content-Length: 89
      < Date: Tue, 22 Sep 2020 14:52:14 GMT
      < 
      * Connection #0 to host localhost left intact
      RESTEASY003210: Could not find resource for full path: http://localhost:8080/swagger.json%  
      

      RestEasy has taken over all the paths and is not handling it over to the underlying SpringBoot MVC implementation, meaning no static files being served, nor any other custom endpoint an user might have in their application.

      Attachments

        Issue Links

          Activity

            People

              tdolphin-1 Tiago Dolphine
              rhn-support-zanini Ricardo Zanini Fernandes
              Marian Macik Marian Macik
              Marian Macik Marian Macik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: