| The problem is that a client proxy created for your DatabaseConnection producer (defined at https://github.com/natros/weld-cce/blob/master/src/main/java/com/gitgub/natros/DbTest.java#L67) does not implement JdbcConnection. 1. Why client proxy - because the producer method is @ApplicationScoped, see also http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#client_proxies 2. Why doesn't the proxy implement JdbcConnection? In general, a client proxy implements/extends some or all of the bean types of a bean. In Weld, it usually implements/extends all the bean types of a bean. But in this case, the bean types of getDatabaseConnection() are [Object, DatabaseConnection]. See also http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#producer_method_types. 3. How to fix that? If possible change the return type of the getDatabaseConnection() producer method to JdbcConnection. |