This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When creating an EJB project, use the same class but 2 different remote interfaces definitions for 2 session interfaces. In the Project view, enterprise Beans section the 2 session beans are displayed using the same name instead of using the names from the ejb-jar.xml <display-name> section. Example: ejb-jar.xml: ... <enterprise-beans> <session> <display-name>ChangeManagerSB</display-name> <ejb-name>ChangeManagerBean</ejb-name> <home>com.ri.cm.ChangeManagerRemoteHome</home> <remote>com.ri.cm.ChangeManagerRemote</remote> <ejb-class>com.ri.cm.ChangeManagerBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session> <session> <display-name>ApprovalManagerSB</display-name> <ejb-name>ApprovalManagerBean</ejb-name> <home>com.ri.cm.approval.ApprovalManagerRemoteHome</home> <remote>com.ri.cm.approval.ApprovalManagerRemote</remote> <ejb-class>com.ri.cm.ChangeManagerBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session> </enterprise-beans> In the Enterprose beans section of the project the "ChangeManagerSB" is displayed twice instead of "ChangeManaerSB" and "ApprovalManagerSB" as written in the <display-name> section of the session. To reproduce the issue, create session bean using the Wizard "new->" etc. Once created, - edit the ejb-jar.xml, xml file duplicate the <session></session> section. - change the <display-name>, <ejb-name>, <remote>, <home> sections, BUT keep the same <ejb-class> - Save The new name shall appear instead of a duplication of the initial EJB. This issue prevent to access the new Remote and Home interface from the "projects" view (right-click) sub menus of the new EJB.
Confirmed. The problem is that bean's class is used as ID of the bean. org.netbeans.modules.j2ee.ejbcore.ui.logicalview.ejb.session.SessionNode: public static SessionNode create(final String ejbClass, EjbJar ejbModule, Project project) { ClasspathInfo cpInfo = null; FileObject[] javaSources = ejbModule.getJavaSources(); if (javaSources.length > 0) { cpInfo = ClasspathInfo.create( ClassPath.getClassPath(javaSources[0], ClassPath.BOOT), ClassPath.getClassPath(javaSources[0], ClassPath.COMPILE), ClassPath.getClassPath(javaSources[0], ClassPath.SOURCE) ); } assert cpInfo != null; String ejbName = null; try { ejbName = ejbModule.getMetadataModel().runReadAction(new MetadataModelAction<EjbJarMetadata, String>() { public String run(EjbJarMetadata metadata) throws Exception { -----> Ejb ejb = metadata.findByEjbClass(ejbClass); return ejb == null ? null : ejb.getEjbName(); } }); } catch (IOException ioe) { Exceptions.printStackTrace(ioe); } if (ejbName == null) { return null; } else { return new SessionNode(new InstanceContent(), cpInfo, ejbClass, ejbName, ejbModule); } } org.netbeans.modules.j2ee.dd.api.ejb.EjbJarMetadata: public interface EjbJarMetadata { EjbJar getRoot(); Ejb findByEjbClass(String ejbClass); FileObject findResource(String resourceName); } I won't be easy to solve this issue, because only searching by bean's class is supported now... (API change?)
Not critical for 7.0
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. We apologize for any inconvenience. Thank you. The NetBeans Team