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 73849 - NoSuchElementException when adding message destination entry to deployment descriptor
Summary: NoSuchElementException when adding message destination entry to deployment de...
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: Sun Solaris
: P2 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-21 22:41 UTC by _ pcw
Modified: 2006-05-02 15:12 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
exception stack trace (3.18 KB, text/plain)
2006-03-21 22:41 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pcw 2006-03-21 22:41:03 UTC
1. Create JavaEE5 Web project (most likely ejb and app client as well, btw)
2. Open web.xml in dd editor, xml page.
3. In the xml, after session-config entry, use code completion to add a
<message-destination> entry, e.g. type "<m", then pick from popup list.  I'm
sure you can key in the whole thing too if you want to, but this is faster.
4. Type the ">" required after code completion fills in the tag.
5. At this point you get the following trace (see attachment for complete stack):

java.util.NoSuchElementException: "-ref" not found in the property list:
MessageDestination
        at org.netbeans.modules.schema2beans.DDParser.<init>(DDParser.java:525)
        at
org.netbeans.modules.j2ee.sun.share.config.DDCommon.search(DDCommon.java:164)
        at
org.netbeans.modules.j2ee.sun.share.config.DDCommon.getChildrenImpl(DDCommon.java:131)
Comment 1 _ pcw 2006-03-21 22:41:28 UTC
Created attachment 29341 [details]
exception stack trace
Comment 2 Erno Mononen 2006-04-25 12:19:07 UTC
Problem seems to be in ConfigBeanStorage class rather than in dd editor. More 
specifically, in fireEvent method there is (line 120):

if (xpaths[i].startsWith(relPath)) {
  String targetPath = DDCommon.getRelativePath(xpaths[i], relPath);
  DDBean[] dds = eventDD.getChildBean(targetPath);
 ... 

This issue is caused by targetPath being "-ref" here (returned by 
getRelativePath which is called with "message-destination", "message-
destination-ref"). 
Comment 3 Erno Mononen 2006-04-25 12:22:28 UTC
Sorry, correct order for the getRelativePath method's parameters is of course 
"message-destination-ref", "message-destination".
Comment 4 _ pcw 2006-04-25 16:08:09 UTC
Sorry. I should have taking a closer look at that stack trace when I filed this.
Comment 5 _ pcw 2006-04-27 21:51:16 UTC
Fix pending...
Comment 6 _ pcw 2006-04-28 00:28:11 UTC
The bug is an incomplete attempt at matching the prefix of an xpath.  In order
to properly match a relative xpath as a prefix of another xpath, we must also
check that for incomplete matches (where xpath is longer than relpath), that
within xpath, immediately following the prefix, is a slash.

e.g. given xpaths "foo/bar" and "foofoo/bar" with relative path "foo", we want
to match the first example, but not the second because "foo" is not a prefix of
"foofoo/bar".
Comment 9 Jan Horvath 2006-05-02 15:12:56 UTC
verified in release55_beta