tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: no observer in remote interfaces
Date Thu, 01 Feb 2018 13:10:58 GMT
Repository: tomee
Updated Branches:
  refs/heads/fb_tomee8 ac1e695a8 -> c2f603d38


no observer in remote interfaces


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/c2f603d3
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/c2f603d3
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/c2f603d3

Branch: refs/heads/fb_tomee8
Commit: c2f603d388e99f956cd307ae2379ab027532cff1
Parents: ac1e695
Author: Romain Manni-Bucau <rmannibucau@gmail.com>
Authored: Thu Feb 1 14:10:43 2018 +0100
Committer: Romain Manni-Bucau <rmannibucau@gmail.com>
Committed: Thu Feb 1 14:10:51 2018 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/openejb/cdi/CdiPlugin.java   | 10 ++++++++--
 tck/cdi-embedded/src/test/resources/failing.xml           |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/c2f603d3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
index bdf7486..5a2042c 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
@@ -478,8 +478,14 @@ public class CdiPlugin extends AbstractOwbPlugin implements OpenWebBeansJavaEEPl
 
         for (final Map.Entry<ObserverMethod<?>, AnnotatedMethod<?>> m :
methods.entrySet()) {
             final Method method = m.getValue().getJavaMember();
-            if (!Modifier.isStatic(method.getModifiers()) && doResolveViewMethod(bean,
method) == null) {
-                throw new WebBeansConfigurationException("@Observes " + method + " neither
in the ejb view of ejb " + bean.getBeanContext().getEjbName() + " nor static");
+            if (!Modifier.isStatic(method.getModifiers())) {
+                final Method viewMethod = doResolveViewMethod(bean, method);
+                if (viewMethod == null) {
+                    throw new WebBeansConfigurationException(
+                            "@Observes " + method + " neither in the ejb view of ejb " +
bean.getBeanContext().getEjbName() + " nor static");
+                } else if (beanContext.getBusinessRemoteInterfaces().contains(viewMethod.getDeclaringClass()))
{
+                    throw new WebBeansConfigurationException(viewMethod + " observer is defined
in a @Remote interface");
+                }
             }
             if (m.getValue().getParameters().stream().anyMatch(p -> p.isAnnotationPresent(ObservesAsync.class)))
{
                 throw new WebBeansConfigurationException("@ObservesAsync " + method + " not
supported on EJB in CDI 2");

http://git-wip-us.apache.org/repos/asf/tomee/blob/c2f603d3/tck/cdi-embedded/src/test/resources/failing.xml
----------------------------------------------------------------------
diff --git a/tck/cdi-embedded/src/test/resources/failing.xml b/tck/cdi-embedded/src/test/resources/failing.xml
index 15aa7cc..836410d 100644
--- a/tck/cdi-embedded/src/test/resources/failing.xml
+++ b/tck/cdi-embedded/src/test/resources/failing.xml
@@ -39,7 +39,7 @@
     TODO these are tests we finally need to pass!
     -->
     <classes>
-      <class name="org.jboss.cdi.tck.tests.event.observer.context.async.enterprise.EnterpriseSecurityContextPropagationInAsyncObserverTest"
/>
+      <class name="org.jboss.cdi.tck.tests.event.broken.observer.remoteBusinessMethod.EJBObserverMethodRemoteBusinessMethodTest"
/>
     </classes>
   </test>
 </suite>


Mime
View raw message