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.

Bug 75874 - AIOOBE at ddloaders.multiview.RelationshipHelper$RelationshipRoleHelper.setCmrField():94
Summary: AIOOBE at ddloaders.multiview.RelationshipHelper$RelationshipRoleHelper.setCm...
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-03 17:55 UTC by Martin Schovanek
Modified: 2007-03-01 18:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ArrayIndexOutOfBoundsException: 0 (4.60 KB, text/plain)
2006-05-03 17:55 UTC, Martin Schovanek
Details
stack trace (2.82 KB, text/plain)
2006-05-05 02:42 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schovanek 2006-05-03 17:55:12 UTC
[#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:
Comment 1 Martin Schovanek 2006-05-03 17:55:40 UTC
Created attachment 30225 [details]
ArrayIndexOutOfBoundsException: 0
Comment 2 Erno Mononen 2006-05-04 14:33:14 UTC
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. 
Comment 3 _ pcw 2006-05-05 02:38:29 UTC
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.
Comment 4 _ pcw 2006-05-05 02:41:22 UTC
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.)
Comment 5 _ pcw 2006-05-05 02:42:19 UTC
Created attachment 30258 [details]
stack trace
Comment 6 Erno Mononen 2006-05-05 13:01:19 UTC
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
Comment 7 Erno Mononen 2006-05-09 15:46:42 UTC
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
Comment 8 Martin Schovanek 2007-03-01 18:28:19 UTC
v.