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.
Cannot create a project with existing sources in NB 5.0 Beta. Works fine with NB 4.1 on the same folder. NB 5.0 claims, there are existing .class files, but there aren't. Depending on what was then selected (Delete or Ignore existing .class files) different other bad things happen on Finish: Selecting Delete: InvocationTargetException, then UndeclaredThrowableException. Cannot leave new project dialog with Finish, only with Cancel. Attaching messages.log.delete. Selecting Ignore: UndeclaredThrowableException. Cannot leave new project dialog with Finish, only with Cancel. Attaching messages.log.ignore. I had 2 cases, where it actually continued and created the project, but next time on open, it had the name "???". Another case, it created the project only partly. Example was: Existing folder: D:\Anpassungen\AppServer Sources: D:\Anpassungen\AppServer\P2Java Desired Project name: AppServerAnpassungen Using NB 5.0 Beta, JDK 5.0_04. Workaround: Create empty new project anywhere else and copy project folder and build.xml into existing folder.
Created attachment 25570 [details] Exceptions
Created attachment 25571 [details] Exceptions
I have analyzed further and I think, there are 2 problems here: 1. IF a project is being created, it is corrupted. This is related to issue #66563. 2. NB claims, there are existing class files, even if there aren't. Or NB throws the attached exceptions on Finish. This is related to an already existing versioning binding for that folder. See issue #66712.
Most probably the same cause as issue #66563 so closing as duplicate.
*** This issue has been marked as a duplicate of 66563 ***
Only part of this issue is a duplicate of 66563.
Please can you split the issue to this one (duplicate of 66563 and close it as a duplicate) and a new one. It is not good to report two issues in one report especially when they are related to other. I would do it, but I don't understand very well to the second problem. Are the exceptions which you get the Caused by: java.lang.IllegalArgumentException: Already a MasterFileObject@5223f7[file:/D:/Anpassungen/AppServer/nbproject/project.xml ?
The two cases are the same, both the UndeclaredThrowableException and InvocationTargetException have the same cause the: java.lang.IllegalArgumentException: Already a MasterFileObject@5223f7[file:/D:/Anpassungen/AppServer/nbproject/project.xml It is reported when the project FileObject already exist. The new J2SEProject Wizard checks if the file does not exist, but it may happen that the file does not exist but there is VirtualFileObject. It happens only in case when the file D:/Anpassungen/AppServer/nbproject/project.xml is in VCS (old VCS support not the new javacvs) and it is locally deleted? Isn't it your case?
Yes, there are the exceptions. Just forget about the creating a corrupt project.xml. Just focus this issue on this: NB claims, there are existing class files, even if there aren't. Or NB throws the attached exceptions on Finish. This is related to an already existing versioning binding for that folder. See issue #66712.
The most important is if the source folder and the build.xml are under the control of old VCS support. The old VCS support is so "smart" that it can have FileObject even for files which do not physically exist on the disk. Are you using it?
Yes, the project folder is under old VCS (Subversion) control (see issue #66712), however the nbproject folder and build.xml in fact do not exist in the repository ("local" files), only the sources and some other folders.
Are you able to reproduce the exception? If so, can you check if the nbproject/project.xml exists on the disk. Can you try the same without having the project and sources under the VCS. It seems that the VCS pretend existence of the build.xml. The problem with the deleting classfile can be fixed by ignoring VCS virtual files, but if there is virtual build.xml the project system cannot create a regular build.xml file. The only thing I can do is to display some message rather than throwing an exception.
Fixed the problem with class files, the virtual class files are ignored. Checking in src/org/netbeans/modules/java/j2seproject/ui/wizards/PanelSourceFold /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/wizards/Panel new revision: 1.42; previous revision: 1.41 done
I tried to reproduce the issue and it seems, only the virtual .class files were the problem. So, the fix should do it.
OK, thanks for your help. Fixed by: Checking in src/org/netbeans/modules/java/j2seproject/ui/wizards/PanelSourceFold /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/wizards/Panel new revision: 1.42; previous revision: 1.41 done