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 243330 - The value '1.8' of element 'source-level' throws exception for schema versions < 4.
Summary: The value '1.8' of element 'source-level' throws exception for schema version...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Freeform (show other bugs)
Version: 8.0
Hardware: PC Linux
: P2 normal with 2 votes (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-27 19:31 UTC by gugrim
Modified: 2015-03-27 03:22 UTC (History)
1 user (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 gugrim 2014-03-27 19:31:54 UTC
A freeform project can't use source level 1.8. The source level can be selected but an exception is thrown when project.xml is saved. Apparently some XML validation fails because the value "1.8" is not valid in the source level tag.

You can then use source level 1.8 until you close and reopen the project since the value 1.8 can't be saved.

You can't get around it by manually edit project.xml since NetBeans will then refuse to open the project.
Comment 1 gugrim 2014-03-28 16:43:10 UTC
Stack trace from the error:

org.xml.sax.SAXParseException; cvc-type.3.1.3: The value '1.8' of element 'source-level' is not valid.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:458)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3237)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3153)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3062)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2140)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:859)
	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.finishNode(DOMValidatorHelper.java:342)
	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:247)
	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190)
	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109)
	at javax.xml.validation.Validator.validate(Validator.java:124)
	at org.openide.xml.XMLUtil.validate(XMLUtil.java:522)
	at org.netbeans.modules.project.ant.ProjectXMLCatalogReader.validate(ProjectXMLCatalogReader.java:149)
	at org.netbeans.spi.project.support.ant.AntProjectHelper.saveXml(AntProjectHelper.java:353)
Caused: java.io.IOException: cvc-type.3.1.3: The value '1.8' of element 'source-level' is not valid.
	at org.netbeans.spi.project.support.ant.AntProjectHelper.saveXml(AntProjectHelper.java:356)
	at org.netbeans.spi.project.support.ant.AntProjectHelper.save(AntProjectHelper.java:637)
	at org.netbeans.spi.project.support.ant.AntProjectHelper.access$100(AntProjectHelper.java:117)
	at org.netbeans.spi.project.support.ant.AntProjectHelper$1.save(AntProjectHelper.java:155)
	at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.saveProject(AntBasedProjectFactorySingleton.java:431)
	at org.netbeans.api.project.ProjectManager$6.run(ProjectManager.java:685)
	at org.netbeans.api.project.ProjectManager$6.run(ProjectManager.java:675)
	at org.openide.util.Mutex.writeAccess(Mutex.java:443)
	at org.netbeans.api.project.ProjectManager.saveProject(ProjectManager.java:675)
[catch] at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.saveModifiedProject(CustomizerDialog.java:370)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.access$500(CustomizerDialog.java:253)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2$1$1.run(CustomizerDialog.java:318)
	at org.openide.filesystems.FileUtil$2.run(FileUtil.java:447)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:609)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:431)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:451)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2$1.run(CustomizerDialog.java:309)
	at org.openide.util.Mutex.writeAccess(Mutex.java:404)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2.run(CustomizerDialog.java:306)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Comment 2 gugrim 2014-04-17 08:36:17 UTC
Realized that it works with schema version 4 in project.xml. Changing the summary and priority. Suggested improvement: An error message that give you some hint on how to fix it, or even better having the project dialog automatically change the schema version for the java-data element containing the compilation-unit element.
Comment 3 Tomas Zezula 2015-03-26 10:46:41 UTC
Fixed jet-main e4d34e66c522.
The dialog now automatically increases the schema to version 4.
If you edit the nbproject.xml by hand you need to increase the schema yourself.
Comment 4 Quality Engineering 2015-03-27 03:22:44 UTC
Integrated into 'main-silver', will be available in build *201503270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e4d34e66c522
User: Tomas Zezula <tzezula@netbeans.org>
Log: #243330:The value '1.8' of element 'source-level' throws exception for schema versions < 4