openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Wellmann <hwellmann...@gmail.com>
Subject Bean types of EJBs with generic business interface
Date Tue, 13 Nov 2012 15:00:18 GMT
What are the CDI bean types of the following EJB:

@Stateless
public class CalculatorImpl implements Calculator<Integer>
{

    @Override
    public Integer add( Integer op1, Integer op2 )
    {
        return op1 + op2;
    }
}

public interface Calculator<T extends Number>
{
   T add(T op1, T op2);
}


Which of the following injection points can be satisfied with this bean:

a) @Inject Calculator<Integer> calculator;
b) @Inject Calculator calculator;


With GlassFish 3.1.2.2/Weld 1.1.8, both a) and b) resolve without problems.

With TomEE 1.5.1-SNAPSHOT/OWB 1.1.6, only b) resolves, and a) causes
the following messages:

15:50:54.776 [main] DEBUG o.a.w.container.InjectionResolver - Adding
resolved beans with key
[BeanCacheKey{type=org.ops4j.pax.exam.regression.javaee.ejb.Calculator<java.lang.Integer>,
path='null', qualifiers=@javax.enterprise.inject.Default(),
hashCode=-813701363}] to cache.
15:50:54.781 [main] ERROR unknown.jul.logger - CDI Beans module
deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type
[org.ops4j.pax.exam.regression.javaee.ejb.Calculator] is not found
with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Field Injection Point, field name :  calculator,
Bean Owner : [CalculatorClient, Name:null, WebBeans Type:MANAGED, API
Types:[org.ops4j.pax.exam.regression.javaee.ejb.CalculatorClient,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]

I'm not quite sure what the expected behaviour according to the CDI
spec should be. And assuming for the moment that GlassFish is correct,
I don't really know if this is an issue in OWB or TomEE or maybe
both...

Any explanations most welcome...

Best regards,
Harald

Mime
View raw message