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 170370 - java.io.FileNotFoundException: D:\dev\epc\epclib\nblibraries-private.properties (Le processus ne peut pas acc�der au fichier car ce fichier est utilis� par un autre processus)
Summary: java.io.FileNotFoundException: D:\dev\epc\epclib\nblibraries-private.properti...
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milan Kubec
URL: http://statistics.netbeans.org/except...
Keywords:
: 172096 177694 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-14 13:01 UTC by ymajoros
Modified: 2009-11-26 18:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 79073


Attachments
stacktrace (1.83 KB, text/plain)
2009-08-14 13:02 UTC, ymajoros
Details
diff (3.11 KB, text/plain)
2009-09-24 12:33 UTC, Milan Kubec
Details
another version of diff (4.44 KB, text/plain)
2009-09-25 08:42 UTC, Milan Kubec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ymajoros 2009-08-14 13:01:48 UTC
Build: NetBeans IDE 6.7 (Build 200906241340)
VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Windows XP, 5.1, x86

Stacktrace: 
java.io.FileNotFoundException: D:\dev\epc\epclib\nblibraries-private.properties (Le processus ne peut pas acc�der au fichier car ce fichier est utilis� par un autre processus)
        at java.io.FileInputStream.open(FileInputStream.java:0)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at org.netbeans.modules.project.ant.ProjectLibraryProvider.loadProperties(ProjectLibraryProvider.java:433)
        at org.netbeans.modules.project.ant.ProjectLibraryProvider.access$400(ProjectLibraryProvider.java:99)
        at org.netbeans.modules.project.ant.ProjectLibraryProvider$Definitions.properties(ProjectLibraryProvider.java:379)
        at org.netbeans.modules.project.ant.ProjectLibraryProvider$1PP.getProperties(ProjectLibraryProvider.java:852)
Comment 1 ymajoros 2009-08-14 13:02:04 UTC
Created attachment 86239 [details]
stacktrace
Comment 2 Exceptions Reporter 2009-08-14 13:02:51 UTC
This issue already has 14 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=79073
Comment 3 Milan Kubec 2009-09-14 11:55:49 UTC
*** Issue 172096 has been marked as a duplicate of this issue. ***
Comment 4 Milan Kubec 2009-09-24 12:33:59 UTC
Created attachment 88280 [details]
diff
Comment 5 Milan Kubec 2009-09-24 12:34:30 UTC
Jesse, could you review the diff, please. Thanks.
Comment 6 Jesse Glick 2009-09-24 14:28:09 UTC
-load-private-libraries, rather than -init-libraries, should express the dependency on -pre-init-libraries.

The diff won't work if there is more than one <definitions>. (This is why I did not just do the equivalent of your patch
when initially writing this!) You can create multiple copies of -pre-init-libraries, private.properties.available, and
-load-private-libraries parametrized by {position()}. Good XSLT practice I guess.

Don't forget that several project types have the same code:

j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/build-impl.xsl
j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/resources/build-impl.xsl
j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/resources/build-impl.xsl
javacard.project/src/org/netbeans/modules/javacard/resources/build-impl.xsl
java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl
web.project/src/org/netbeans/modules/web/project/resources/build-impl.xsl
contrib/scala.project/src/org/netbeans/modules/scala/project/resources/build-impl.xsl
Comment 7 Milan Kubec 2009-09-24 14:41:33 UTC
Hmm, I had bad feeling from the code too, that's why I asked for review.

But I'm wondering why there was for-each iteration when xsd file says:

<xsd:element name="libraries">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="definitions" minOccurs="0" maxOccurs="1" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

Really all those projects support sharable libraries?
Comment 8 Jesse Glick 2009-09-24 14:47:42 UTC
I was unaware that <definitions> specifies maxOccurs="1". Perhaps this was added after I ceased to work on sharable
libraries (but the for-each was never updated). If each project type says there can be only one <definitions>, then you
could dispense with for-each and use a simple xsl:choose depending on whether it exists or not.

"Really all those projects support sharable libraries?" - javacard was a false match. The others seem to. Check for
yourself.
Comment 9 Milan Kubec 2009-09-25 08:42:22 UTC
Created attachment 88334 [details]
another version of diff
Comment 10 Milan Kubec 2009-09-25 08:43:55 UTC
Jesse, please could you review new version of the patch? I'm just not sure about use of position() now when there is no
iteration.
Comment 11 Jesse Glick 2009-09-25 13:20:28 UTC
Well if there is only one <definitions> then position() would by definition always be 1, so ".{position()}" can be
deleted throughout this block.


As a matter of style I would put -load-private-libraries between -pre-init-libraries and -init-libraries, to reflect the
execution order.


BTW whoever defined

  <xsd:element name="definitions" minOccurs="0" maxOccurs="1" type="xsd:string"/>

apparently did not realize that if there can be only one of them, then there is no purpose in having this subelement at
all, and you could just write

  <xsd:element name="libraries" type="xsd:string"/>

Too late now. I suppose if we ever want to support >1 <definitions> we can do so compatibly.
Comment 12 Milan Kubec 2009-09-29 11:59:20 UTC
Jesse, should also spec versions for affected modules be upgraded?
Comment 13 Jesse Glick 2009-09-29 14:49:41 UTC
You can increment spec versions if you like. They were just upgraded after 6.8 beta was branched, so the only people who
would be affected would be those who just downloaded a dev build and are now looking for updates on dev AU.
Comment 14 Milan Kubec 2009-09-30 11:00:42 UTC
Fixed for 

j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/resources/build-impl.xsl
j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/resources/build-impl.xsl 
j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/resources/build-impl.xsl 
java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl 
web.project/src/org/netbeans/modules/web/project/resources/build-impl.xsl

http://hg.netbeans.org/core-main/rev/90a9807244a0
Comment 15 Milan Kubec 2009-09-30 11:05:25 UTC
I've filed issue against scala support:

http://www.netbeans.org/issues/show_bug.cgi?id=173371
Comment 16 Quality Engineering 2009-10-01 17:25:17 UTC
Integrated into 'main-golden', will be available in build *200910010513* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/90a9807244a0
User: Milan Kubec <mkubec@netbeans.org>
Log: #170370: private shared libraries will be loaded only when prop file exists
Comment 17 Jesse Glick 2009-11-26 18:05:43 UTC
*** Bug 177694 has been marked as a duplicate of this bug. ***