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
URL: http://java.sun.com/docs/books/tutori...
Keywords:
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:


Attachments

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.

Log:

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
'{"http://www.netbeans.org/ns/j2se-project/3":test-roots}' is expected.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
	at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(XMLSchemaValidator.java:3129)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3076)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:2978)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2121)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:791)
	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.finishNode(DOMValidatorHelper.java:338)
	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:243)
	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:186)
	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:100)
	at javax.xml.validation.Validator.validate(Validator.java:127)
	at org.openide.xml.XMLUtil.validate(XMLUtil.java:496)
	at org.netbeans.modules.project.ant.ProjectXMLCatalogReader.validate(ProjectXMLCatalogReader.java:152)
	at
org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProjectXml(AntBasedProjectFactorySingleton.java:291)
Caused: java.io.IOException: E:\Dane\_Adam\JDK-Examples\components-TableFilterDemoProject\nbproject\project.xml
	at
org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProjectXml(AntBasedProjectFactorySingleton.java:320)
	at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProject(AntBasedProjectFactorySingleton.java:223)
	at org.netbeans.api.project.ProjectManager.createProject(ProjectManager.java:354)
	at org.netbeans.api.project.ProjectManager.access$300(ProjectManager.java:80)
	at org.netbeans.api.project.ProjectManager$2.run(ProjectManager.java:275)
	at org.netbeans.api.project.ProjectManager$2.run(ProjectManager.java:227)
	at org.openide.util.Mutex.readAccess(Mutex.java:327)
	at org.netbeans.api.project.ProjectManager.findProject(ProjectManager.java:227)
[catch] at org.netbeans.modules.project.ui.groups.DirectoryGroup.processFolderChildren(DirectoryGroup.java:147)
	at org.netbeans.modules.project.ui.groups.DirectoryGroup.findProjects(DirectoryGroup.java:114)
	at org.netbeans.modules.project.ui.groups.Group.getProjects(Group.java:255)
	at org.netbeans.modules.project.ui.groups.Group.open(Group.java:319)
	at org.netbeans.modules.project.ui.groups.Group.setActiveGroup(Group.java:166)
	at org.netbeans.modules.project.ui.groups.GroupsMenu$2.run(GroupsMenu.java:208)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:577)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1030)
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:
9e3975e8-3345-4d0a-acdb-1bc522c362a8_acad99b1-3b50-4d54-a6f4-6603803d5821
INFO [org.netbeans.modules.uihandler.Installer]
java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:129)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1072)
	at org.netbeans.modules.uihandler.Installer.uLogs(Installer.java:1180)
	at org.netbeans.modules.uihandler.Installer.uploadLogs(Installer.java:1071)
[catch] at org.netbeans.modules.uihandler.Installer$Submit.uploadAndPost(Installer.java:1687)
	at org.netbeans.modules.uihandler.Installer$Submit.access$1500(Installer.java:1305)
	at org.netbeans.modules.uihandler.Installer$Submit$1$2.run(Installer.java:1581)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:577)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1030)
Comment 1 Jiri Skrivanek 2009-09-17 08:28:55 UTC
Please, describe more precisely what is your actual problem.
http://wiki.netbeans.org/IssuezillaRules
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.