From users-return-26547-apmail-tomee-users-archive=tomee.apache.org@tomee.apache.org Thu Mar 8 13:24:02 2018 Return-Path: X-Original-To: apmail-tomee-users-archive@www.apache.org Delivered-To: apmail-tomee-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 23D7517964 for ; Thu, 8 Mar 2018 13:24:02 +0000 (UTC) Received: (qmail 15070 invoked by uid 500); 8 Mar 2018 13:24:01 -0000 Delivered-To: apmail-tomee-users-archive@tomee.apache.org Received: (qmail 15025 invoked by uid 500); 8 Mar 2018 13:24:01 -0000 Mailing-List: contact users-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tomee.apache.org Delivered-To: mailing list users@tomee.apache.org Received: (qmail 15004 invoked by uid 99); 8 Mar 2018 13:24:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Mar 2018 13:24:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B0CE018034C for ; Thu, 8 Mar 2018 13:24:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.9 X-Spam-Level: * X-Spam-Status: No, score=1.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, HTML_OBFUSCATE_05_10=0.001, KAM_SHORT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 8WWlUt63Sbwm for ; Thu, 8 Mar 2018 13:23:57 +0000 (UTC) Received: from mail-yb0-f176.google.com (mail-yb0-f176.google.com [209.85.213.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7A6205F39C for ; Thu, 8 Mar 2018 13:23:56 +0000 (UTC) Received: by mail-yb0-f176.google.com with SMTP id n22-v6so310039ybg.2 for ; Thu, 08 Mar 2018 05:23:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=mFDj84sgZUEftXR5uQF5an07RtjD2pr27SdT6pIdBPs=; b=hraVL9N0dlbyMmzA04qYOHiEakmt45IEy6ohqDZEPCu6gIo0zzkKXh3HJtXnn2G5yx KiKeymlez2RSmBM+zq9X50pH0ubIRYzF11b2QDx+L50yuCEnjnw6bmCzfMRyia8xWUD6 86LlFrjbqGlVHYKPpW3E/xeytksqjARbg7toCdKZHsZ+03ahI0fA4RK9PhX0AtyECKpq 8VLurDLEEdpvEN8q7VR4lY3gF+yWAKIYy1mdeqcTERfsddOUoRb9P3sFdT1IxBO2DNSp 8gi0fLt6LLvsq52Wj5voBpNFnMw4IbiZU4RtdyiGp8jfTnOsZcMwSqatpdMVMAespewM czoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=mFDj84sgZUEftXR5uQF5an07RtjD2pr27SdT6pIdBPs=; b=HLIgNRnDRwMdQjyilL0PhsA+hhKW2Rm6mqP+XJmTE2w9MmrTzo7Aa70nELwft1JZrj 9SP/CixqqVGPyHMbpDsCYLpiNK6JArUvBnQFsT1GVb9pnmTO+BSsjXU0qV9U+qBWrcRX keJISCuJqbrG+KCofgaLT0vEyRIR38xbBnio6Kkr452fIZ1/EV5Flx2XfNkttOQr0YJj YIz/YAqaUt7hMS/m8W4LWmro7FXD/IvYb5uLnHMRACA3QOE5iJmIPoMUGy5has+JNEKl YO+IzMBXYCnYCK+Q/VPNsRAShB7raf2cjDoOsGc92E/iE34HfTyxpzaNhNPkMNXWbrOh 88wQ== X-Gm-Message-State: APf1xPBrfp4nnfzkoVGuCnAO76aabv2la78/kTsvi/6PgrR0mtuEzoct ia6E0ppfIyoi8ckATya0pzu7dVeBNJpCBbYWX2s= X-Google-Smtp-Source: AG47ELs0Qtv4l7wZjruBhtqn6wC/ilez3ydYZfjA0o3mSM3K9FLOv1ShXcKORvskfqHW3EiijjkyK3ZvM/f9ajriFis= X-Received: by 2002:a25:ab06:: with SMTP id u6-v6mr15955013ybi.88.1520515429101; Thu, 08 Mar 2018 05:23:49 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:8307:0:0:0:0:0 with HTTP; Thu, 8 Mar 2018 05:23:28 -0800 (PST) In-Reply-To: <1f0db64f-4f0e-8502-9662-1136dc8df30c@lit-transit.com> References: <80abaf87-49a9-29b1-3c40-9fd7b4e34ef0@lit-transit.com> <1f0db64f-4f0e-8502-9662-1136dc8df30c@lit-transit.com> From: Romain Manni-Bucau Date: Thu, 8 Mar 2018 14:23:28 +0100 Message-ID: Subject: Re: UnsatisfiedResolutionException with qualifiers -- what am I doing wrong? To: users@tomee.apache.org Content-Type: multipart/alternative; boundary="00000000000006f5850566e69685" --00000000000006f5850566e69685 Content-Type: text/plain; charset="UTF-8" yes, try reproducing it in a sample maybe Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn | Book 2018-03-08 14:20 GMT+01:00 Emmanuel Touzery < emmanuel.touzery@lit-transit.com>: > Hello, > > thank you for the answer! No, definitely it's not in the default > excludes. Already injecting bunch of things from that JAR. Also, the > interface is in a JAR, but the producer is in the main code of the app. And > it's the producer which can't be found. > From your answer I take it that it should work :-( > > emmanuel > > On 08/03/18 14:12, Romain Manni-Bucau wrote: > >> Hi Emmanuel, >> >> did you check your jar was not in the default excludes? (try renaming it >> "foo.jar" to test quickly) >> >> >> Romain Manni-Bucau >> @rmannibucau | Blog >> | Old Blog >> | Github < >> https://github.com/rmannibucau> | >> LinkedIn | Book >> > high-performance> >> >> >> 2018-03-08 13:32 GMT+01:00 Emmanuel Touzery < >> emmanuel.touzery@lit-transit.com>: >> >> Hello, >>> >>> I'm confused about a CDI error, I would expect this to work... What >>> am >>> I doing wrong? It's true otherwise that the interface is defined in >>> another >>> JAR than the producer but I wouldn't expect it to be a problem... >>> >>> At runtime I get: >>> >>> 08-Mar-2018 12:27:57.287 SEVERE [localhost-startStop-1] >>> org.apache.openejb.cdi.OpenEJBLifecycle.startApplication CDI Beans >>> module >>> deployment failed >>> org.apache.webbeans.exception.WebBeansDeploymentException: >>> javax.enterprise.inject.UnsatisfiedResolutionException: Api type [ >>> com.lecip.core.application.customer_profiles.CustomerProfile] is not >>> found with the qualifiers >>> Qualifiers: [@com.lecip.core.application.customer_profiles.CustomerConte >>> xt()] >>> for injection into Field Injection Point, field name : _customerProfile, >>> Bean Owner : [TmsAllFunctionalitiesProvider, WebBeansType:MANAGED, >>> Name:null, API Types:[java.lang.Object,com.le >>> cip.tms.tms_core.authorization.TmsAllFunctionalitiesProvider >>> ,com.lecip.core.authorization.AllFunctionalitiesProvider], >>> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise >>> .inject.Any]] >>> >>> Any ideas? >>> >>> --- beans.xml -- >>> >>> >>> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee >>> http://xmlns.jcp.org/xml/ns/javaee/beans_1_2.xsd" >>> version="1.2" bean-discovery-mode="all"> >>> >>> >>> -- CustomerContext.java -- >>> >>> @Qualifier >>> @Retention(RUNTIME) >>> @Target({TYPE, METHOD, FIELD, PARAMETER}) >>> public @interface CustomerContext {} >>> >>> -- CustomerProfileProducer.java -- >>> >>> public class CustomerProfileProducer { >>> @Produces >>> @CustomerContext >>> public CustomerProfile getCustomerProfile() { >>> return null; >>> } >>> } >>> >>> -- Injecting class -- >>> >>> @Inject @CustomerContext >>> CustomerProfile customerProfile; >>> >>> >>> > --00000000000006f5850566e69685--