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 <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-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 --
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
> 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">
> </beans>
>
> -- 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;
>
>
|