You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Vitali Litvinenka (Jira)" <ji...@apache.org> on 2020/04/01 11:17:00 UTC

[jira] [Created] (TOMEE-2799) Microprofile config doesn't work with version 8.0.0-M3 (plus) and higher.

Vitali Litvinenka created TOMEE-2799:
----------------------------------------

             Summary: Microprofile config doesn't work with version 8.0.0-M3 (plus) and higher.
                 Key: TOMEE-2799
                 URL: https://issues.apache.org/jira/browse/TOMEE-2799
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 8.0.1, 8.0.0-Final, 8.0.0-M3
            Reporter: Vitali Litvinenka


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

 
{code:java}
<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>{code}
 

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

 
{code:java}
<tomeeClassifier>plus</tomeeClassifier>{code}
 

       4. Add java class with a field:

 
{code:java}
 @Inject
 @ConfigProperty (name = "injected.value")
 private String injectedValue;{code}
 

       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:

 
{code:java}
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]]{code}
 

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:
{code:java}
<dependency> 
   <groupId>org.eclipse.microprofile.config</groupId> 
   <artifactId>microprofile-config-api</artifactId>
   <scope>provided</scope>
   <version>1.4</version>
</dependency>
{code}
        and include this one:
{code:java}
<dependency>
    <groupId>org.apache.geronimo.config</groupId>
    <artifactId>geronimo-config-impl</artifactId>
    <version>1.2.2</version>
</dependency>
{code}
then it works only with 8.0.0-M2 version and doesn't with higher versions.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)