Index: src/main/java/com/sun/enterprise/deployment/EjbAbstractDescriptor.java =================================================================== --- src/main/java/com/sun/enterprise/deployment/EjbAbstractDescriptor.java (revision 40030) +++ src/main/java/com/sun/enterprise/deployment/EjbAbstractDescriptor.java (working copy) @@ -57,6 +57,8 @@ private Set remoteBusinessClassNames = new HashSet(); private Set localBusinessClassNames = new HashSet(); + private Set noInterfaceLocalBeanClassNames = new HashSet(); + // This is the value of the EJB 2.1 deployment descriptor entry // for service endpoint interface. @@ -157,7 +159,24 @@ public String getLocalClassName() { return localClassName; } - + + /** + * Add a classname for a no-interface view of the local ejb + * + * @param localClassName fully qualified class name for the interface + */ + public void addNoInterfaceLocalBeanClass(String className) { + this.noInterfaceLocalBeanClassNames.add(className); + } + + /** + * @return all the public classes of this no-interface local ejb + */ + public Set getNoInterfaceLocalBeanClasses() { + return this.noInterfaceLocalBeanClassNames; + } + + public void addRemoteBusinessClassName(String className) { remoteBusinessClassNames.add(className); } Index: src/main/java/org/glassfish/ejb/deployment/annotation/handlers/AbstractEjbHandler.java =================================================================== --- src/main/java/org/glassfish/ejb/deployment/annotation/handlers/AbstractEjbHandler.java (revision 40030) +++ src/main/java/org/glassfish/ejb/deployment/annotation/handlers/AbstractEjbHandler.java (working copy) @@ -529,10 +529,25 @@ (ejbClass.getAnnotation(javax.jws.WebService.class) == null)) ) ) { ejbDesc.setLocalBean(true); } + + //If this is a no-Interface local EJB, set all classes for this bean + if (ejbDesc.isLocalBean()) { + addNoInterfaceLocalBeanClasses(ejbDesc, ejbClass); + } + return getDefaultProcessedResult(); } + private void addNoInterfaceLocalBeanClasses(EjbDescriptor ejbDesc, Class ejbClass) { + Class nextClass = ejbClass; + //The session bean's no-interface view can be accessed via the bean class + //and all its super classes + while ((nextClass != Object.class) && (nextClass != null)) { + ejbDesc.addNoInterfaceLocalBeanClass(nextClass.getName()); + nextClass = nextClass.getSuperclass(); + } + } private Class getComponentIntfFromHome(Class homeIntf) { Class componentIntf = null; Index: src/main/java/com/sun/ejb/containers/EjbContainerServicesImpl.java =================================================================== --- src/main/java/com/sun/ejb/containers/EjbContainerServicesImpl.java (revision 40030) +++ src/main/java/com/sun/ejb/containers/EjbContainerServicesImpl.java (working copy) @@ -87,20 +87,25 @@ EjbDescriptor ejbDesc = container.getEjbDescriptor(); S businessObject = null; - + if (businessInterface != null) { String intfName = businessInterface.getName(); - if ((localObjectImpl != null) && ejbDesc.getLocalBusinessClassNames().contains(intfName)) { // Get proxy corresponding to this business interface. businessObject = (S) localObjectImpl.getClientObject(intfName); - } else if( ejbDesc.isLocalBean() && intfName.equals( ejbDesc.getEjbClassName() ) ) { - - businessObject = (S) localObjectImpl.getClientObject(ejbDesc.getEjbClassName()); - + } else if( ejbDesc.isLocalBean()) { + //If this is a no-interview of a local session bean, the bean + //can be accessed through interfaces in its superclass as well + boolean isValidBusinessInterface = + ejbDesc.getNoInterfaceLocalBeanClasses().contains(intfName); + if ((intfName.equals(ejbDesc.getEjbClassName())) + || isValidBusinessInterface) { + businessObject = (S) localObjectImpl.getClientObject(ejbDesc.getEjbClassName()); + } + } }