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

Microprofile config doesn't work with version 8.0.0-M3 (plus) and higher.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.0.0-M3, 8.0.0-Final, 8.0.1
    • Fix Version/s: 8.0.4
    • Component/s: TomEE Core Server
    • Labels:
      None

      Description

      Steps to reproducing:

      1. Create a simple maven web project with JavaEE 8.0.1, microprofile config API 1.4, tomee 8.0.0-M2 (plus).
      2. Pom file dependencies block looks like this:

       

      <dependencies>
          <dependency>
              <groupId>javax</groupId>
              <artifactId>javaee-api</artifactId>
              <version>8.0.1</version>
              <scope>provided</scope>
          </dependency>
      
          <dependency>
              <groupId>org.eclipse.microprofile.config</groupId>
              <artifactId>microprofile-config-api</artifactId>
              <scope>provided</scope>
              <version>1.4</version>
          </dependency>
      </dependencies>

       

             3. In the pom file maven plugin configuration set up:

       

      <tomeeClassifier>plus</tomeeClassifier>

       

             4. Add java class with a field:

       

       @Inject
       @ConfigProperty (name = "injected.value")
       private String injectedValue;

       

             5. Add correct microprofile-config.properties.

             6. Run the project with command "mvn clean package tomee:run".

      After the project was run we got error like this:

       

      org.apache.webbeans.exception.WebBeansDeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.lang.String] is not found with the qualifiers 
      Qualifiers: [@javax.enterprise.inject.Default()]
      for injection into Field Injection Point, field name :  injectedValue, Bean Owner : [ConfigTestController, WebBeansType:MANAGED, Name:null, API Types:[us.vitali.test.config.ConfigTestController,java.lang.Object], Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]

       

      With my test project can be downloaded by URL: https://github.com/velc0m/mp-test.git

      But:

      1.  if we make changes in the pom file <tomeeClassifier> from PLUS to MICROPROFILE. (<tomeeClassifier>microprofile</tomeeClassifier>). It works correctly with any version of tomee from 8.0.0-M2 and higher.

       

      2. If we apply the next changes in the pom file (with PLUS tomeeClassifier):

              exclude this section:

      <dependency> 
         <groupId>org.eclipse.microprofile.config</groupId> 
         <artifactId>microprofile-config-api</artifactId>
         <scope>provided</scope>
         <version>1.4</version>
      </dependency>
      

              and include this one:

      <dependency>
          <groupId>org.apache.geronimo.config</groupId>
          <artifactId>geronimo-config-impl</artifactId>
          <version>1.2.2</version>
      </dependency>
      

      then it works only with 8.0.0-M2 version and doesn't with higher versions.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              velc0m Vitali Litvinenka
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: