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 66015 - Cannot create project with existing sources
Summary: Cannot create project with existing sources
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All Windows ME/2000
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-05 17:40 UTC by tboerkel
Modified: 2005-10-17 11:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exceptions (56.77 KB, text/plain)
2005-10-05 17:42 UTC, tboerkel
Details
Exceptions (56.78 KB, text/plain)
2005-10-05 17:42 UTC, tboerkel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tboerkel 2005-10-05 17:40:39 UTC
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.
Comment 1 tboerkel 2005-10-05 17:42:02 UTC
Created attachment 25570 [details]
Exceptions
Comment 2 tboerkel 2005-10-05 17:42:49 UTC
Created attachment 25571 [details]
Exceptions
Comment 3 tboerkel 2005-10-13 14:52:14 UTC
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.
Comment 4 Jan Lahoda 2005-10-14 08:38:28 UTC
Most probably the same cause as issue #66563 so closing as duplicate.
Comment 5 Tomas Zezula 2005-10-14 09:15:41 UTC

*** This issue has been marked as a duplicate of 66563 ***
Comment 6 tboerkel 2005-10-14 09:42:38 UTC
Only part of this issue is a duplicate of 66563.
Comment 7 Tomas Zezula 2005-10-14 10:02:12 UTC
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 ?

Comment 8 Tomas Zezula 2005-10-14 10:18:30 UTC
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?

Comment 9 tboerkel 2005-10-14 10:23:10 UTC
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.
Comment 10 Tomas Zezula 2005-10-14 10:40:37 UTC
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?
Comment 11 tboerkel 2005-10-14 11:16:19 UTC
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.
Comment 12 Tomas Zezula 2005-10-14 14:17:55 UTC
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.
Comment 13 Tomas Zezula 2005-10-14 14:43:00 UTC
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
Comment 14 tboerkel 2005-10-17 07:06:18 UTC
I tried to reproduce the issue and it seems, only the virtual .class files were
the problem. So, the fix should do it.
Comment 15 Tomas Zezula 2005-10-17 11:04:23 UTC
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