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.
There's the following code in \enterprise\compapp\projectjbi\src\org\netbeans\modules\compapp\javaee\sunresources\ResourceAggregator.java : ... public void addResource(FileObject fo) throws Exception { Resources inputResources = (Resources) unmarshaller.unmarshal(fo.getInputStream()); ^^^^^^^^^^^^^^^^^^^ ... I'm not sure if this really a bug here, but we had similar code in BPEL project which was causing a bug 87550 (Sometimes BPEL Project can not be saved). The problem is that fo.getInputStream() puts a read-lock on a file, so it's not possible to modify the file until/unless you explicitly close the InputStream OR it gets closed as a part of garbage collecting (there's a call to close() in finalize()). So, it's always better to explicitly close the stream to avoid misleading behavior.
Girish, there are also a few other instances of unclosed input/outputstream in compapp/javaee.
Fixed. Change log: Log: 109008: Make sure to close all InputStreams and OutputStreams are closed in comp app/javaee code. Also remove unused util classes. Removed: enterprise/compapp/projectjbi/src/org/netbeans/jbi/javeeese/util/ProjectUtil.java enterprise/compapp/projectjbi/src/org/netbeans/jbi/javeeese/util/JavaEEProjectFactory.java Modified: enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/sunresources/tool/archive/ApplicationArchive.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/sunresources/tool/archive/FileUtil.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/sunresources/tool/archive/EJBArchive.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/sunresources/tool/archive/SunResourcesDDJaxbHandler.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/codegen/model/WebappProject.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/codegen/model/AbstractProject.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/util/ProjectUtil.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/util/JavaEEProjectFactory.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/sunresources/ResourceAggregator.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/annotation/handler/JarClassFileLoader.java enterprise/compapp/projectjbi/src/org/netbeans/modules/compapp/javaee/sunresources/tool/graph/JAXBHandler.java