Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-4295

tomee-embedded-maven-plugin does not register microprofile endpoints

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 9.1.2
    • 10.0.0-M1, 9.1.3
    • None
    • None

    Description

      See this example pom.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
      
          <groupId>org.example</groupId>
          <artifactId>tomee-embedded-mp</artifactId>
          <version>1.0-SNAPSHOT</version>
          <packaging>war</packaging>
      
          <pluginRepositories>
                  <pluginRepository>
                  <id>apache-snapshots</id>
                  <url>https://repository.apache.org/snapshots/</url>
                  <releases>
                      <enabled>false</enabled>
                  </releases>
                  <snapshots>
                      <enabled>true</enabled>
                  </snapshots>
              </pluginRepository>
          </pluginRepositories>
      
      
          <properties>
              <maven.compiler.source>17</maven.compiler.source>
              <maven.compiler.target>17</maven.compiler.target>
      
              <tomee.version>9.1.3-SNAPSHOT</tomee.version>
          </properties>
      
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.tomee.maven</groupId>
                      <artifactId>tomee-embedded-maven-plugin</artifactId>
                      <version>${tomee.version}</version>
      
                      <configuration>
                          <containerProperties>
                              <tomee.mp.scan>true</tomee.mp.scan>
                          </containerProperties>
                      </configuration>
      
                      <dependencies>
                          <dependency>
                              <groupId>org.apache.tomee</groupId>
                              <artifactId>mp-common</artifactId>
                              <version>${tomee.version}</version>
                          </dependency>
                      </dependencies>
                  </plugin>
              </plugins>
          </build>
      </project>
      

      No endpoints are logged in TomEE 9.1.2 (and 9.1.3-SNAPSHOT as well as 10.0.0-M1-SNAPSHOT), trying to access those paths results in a 404

       

      When deploying this .war to a normal TomEE microprofile build these endpoints are being registered: 

      30-Jan-2024 12:53:28.542 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints REST Application: http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/               -> org.apache.openejb.server.rest.InternalApplica
      tion@208185c0
      
      30-Jan-2024 12:53:28.544 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints      Service URI: http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/health         -> Pojo org.apache.tomee.microprofile.health.Micr
      oProfileHealthChecksEndpoint
      
      30-Jan-2024 12:53:28.544 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/health         ->      Response getChecks()        
      30-Jan-2024 12:53:28.544 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/health/live    ->      Response getLiveChecks()    
      30-Jan-2024 12:53:28.544 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/health/ready   ->      Response getReadyChecks()   
      30-Jan-2024 12:53:28.544 INFO [main] org.apache.openejb.server.cxf.rs.CxfRsHttpListener.logEndpoints               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/health/started ->      Response getStartedChecks()
      
       

       

      For comparison, this is being registered in TomEE 8.0.16:

      [INFO] REST Application: http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/                            -> org.apache.openejb.server.rest.InternalApplication@4928a347
      
      [INFO]      Service URI: http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/health                      -> Pojo org.apache.geronimo.microprofile.impl.health.cdi.CdiHealthChecksEndpoint
      
      [INFO]               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/health                      ->      Response getChecks()
      
      [INFO]      Service URI: http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics                     -> Pojo org.apache.geronimo.microprofile.metrics.jaxrs.CdiMetricsEndpoints       
      [INFO]               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics                     ->      Object getJson(SecurityContext, UriInfo)                     
      [INFO]               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics                     ->      String getText(SecurityContext, UriInfo)                     
      [INFO]               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics/{registry}          ->      Object getJson(String, SecurityContext, UriInfo)             
      [INFO]               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics/{registry}          ->      String getText(String, SecurityContext, UriInfo)             
      [INFO]               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics/{registry}/{metric} ->      Object getJson(String, String, SecurityContext, UriInfo)     
      [INFO]               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics/{registry}/{metric} ->      String getText(String, String, SecurityContext, UriInfo)     
      [INFO]           OPTIONS http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics/{registry}          ->      Object getMetadata(String, SecurityContext, UriInfo)         
      [INFO]           OPTIONS http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/metrics/{registry}/{metric} ->      Object getMetadata(String, String, SecurityContext, UriInfo)
      
      [INFO]      Service URI: http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/openapi                     -> Pojo org.apache.geronimo.microprofile.openapi.jaxrs.OpenAPIEndpoint           
      [INFO]               GET http://localhost:8080/tomee-embedded-mp-1.0-SNAPSHOT/openapi                     ->      OpenAPI get()
       

      Attachments

        Activity

          People

            jungm Markus Jung
            jungm Markus Jung
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 50m
                50m