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.
I happened to be reading through DDProvider.java from package org.netbeans.modules.j2ee.dd.api.ejb, specifically the method getDDRoot(FileObject fo) (lines 112-138 as of this writing) and noticed some peculiarities I think should be checked out. 1. the following fragment synchronized (ddMap) { ejbJarProxy = getFromCache(fo); if (ejbJarProxy != null) { return ejbJarProxy; } } fo.addFileChangeListener(new DDFileChangeListener()); ejbJarProxy = DDUtils.createEjbJarProxy(fo.getInputStream()); putToCache(fo, ejbJarProxy); would appear to have a race condition wrt/ the replacement of the proxy in ddMap, since the put happens after the sychronization lock is given up. 2. It doesn't appear that the InputStream retrieved from the FileObject is ever closed. Similar problems exist for the DDProvider for app clients (org.netbeans.modules.j2ee.dd.api.client.DDProvider.java), application (org.netbeans.modules.j2ee.dd.api.application.DDProvider.java), and web (org.netbeans.modules.j2ee.dd.api.web.DDProvider.java). Normally I'd file this as a P2, but since I can't prove any of these issues, I left it at P3.
Some comments for whoever will fix this: > 1. see also method getDDRoot0(DDProviderDataObject) and issue 68064 > 2. I already ran into InputStream closing problem in issue 98316
Obsolete milestone, please reevaluate
The described problems still exist, should be doable for 6.0.
Fixed in trunk. Note that the web dd provider was already fixed. After having a second look at the unclosed file problem, I think it is not an issue in this particular method - please see org.xml.sax.InputSource. Checking in ejb/DDProvider.java; /cvs/j2ee/ddapi/src/org/netbeans/modules/j2ee/dd/api/ejb/DDProvider.java,v <-- DDProvider.java new revision: 1.24; previous revision: 1.23 done Checking in application/DDProvider.java; /cvs/j2ee/ddapi/src/org/netbeans/modules/j2ee/dd/api/application/DDProvider.java,v <-- DDProvider.java new revision: 1.12; previous revision: 1.11 done Checking in client/DDProvider.java; /cvs/j2ee/ddapi/src/org/netbeans/modules/j2ee/dd/api/client/DDProvider.java,v <-- DDProvider.java new revision: 1.8; previous revision: 1.7 done