I was having some trouble getting the proxy binding name and jndi lookup name 
to match for no-interface view beans in geronimo.  I made a couple changes that 
make it work but would appreciate review.

rev  950405  
container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java

Index: 
container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
===================================================================
--- 
container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
      (revision 950390)
+++ 
container/openejb-core/src/main/java/org/apache/openejb/config/JndiEncInfoBuilder.java
      (working copy)
@@ -205,7 +205,7 @@
             if (ref.getRefType() == EjbReference.Type.UNKNOWN) {
                 EnterpriseBeanInfo otherBean = 
ejbResolver.getEnterpriseBeanInfo(deploymentId);
                 if (otherBean != null) {
-                    if (otherBean.businessLocal.contains(ref.getInterface())) {
+                    if (otherBean.businessLocal.contains(ref.getInterface()) 
|| otherBean.ejbClass.equals(ref.getInterface())) {
                         ref.setRefType(EjbReference.Type.LOCAL);
                         jndiConsumer.getEjbRef().remove(ref);
                         jndiConsumer.getEjbLocalRef().add(new 
EjbLocalRef(ref));
@@ -432,7 +432,7 @@
     private EnterpriseBeanInfo getInterfaceBeanInfo(String moduleId, String 
interfaceClassName) {
         List<EjbJarInfo> ejbJars = appInfo.ejbJars;
         for (EjbJarInfo ejbJar : ejbJars) {
-            if (!ejbJar.moduleId.equals(moduleId)) continue;
+            if (!ejbJar.moduleId.equals(moduleId) && !(moduleId == null && 
appInfo.ejbJars.size() == 1)) continue;
 
             List<EnterpriseBeanInfo> enterpriseBeans = ejbJar.enterpriseBeans;
             for (EnterpriseBeanInfo enterpriseBean : enterpriseBeans) {


The first change says that if the ejb ref's interface is the same as the ejb 
class then it's an ejb-local-ref.  This seems consistent with no-interface-view 
beans being local-only (if I read the spec correctly).

The second change says that if there's only one module and you don't know the 
moduleId, then look in it.

thanks
david jencks

Reply via email to