You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Daniel Dias (Jira)" <ji...@apache.org> on 2020/11/17 15:19:00 UTC
[jira] [Commented] (TOMEE-2799) Microprofile config doesn't work
with version 8.0.0-M3 (plus) and higher.
[ https://issues.apache.org/jira/browse/TOMEE-2799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17233657#comment-17233657 ]
Daniel Dias commented on TOMEE-2799:
------------------------------------
the problem is an version old of Tomee .
In version 8.0.4 work fine .
for the plus and plume version to work, you must include the following property in *system.properties*:
another way is using the tomee plugin and adding this property in pom.xml :
{{}}
{code:java}
<systemVariables>
<tomee.mp.scan>all</tomee.mp.scan>
</systemVariables>{code}
{{}}
reference
[https://stackoverflow.com/questions/60932960/tomeemicroprofile-unsatisfiedresolutionexception]
> 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.0-M3, 8.0.0-Final, 8.0.1
> Reporter: Vitali Litvinenka
> Priority: Major
>
> 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)