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.
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)
Created attachment 29341 [details] exception stack trace
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").
Sorry, correct order for the getRelativePath method's parameters is of course "message-destination-ref", "message-destination".
Sorry. I should have taking a closer look at that stack trace when I filed this.
Fix pending...
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".
Fixed. http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/config/ConfigBeanStorage.java?r1=1.3.6.2.2.1&r2=1.3.6.2.2.2
Fixed in release55_beta branch. http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/config/ConfigBeanStorage.java?r1=1.3.6.2.2.1&r2=1.3.6.2.2.1.6.1
verified in release55_beta