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 172393 - Java tutorial projects cannot be opened
Summary: Java tutorial projects cannot be opened
Status: NEW
Alias: None
Product: third-party
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@third-party
Depends on:
Blocks: 42686
  Show dependency tree
Reported: 2009-09-16 14:23 UTC by olamagato
Modified: 2009-10-26 19:02 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description olamagato 2009-09-16 14:23:31 UTC
Bug in project loader:
Project.xml: Non-existed node <test-roots> or <test-roots /> in <data> cause exception
Many jdk examples coming with project.xml without node test-roots.


SEVERE [org.openide.util.Exceptions]
org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The content of element 'data' is not complete. One of
'{"":test-roots}' is expected.
	at javax.xml.validation.Validator.validate(
	at org.openide.xml.XMLUtil.validate(
	at org.netbeans.modules.project.ant.ProjectXMLCatalogReader.validate(
Caused: E:\Dane\_Adam\JDK-Examples\components-TableFilterDemoProject\nbproject\project.xml
	at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProject(
	at org.netbeans.api.project.ProjectManager.createProject(
	at org.netbeans.api.project.ProjectManager.access$300(
	at org.netbeans.api.project.ProjectManager$
	at org.netbeans.api.project.ProjectManager$
	at org.openide.util.Mutex.readAccess(
	at org.netbeans.api.project.ProjectManager.findProject(
[catch] at org.netbeans.modules.project.ui.groups.DirectoryGroup.processFolderChildren(
	at org.netbeans.modules.project.ui.groups.DirectoryGroup.findProjects(
	at org.netbeans.modules.project.ui.groups.Group.getProjects(
	at org.netbeans.modules.project.ui.groups.Group.setActiveGroup(
	at org.netbeans.modules.project.ui.groups.GroupsMenu$
	at org.openide.util.RequestProcessor$
	at org.openide.util.RequestProcessor$
INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Resolving dependencies took: 170 ms
INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 16 binary roots took: 40 ms
INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 12 source roots took: 230 ms
INFO [org.netbeans.modules.uihandler.Installer]: findIdentity:
INFO [org.netbeans.modules.uihandler.Installer] Read timed out
	at Method)
	at org.netbeans.modules.uihandler.Installer.uLogs(
	at org.netbeans.modules.uihandler.Installer.uploadLogs(
[catch] at org.netbeans.modules.uihandler.Installer$Submit.uploadAndPost(
	at org.netbeans.modules.uihandler.Installer$Submit.access$1500(
	at org.netbeans.modules.uihandler.Installer$Submit$1$
	at org.openide.util.RequestProcessor$
	at org.openide.util.RequestProcessor$
Comment 1 Jiri Skrivanek 2009-09-17 08:28:55 UTC
Please, describe more precisely what is your actual problem.
Comment 2 olamagato 2009-09-21 14:42:38 UTC
I try add jdk tutorial swing examples with netbeans project and i receive exceptions. Many of this examples not load to
project view. I compared project.xml files from loaded projects and not loaded. Only difference with both are exist or
non-exist "<test-roots />" node in project.xml.

Please add java swing examples by project group->new group, select "Folder of projects"  and select
"tutorial\uiswing\examples" in unpacked sun java tutorial. Some of projects (with project.xml and <test-roots /> node)
will be accepted but most not (~90%).
In my opinion this is bug. Especial for java newbies.

I can recreate or fix project.xml files in older tutorial files but this is not fully good solution.
And no solution for java and netbeans newbies (tutorial instructions not work).

(Sorry for my weak english).
Comment 3 Tomas Zezula 2009-10-26 18:07:28 UTC
The problem is obvious, the project files are not valid (they are missing mandatory test-roots element).
The j2seproject works fine even if the element is not a part of the project.xml (behaves in the same way as if there is empty test-roots element).
But the Ant Based Project throws exception from XML verifier.  The correct fix is to fix the JDK examples, unfortunately I have no idea who maintains them.
In the NB 6.8, at least in the dev builds, the project.xml files are not verified => no exception is throws and everything seems to work fine.
Reassigning to ant/project as I am not sure if the verification will be disabled also in the release.
Comment 4 Jesse Glick 2009-10-26 18:38:00 UTC
If I try to open the project in the URL field in a NB dev build, it is correctly rejected as malformed. project.xml
verification cannot be disabled to my knowledge.

ProjectXMLCatalogReader.autocorrect could in principle try to insert empty elements that a schema says must be present,
but this seems more dangerous than the autocorrections it currently performs. Probably better to just fix those projects
known to be broken. I do not know of any version of the IDE which would have deleted <test-roots> via GUI manipulation.

I will try to contact the tutorial team about these errors.
Comment 5 Jesse Glick 2009-10-26 18:45:37 UTC
Sent a form submission; no way of tracking progress.
Comment 6 Tomas Zezula 2009-10-26 19:02:11 UTC
The test-roots element was always mandatory.