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.
Build: NetBeans IDE Dev (Build 200802161202) VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05 OS: Linux, 2.6.24.2-smp, i386 Exception raises after finishing New Web application with existing sources wizard. STACKTRACE: (first 10 lines) java.lang.UnsupportedOperationException at org.netbeans.api.java.project.classpath.ProjectClassPathModifier.addRoots(ProjectClassPathModifier.java:177) at org.netbeans.modules.web.project.api.WebProjectUtilities.importProjectImpl(WebProjectUtilities.java:543) at org.netbeans.modules.web.project.api.WebProjectUtilities.access$200(WebProjectUtilities.java:106) at org.netbeans.modules.web.project.api.WebProjectUtilities$3.run(WebProjectUtilities.java:419) at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:120) at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:499) at org.netbeans.modules.web.project.api.WebProjectUtilities.importProject(WebProjectUtilities.java:417) at org.netbeans.modules.web.project.ui.wizards.ImportWebProjectWizardIterator.instantiate(ImportWebProjectWizardIterator.java:196) at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1023) at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:595)
Build: NetBeans IDE Dev (Build 200803251204) VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05 OS: Windows XP, 5.1, x86 User Comments:
Created attachment 59542 [details] stacktrace
Wrong component. Either web project doesn't provide required SPI or caller passes wrong projectArtifact.
tzezula, the problem is in projectArtifact. Web import wizard adds all jars found in web-inf/lib to project classpath. If sources folder is specified in wizard but is outside of project folder then you get this exception. Other problem I discovered was that not entering any sources folder fails with ArrayIndexOutOfBoundsException. How do you think this should be resolved? One idea is to call directly web implementation of ProjectClassPathModifierImplementation and add the jars always to java.classpath. Thanks, -D
This is a problem of the SimpleFileOwnerQuery.markExternalOwnerTransient which is called from project's open hook. In the time when the project is not yet opened the source root you are passing to the PCPM does not belong to any project. You should either add it into the property as you described or delay the addition to the time the project is opened. Another but very ugly solution is to register the owner for the root in the wizard and unregister it after adding the root. Unfortunately the PCPM needs the source root because the projects with multiple compilation units, the project itself doesn't describe the java compilation unit since there are more of them (src, test) having different classpaths.
Build: NetBeans IDE Dev (Build 200804060002) VM: Java HotSpot(TM) Client VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b14 OS: Windows XP, 5.1, x86 User Comments: Creating a web application from existing sources. Clicking finish
Created attachment 59895 [details] stacktrace
As this issue effectively prevents the creation of a new project, I wonder why it's only P3? Shouldn't this be P1 to make sure it's fixed for 6.1??
Good point.
The exception is thrown when the sources folder is specified in wizard but is outside of project folder. It means the workaround is to use default project folder offered by wizard. According the Quality criteria guideline http://qa.netbeans.org/bugzilla/bug_priority_guidelines.html the bug is P2 and it's not stopper. Anyway, the annoying bug will be fixed in patch1 for Nb 6.1.
Workaround:In 'Name and Location' use default Project Folder location (i.e. Project Folder = Location) and exception doesn't occure.
From my point of view this is a regression, as this was working perfectly well in 5.0, 5.5 and 6.0 We never store the NB project directory in the actual source tree (as that is under version control and should not be cluttered with non-versioned filed) so for me this is more or less a show stopper, and I'll need to wait for the post 6.1 version before I can migrate :(
I just tried the suggested workaround and that doesn't work either. If I keep the default values for the project folder I get a MissingResourceException when selecting the WEB-INF folder and the wizard complains "WEB-INF folder is mandatory" even though I selected one. The exception has already been uploaded: http://statistics.netbeans.org/analytics/detail.do?id=45139 The structure of the source is like this: my_project src main java (contains the java packages) webapp WEB-INF META-INF css images (jsp files) In the first page of the wizard I select "my_project/src/main/java" for the "Location" field. When doing this, the wizard suggests to use my_project/src/main/java as the project folder (which doesn't really make sense). When I leave these defaults (after changing the project's name from "java" to "my_project") I get the error "WEB-INF folder is mandatory" error when selecting the WEB-INF folder. So currently there is no way for me to create the project using NB 6.1
The only workaround for me is to create the Project in NB 6.0 and then open it in 6.1 which seems to work without problems.
It seems to me as P1.
tkellerer, I followed your files structure and can create project with existing source without problem. I chose: Location: D:\projs\my_project Project Folder: D:\projs\my_project Web Pages Folder: D:\projs\my_project\src\main\webapp WEB-INF Content: D:\projs\my_project\src\main\webapp\WEB-INF Sources Packages Folder: D:\projs\my_project\src\main\java I'm going to fix this issue today as well as MissingResourceException.
I should have also said that I set: Libraries Folder (on 4.panel - Existing Sources and Libraries panel): D:\projs\my_project\src\main\webapp\WEB-INF\lib and made sure it contains some jar files. In this setup everything passes. If however I on the 4. panel change Sources Packages Folders to a folder outside of my_project folder, e.g. D:\projs\sources, then I'll get UnsupportedOperationException.
This is regression from 6.0 - usage of deprecated API was replaced with new API which caused this problem. The workaround is to specify a Java source root which lies under project folder. Statistics shows 18 duplicates. Fix is simple and isolated and will not cause regression if integrated to 6.1. UnsupportedOperationException fixed in http://hg.netbeans.org/main?cmd=changeset;node=b5f07b919bea MissingResourceException fixed in http://hg.netbeans.org/main?cmd=changeset;node=2c3809407a9d
The bug is fixed in the build http://bits.netbeans.org/download/trunk/nightly/2008-04-11_02-01-00/
v. in trunk
Based on offline discussion with Petr Blaha fixinf in 6.1: 7a6ae9da24fc and c0c0aca09be0
v. in 6.1 RC2
The changes proposed by this fix were already integrated in release61 repository and are part of NB 6.1 FCS build. Clearing status whiteboard. This fix should not be part of NB 6.1 patch 1.
Comment on attachment 59542 [details] stacktrace >java.lang.UnsupportedOperationException > at org.netbeans.api.java.project.classpath.ProjectClassPathModifier.addRoots(ProjectClassPathModifier.java:177) > at org.netbeans.modules.web.project.api.WebProjectUtilities.importProjectImpl(WebProjectUtilities.java:554) > at org.netbeans.modules.web.project.api.WebProjectUtilities.access$200(WebProjectUtilities.java:108) > at org.netbeans.modules.web.project.api.WebProjectUtilities$3.run(WebProjectUtilities.java:425) > at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:120) > at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:499) > at org.netbeans.modules.web.project.api.WebProjectUtilities.importProject(WebProjectUtilities.java:423) > at org.netbeans.modules.web.project.ui.wizards.ImportWebProjectWizardIterator.instantiate(ImportWebProjectWizardIterator.java:196) > at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1023) > at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:595) > at org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:416) > at org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:253) > at org.openide.loaders.TemplateWizardIteratorWrapper.instantiate(TemplateWizardIteratorWrapper.java:165) > at org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1384) > at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1341) > at org.openide.WizardDescriptor.access$1600(WizardDescriptor.java:119) > at org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:1908) > at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) > at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)