When running a NB Platform app on Windows 7, trying to reload a module with the "reload in target platform" does not work in current dev builds. Instead, a new test-instance is always started from scratch.
Steps to reproduce:
1. create new NB Platform app
2. add one module to the app
3. select "reload in target platform" menu item from the module (regardless if changes are made to the module sources)
It seems that the changes made to CliHandler in #193481 is what blocking module reloading right now. The issue is that the lock file in the suite project is now locked with NIO, which prevents the reload ant task from obtaining a RandomAccessFile, because of an IllegalAccessException, stating that a portion of the file is locked by another process.
I can't find a temporary workaround.
True, the lock file is not locked by NIO. I am not sure way shall that prevent creation of RandomAccessFile however. Btw. if the Ant task is trying to find out whether lock file is still "live", then it is now much easier: just find out if it can be locked - if so, it is not "live" anymore.
It's not an issue with Ant. The issue is that the CLIHandler in the new instance cannot read host and port information from the lock file (throws IllegalAccessException), thus preventing communication between the two instances causing reload in target platform to fail, and a new instance to fully start instead.
Right, this has nothing to do with any special Ant code AFAIK; the reload target simply runs the NB launcher in the usual way, on the same userdir, but with "--reload something.jar" on the command line. I don't have a copy of W7 to reproduce with, but if true, it would mean that e.g.
...\bin\netbeans --userdir c:\running\user\dir --open c:\some\file
(i.e. what is run by the NB shell association) would also fail.
On windows, when a process has FileLock on some file, other processes cannot read it! Yields IOException("The process cannot access the file because another process has locked a portion of the file"). This is different than on Unix! I want to lock the file and still allow anyone to read it, how can I do it on windows?
Fixed in ergonomics#3364ee25de93
Btw. propagation of fixes from ergonomics is blocked by bug 195029 and until that one is fixed (really fixed, not just marked invalid), ergonomics changes are not going to propagate.
Integrated into 'main-golden', will be available in build *201102090000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jaroslav Tulach <email@example.com>
Log: #194937: Windows llocks are mandatory - they prevent reading of the locked region. Lock just a single byte outside of the file's actual length
*** Bug 195403 has been marked as a duplicate of this bug. ***
(In reply to comment #4)
> On windows, when a process has FileLock on some file, other processes cannot
> read it! Yields IOException("The process cannot access the file because another
> process has locked a portion of the file"). This is different than on Unix! I
> want to lock the file and still allow anyone to read it, how can I do it on
That would be the DENYWRITE filemode... (0x20)
Was there any specific reasons not to include this fix in Beta 2?
No, I've just forgotten to do it. I can put it on some update center for beta2, if Marian tells me to do so.
No plan to do any patch for Beta 2, wait for final build, or just use dailies. The quality of dailies is going to rise, the stabilization phase already started.
Pity this was not a sign of comming "Multiple IDE windows" feature, which is sometimes the reason of our devs choosing IDEA instead of NetBeans (when leaving Eclipse for good)...