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.
Usually I don't have my Ant build script in the same directory as the source root but rather build.xml in the project root while the source root is something like src/java below. Both directories are mounted in the filesystems. On compile errors the Ant output shows something like "src\java\de\foo\bar\MyFile.java [41] ';' expected". This seems to be used for locating the corresponding file as is. Since it's found with this path from the mounted project root, it's opened from there - regardless of the fact that that filesystem is not enabled for compilation and the path does not match the package structure. Subsequently trying to run or debug MyFile results in a "NoClassDefFoundError: src/java/de/foo/bar/MyFile" Workaround is more or less obvious: putting the source root above the project root fixes this. My suggestion though would be to either check for a matching package/path or use only filesystems with compilation capability for compile errors, even if they come from the ant module. That way opening wrongly based and sometimes unnecessary duplicate editor windows wouldn't happen.
Problem seems to be in AntOutputParser.findFO; apparently no longer checks FileSystemCapability.COMPILE to find the right FileObject. Seems to have been introduced by the patch issue #24507. Workaround should be to move up the package root mount to be above the more generic mount in Filesystems Settings, I think. No longer an issue in NB 4.0, only for 3.6 - in 4.0 there are no user-visible mounts and this class of problem cannot happen.
Hmm, true. AOP.findFO uses FileUtil.fromFile which works according to order of FSs in Repository.
I believe this would be straightforward to fix in a 3.6.1 release if there is one.
Note: this issue also affects users of web apps, which automount the source dirs (below the main dir). See issue #42565.
This issue was solved long time ago. Because nobody has reopened it neither added comments, we are verifying/closing it now. If you are still able to reproduce the problem, please reopen. Thanks in advance.