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.
[#200605030200, jdk1.5.0] to reproduce: ------------- 1) create new EJB Module 2) open ejb-jar.xml 3) choose CMP Relationsships > Add ... 4) check 'Create CMR Field' 5) enter Field Name 6) click OK ERROR: IDE throws:
Created attachment 30225 [details] ArrayIndexOutOfBoundsException: 0
Peter, could you have a look at this? It seems that the problem is in EjbJarRoot (line 1216): } else if (CMR_FIELD_NAME_XPATH.equals(xpath)) { entity = bean.getChildBean("../../relationship-role-source/ejb-name")[0]; } In this case there is no ejb-name element in relationship-role-source.
Isn't this a validation bug on the part of the wizard? The user should not be able add a relationship when no entity beans are specified. If you validate ejb-jar.xml afterwards (ignore the enterprise-beans error), the new field is invalid.
By the way, probably should file a separate bug for this, but since it's requires this context I'll add it here. If, after adding this field, you then add a new Entity bean, come back to here and try to edit this field, you get the attach exception (see 2nd attachment, below.)
Created attachment 30258 [details] stack trace
You are right, it is a validation bug. That part is fixed in release55 branch now. Checking in CmpRelationshipsDialogHelper.java; /cvs/j2ee/ddloaders/src/org/netbeans/modules/j2ee/ddloaders/multiview/ CmpRelationshipsDialogHelper.java,v <-- CmpRelationshipsDialogHelper.java new revision: 1.26.2.2.2.1; previous revision: 1.26.2.2 done Checking in Bundle.properties; /cvs/j2ee/ddloaders/src/org/netbeans/modules/j2ee/ddloaders/multiview/Bundle. properties,v <-- Bundle.properties new revision: 1.24.8.2.2.2; previous revision: 1.24.8.2.2.1 done
Fixed in release55 branch. Checking in CmpRelationshipsDialogHelper.java; /cvs/j2ee/ddloaders/src/org/netbeans/modules/j2ee/ddloaders/multiview/ CmpRelationshipsDialogHelper.java,v <-- CmpRelationshipsDialogHelper.java new revision: 1.26.2.2.2.2; previous revision: 1.26.2.2.2.1 done Checking in Bundle.properties; /cvs/j2ee/ddloaders/src/org/netbeans/modules/j2ee/ddloaders/multiview/Bundle. properties,v <-- Bundle.properties new revision: 1.24.8.2.2.3; previous revision: 1.24.8.2.2.2 done
v.