[cdi-dev] Inconsistency in the spec regarding remote EJBs

Emily Jiang EMIJIANG at uk.ibm.com
Wed Jul 22 12:38:48 EDT 2015


>
>     Therefore, I am wondering why this behavior is a problem? AFAIK
>     all the CDI implementations pass this test and therefore there may 
(at
>     least in theory) be applications relying on this behavior.
>

I agree that we should not directly change the behaviour as we will break 
customers relying on this behaviour.

Many thanks,
Emily
===========================
Emily Jiang
WebSphere Application Server Liberty Profile development 
 
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN
Phone:  +44 (0)1962 816278  Internal: 246278

Email: emijiang at uk.ibm.com 
Lotus Notes: Emily Jiang/UK/IBM at IBMGB




From:   Jozef Hartinger <jharting at redhat.com>
To:     Antoine Sabot-Durand <antoine at sabot-durand.net>, cdi-dev 
<cdi-dev at lists.jboss.org>, 
Date:   20/07/2015 16:07
Subject:        Re: [cdi-dev] Inconsistency in the spec regarding remote 
EJBs
Sent by:        cdi-dev-bounces at lists.jboss.org





On 20.7.2015 16:24, Antoine Sabot-Durand wrote:
>
>
> Le lun. 20 juil. 2015 à 15:31, Jozef Hartinger <jharting at redhat.com
> <mailto:jharting at redhat.com>> a écrit :
>
>     As Martin explained, it is not the case that "remote EJBs are not 
CDI
>     beans".
>
>
> It's not written in black and white but in section 3.7 resources
> (http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#resources) ,  remote
> EJB are defined as resources and may can't be directly injected.
> So if remote EJB are beans EntityManager or Web Services are as well.

Section 3.7 talks about injecting *references* to resources. In case of 
remote EJBs and web services this would be clients (stubs) for accessing 
those components. This section does not say anything about the component 
definitions themselves.

>
>     Therefore, I am wondering why this behavior is a problem? AFAIK
>     all the CDI implementations pass this test and therefore there may 
(at
>     least in theory) be applications relying on this behavior.
>
>
> As said in my first mail, EJB spec sates (section 3.2.1)
>
> "The arguments and results of the methods of the remote business
> interface are passed by value."
>
> I may be wrong but the observer in in the remote EJB is called with
> arguments passed by reference. So we are violating EJB specification.
>
> So IMO we should do something about this. Because the original concern
> of Bill was about beans injected in remote method observer parameters
> and how they were copied.

I see. This is quite weird then.

>
> Any thought?
>
> Antoine
>
>
>     Jozef
>
>     On 16.7.2015 15:25, Antoine Sabot-Durand wrote:
>      > Hi guys,
>      >
>      >
>      > Bill Shanon, just pointed me to this test in TCK:
>      >
>      >
>     
https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java

>      >
>      > It tests the following assertion:
>      >
>      > "If the bean is a session bean, the observer method must be 
either a
>      > business method of the EJB or a static method of the bean class.”
>      >
>      > The EJB containing the observers for the test is:
>      >
>      >
>     
https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/Spitz.java

>      >
>      > The EJB contains one business method coming from a local
>     interface, one
>      > from a remote and one static method. the 3 are observers methods
>      >
>      > The test expects that the remote business observer method should
>     be called.
>      >
>      > Here we have an inconsistency IMO. By doing this we are violating
>     rules
>      > the CDI spec regarding the fact that remote EJBs are not CDI
>     beans. And
>      > we are calling this remote business method passing the event
>     payload by
>      > reference and not by value which violates EJB specification 
regarding
>      > remote EJB.
>      >
>      > I suggest that we change the assertion to:
>      >
>      > If the bean is a session bean, the observer method must be either 
a
>      > local business method of the EJB or a static method of the bean
>     class.
>      >
>      > and the TCK accordingly. Any thought ?
>      >
>      > Antoine
>      >
>      >
>      > _______________________________________________
>      > cdi-dev mailing list
>      > cdi-dev at lists.jboss.org <mailto:cdi-dev at lists.jboss.org>
>      > https://lists.jboss.org/mailman/listinfo/cdi-dev
>      >
>      > Note that for all code provided on this list, the provider
>     licenses the code under the Apache License, Version 2
>     (http://www.apache.org/licenses/LICENSE-2.0.html). For all other
>     ideas provided on this list, the provider waives all patent and
>     other intellectual property rights inherent in such information.
>      >
>
_______________________________________________
cdi-dev mailing list
cdi-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the 
code under the Apache License, Version 2 (
http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas 
provided on this list, the provider waives all patent and other 
intellectual property rights inherent in such information.

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150722/67d55c35/attachment-0001.html 


More information about the cdi-dev mailing list