<div dir="ltr">Yes Tomas I agree, I think it should be detected automatically by the container so it&#39;s good to update 10.4.2 accordingly. <span style="font-size:13.1999998092651px;line-height:19.7999992370605px">The assertion you mentioned match this test in the TCK:</span><div><br class="Apple-interchange-newline"><span style="font-size:13.1999998092651px;line-height:19.7999992370605px"><a href="https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java">https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java</a></span><span style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></span></div><div><span style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></span></div><div><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">It&#39;s more straight forward to work there IMO.</span><div><br></div><div>Romain, I don&#39;t understand when you write &quot;<span style="font-size:13.1999998092651px;line-height:19.7999992370605px">That said not being able to fix it in EJB spec&quot;. It&#39;s not an EJB spec issue but a CDI issue. </span></div><div><br></div><div>Antoine</div></div></div><br><div class="gmail_quote"><div dir="ltr">Le jeu. 16 juil. 2015 à 16:05, Romain Manni-Bucau &lt;<a href="mailto:rmannibucau@gmail.com">rmannibucau@gmail.com</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">hmm, this always has been an issue for me since CDI shouldnt know about these methods at all so how could it specify anything? That said not being able to fix it in EJB spec I tend to agree with Tomas.</div><div class="gmail_extra"></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br><span style="font-size:small">Romain Manni-Bucau</span><br><a href="https://twitter.com/rmannibucau" target="_blank">@rmannibucau</a> |  <a href="http://rmannibucau.wordpress.com" target="_blank">Blog</a> | <a href="https://github.com/rmannibucau" target="_blank">Github</a> | <a href="https://www.linkedin.com/in/rmannibucau" target="_blank">LinkedIn</a> | <a href="http://www.tomitribe.com" target="_blank">Tomitriber</a></div></div></div></div></div></div></div></div></div></div></div><div class="gmail_extra">
<br><div class="gmail_quote">2015-07-16 15:56 GMT+02:00 Tomas Remes <span dir="ltr">&lt;<a href="mailto:tremes@redhat.com" target="_blank">tremes@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi,<br>
<br>
I agree. Shouldn&#39;t we specify what happens in opposite case? Or maybe better to update following in &quot;10.4.2. Declaring an observer method&quot; as well:<br>
<br>
&quot;If a non-static method of a session bean class has a parameter annotated @Observes, and the method is not a business method of the EJB, the container automatically detects the problem and treats it as a definition error.&quot;<br>
<br>
Tom<br>
<span><br>
----- Original Message -----<br>
From: &quot;Antoine Sabot-Durand&quot; &lt;<a href="mailto:antoine@sabot-durand.net" target="_blank">antoine@sabot-durand.net</a>&gt;<br>
To: &quot;cdi-dev&quot; &lt;<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a>&gt;<br>
Sent: Thursday, July 16, 2015 3:25:40 PM<br>
Subject: [cdi-dev] Inconsistency in the spec regarding remote EJBs<br>
<br>
Hi guys,<br>
<br>
<br>
Bill Shanon, just pointed me to this test in TCK:<br>
<br>
<a href="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" rel="noreferrer" target="_blank">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</a><br>
<br>
</span><span>It tests the following assertion:<br>
<br>
&quot;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.”<br>
<br>
The EJB containing the observers for the test is:<br>
<br>
<a href="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" rel="noreferrer" target="_blank">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</a><br>
<br>
</span><span>The EJB contains one business method coming from a local interface, one from a remote and one static method. the 3 are observers methods<br>
<br>
The test expects that the remote business observer method should be called.<br>
<br>
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.<br>
<br>
I suggest that we change the assertion to:<br>
<br>
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.<br>
<br>
and the TCK accordingly. Any thought ?<br>
<br>
Antoine<br>
<br>
</span>_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
<br>
<br>
<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.</blockquote></div><br></div></blockquote></div>