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 140905 - Project/properties unusable when running on JDK 6u0/OpenJDK
Summary: Project/properties unusable when running on JDK 6u0/OpenJDK
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: JDK_SPECIFIC
: 142545 142898 145593 148722 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-20 10:57 UTC by Peter Nabbefeld
Modified: 2011-06-09 09:54 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log and uigestures files (109.00 KB, text/plain)
2008-07-22 05:15 UTC, Peter Nabbefeld
Details
log and uigestures files (109.00 KB, application/x-compressed)
2008-07-22 05:16 UTC, Peter Nabbefeld
Details
The project from existing sources as requested (416.48 KB, application/x-compressed)
2008-07-24 06:00 UTC, Peter Nabbefeld
Details
A newly created broken project (901 bytes, application/x-compressed)
2008-07-24 06:03 UTC, Peter Nabbefeld
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Nabbefeld 2008-07-20 10:57:52 UTC
Current build (200807170007) errors:
1. New java application projects cannot be created (an xml problem with the root node)
2. Newly created project from sources: cannot edit libraries used (NPE on saving)

I'm not using Groovy, but even after manually editing the used libs in project.properties,
the Groovy lib is always ensured to be added to the source path. Seems, there's some hardcoded
code in the Groovy extensions (without asking for the need of Groovy), which interferes with
the rest of the project api.

Setting to P1 because cannot even create new standard java apps.
Comment 1 Marian Mirilovic 2008-07-21 07:36:48 UTC
> 1. New java application projects cannot be created (an xml problem with the root node)
... is there an exception ?
> 2. Newly created project from sources: cannot edit libraries used (NPE on saving)
... please attach stack-trace ...
Comment 2 Peter Nabbefeld 2008-07-21 09:38:50 UTC
/1/ No exception, just an error message occurs while creating a project (creation is aborted, project incomplete, thus
cannot be opened). BTW, the project.xml file seems to be incomplete, probably the template/creation code is buggy ?

/2/ Have to answer later - currently no acces (at work ;-) )
Comment 3 Peter Nabbefeld 2008-07-21 09:38:55 UTC
/1/ No exception, just an error message occurs while creating a project (creation is aborted, project incomplete, thus
cannot be opened). BTW, the project.xml file seems to be incomplete, probably the template/creation code is buggy ?

/2/ Have to answer later - currently no access (at work ;-) )
Comment 4 Peter Nabbefeld 2008-07-21 09:39:39 UTC
Oops - sorry for the duplicated post
Comment 5 Marian Mirilovic 2008-07-21 15:57:57 UTC
error message ... IDE generate full stack trace into 
$HOME/.netbeans/Dev/var/log/messages.log file, please attach this file into this issue. Thanks in advance.
Comment 6 Peter Nabbefeld 2008-07-22 05:15:40 UTC
Created attachment 65189 [details]
log and uigestures files
Comment 7 Peter Nabbefeld 2008-07-22 05:16:31 UTC
Created attachment 65190 [details]
log and uigestures files
Comment 8 Peter Nabbefeld 2008-07-22 05:19:13 UTC
Sorry, accidently set the first attachment's mime type wrong - is it possible to remove it?
Comment 9 Peter Nabbefeld 2008-07-22 05:30:50 UTC
Changing libraries in properties sheet (first IOE):

Annotation: Saving nbproject/project.xml in C:\Dokumente und Einstellungen\Peter\Eigene
Dateien\NetBeansProjects\FelixTutorial
Annotation: Saving nbproject/project.xml in C:\Dokumente und Einstellungen\Peter\Eigene
Dateien\NetBeansProjects\FelixTutorial
Annotation: Saving nbproject/project.xml in C:\Dokumente und Einstellungen\Peter\Eigene
Dateien\NetBeansProjects\FelixTutorial
Saving nbproject/project.xml in C:\Dokumente und Einstellungen\Peter\Eigene Dateien\NetBeansProjects\FelixTutorial
Saving nbproject/project.xml in C:\Dokumente und Einstellungen\Peter\Eigene Dateien\NetBeansProjects\FelixTutorial
Caused: org.xml.sax.SAXParseException: cvc-complex-type.4: Attribute 'id' must appear on element 'root'.
	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.addDefaultAttributes(XMLSchemaValidator.java:2859)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2041)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:273)
	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:240)
	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:144)
	at org.netbeans.spi.project.support.ant.AntProjectHelper.saveXml(AntProjectHelper.java:318)
Caused: java.io.IOException: cvc-complex-type.4: Attribute 'id' must appear on element 'root'.
	at org.netbeans.spi.project.support.ant.AntProjectHelper.saveXml(AntProjectHelper.java:321)
	at org.netbeans.spi.project.support.ant.AntProjectHelper.save(AntProjectHelper.java:589)
	at org.netbeans.spi.project.support.ant.AntProjectHelper.access$100(AntProjectHelper.java:99)
	at org.netbeans.spi.project.support.ant.AntProjectHelper$1.save(AntProjectHelper.java:137)
	at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.saveProject(AntBasedProjectFactorySingleton.java:217)
	at org.netbeans.api.project.ProjectManager$7.run(ProjectManager.java:611)
	at org.netbeans.api.project.ProjectManager$7.run(ProjectManager.java:601)
	at org.openide.util.Mutex.writeAccess(Mutex.java:433)
	at org.openide.util.Mutex$1R.run(Mutex.java:1305)
	at org.openide.util.Mutex.doWrapperAccess(Mutex.java:1318)
	at org.openide.util.Mutex.writeAccess(Mutex.java:426)
	at org.netbeans.api.project.ProjectManager.saveProject(ProjectManager.java:600)
	at org.netbeans.modules.java.j2seproject.ui.customizer.J2SEProjectProperties.save(J2SEProjectProperties.java:421)
	at
org.netbeans.modules.java.j2seproject.ui.customizer.CustomizerProviderImpl$StoreListener.actionPerformed(CustomizerProviderImpl.java:147)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2$1.run(CustomizerDialog.java:244)
	at org.openide.util.Mutex.writeAccess(Mutex.java:433)
	at org.openide.util.Mutex$1R.run(Mutex.java:1305)
	at org.netbeans.api.project.ProjectManager$2$1.run(ProjectManager.java:120)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:120)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:499)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:215)
	at org.netbeans.api.project.ProjectManager$2.execute(ProjectManager.java:118)
	at org.openide.util.Mutex.doWrapperAccess(Mutex.java:1320)
	at org.openide.util.Mutex.writeAccess(Mutex.java:384)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2.run(CustomizerDialog.java:240)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Comment 10 Milos Kleint 2008-07-22 08:57:38 UTC
xml validation related issue?
Comment 11 Tomas Zezula 2008-07-23 08:51:15 UTC

*** This issue has been marked as a duplicate of 140300 ***
Comment 12 Peter Nabbefeld 2008-07-23 17:57:26 UTC
Obviously not a duplicate - still cannot edit my project properties (libraries)
Comment 13 Tomas Zezula 2008-07-23 18:14:45 UTC
Please can you attach the broken project file or better the complete (nbproject folder).
Thanks
Comment 14 Peter Nabbefeld 2008-07-24 06:00:00 UTC
Created attachment 65477 [details]
The project from existing sources as requested
Comment 15 Peter Nabbefeld 2008-07-24 06:03:32 UTC
Created attachment 65478 [details]
A newly created broken project
Comment 16 Peter Nabbefeld 2008-07-24 06:06:10 UTC
Used NetBeans IDE Build 200807221016 for latest tests. Could anybody probably try to create a new java application
project without error before releasing a new daily build? You'll probably get much more information, even just-in-time ;-)
Comment 17 Tomas Zezula 2008-07-24 09:14:07 UTC
The attached newly created project is missing completely primary configuration data, not j2se project issue. The project from existing source looks fine. I've 
tried the reported build 200807221016 and it works fine. Creating of a project (j2se, web) is a part of commit validation when it fails there is no promoted 
build of the ide. Seems as some xml parser problem.
Comment 18 Peter Nabbefeld 2008-07-24 09:35:56 UTC
@tzezula:
What does it mean, when You say "project with ex. sources works fine"? I can work with the project, yes, but I cannot
change the referenced libraries, as the same error occurs as when creating a new java application project. Seems to
belong to some broken xml template or schema.
Comment 19 Tomas Zezula 2008-07-24 09:55:36 UTC
On my setup I am able to change the project libraries, platform, source level in the reported IDE 200807221016.
There is no template of the project, the project.xml is generated by code, the broken schema is possible problem.
But strange, the exception logs: Attribute 'id' must appear on element 'root'
The root element is generated by code like:
Element newRootNode = doc.createElementNS(projectConfigurationNamespace, "root"); //NOI18N
 newRootNode.setAttribute("id", rootName); //NOI18N
 String label = newRoots2lab.get(newRoot);
 if (label != null && label.length() > 0 && !label.equals(getRootDisplayName(null, rootName))) {
     newRootNode.setAttribute("name", label); //NOI18N
  }
  ownerElement.appendChild(newRootNode);

So the root has to have always the id.

Comment 20 Milan Kubec 2008-07-24 10:13:30 UTC
I'm not able to reproduce the issue in latest (today's sources) dev build at all - I can create j2seproject and I can
customize libraries.

- What project did you actually created - I see from the log that it's some kind of tutorial project. If it's stored
project structure it might be broken and new XML validation can reject such project.xml
- Does it happen for regular j2seproject (New Project -> Java -> Java Application)
- Did you do any changes in JDK XML parser installation?
- Could you try some more recent dev build?
Comment 21 Peter Nabbefeld 2008-07-24 10:52:03 UTC
@tzezula:
Could You probably give me the location in hg.netbeans.org where to find the code? I'll try build 200807240010 this
evening (in about 9 hours); if I'll fail, I'll try to find out more about the problem. BTW: Which JDK build version do
You use?

@mkubec:
/1/ A very simple project with only one file and Apache Felix lib to be referenced.
/2/ Yes.
/3/ No. But probably some latest build version of JDK is needed? Which one are You using?
/4/ Yes, but only after release ;-) I'm currently at work, must not use any dev builds here ... I've used the latest build
    I could get yesterday for testing.
Comment 22 Tomas Zezula 2008-07-24 12:35:21 UTC
The location in hg:
-module java.j2seproject
-class J2SEProjectGenerator
-method createProject starting on line 125
I am using Apple's JDK 1.5 (build 1.5.0_13-119)
If the problem continues I can add some log messages into the project system to find out more info.

Comment 23 Milan Kubec 2008-07-24 12:57:51 UTC
I've tested on these JDKs:

java version "1.5.0_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) Client VM (build 1.5.0_15-b04, mixed mode, sharing)

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)

No problem found.
Comment 24 Milan Kubec 2008-07-24 13:02:37 UTC
What version of IDE do you use?
Comment 25 Jesse Glick 2008-07-24 16:20:51 UTC
Perhaps reporter is using an old JDK that has

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6531160

broken? Or something like this? Seems likely to be a JAXP bug. messages.log claim reporter is using original JDK 6
release, long obsoleted by patch updates.
Comment 26 Peter Nabbefeld 2008-07-24 20:43:32 UTC
@jglick:
Thank You, You're right. Sorry for the inconvinience.
The problem is: I've installed JDK versions 1.6.0 and 1.6.0_06, the first one is selected by the installation, the
second one is used as a Java platform in the IDE. Probably the installation routine can ignore the buggy 1.6.0? If only
the buggy one is found, the installation should issue an error and quit, otherwise it should issue a warning about the
buggy one and ignore it.

Leaving this open, as NetBeans should probably take some action (error/warning) when installed/started with the buggy
JDK 1.6.0
Comment 27 Jesse Glick 2008-07-24 21:04:05 UTC
Agreed. There is already some code in project.ant which checks the active JAXP for some bugs; could probably be
extended. A separate bug should be filed for the installer if it misdetected the right JDK to use.
Comment 28 Peter Nabbefeld 2008-07-25 07:45:42 UTC
Filed a new bug: http://www.netbeans.org/issues/show_bug.cgi?id=141648
Comment 29 Peter Nabbefeld 2008-07-26 08:58:07 UTC
Not a NetBeans issue - JDK bug.
Comment 30 Jesse Glick 2008-07-28 16:02:50 UTC
NB should explicitly check for the JDK bug during startup and issue a friendly error message.
Comment 31 Jesse Glick 2008-08-05 17:54:49 UTC
*** Issue 142898 has been marked as a duplicate of this issue. ***
Comment 32 Jesse Glick 2008-08-05 17:55:59 UTC
Needs to be fixed in 6.5, I think. Rather than showing a warning and refusing to start, could just disable validation in
case JAXP looks broken.
Comment 33 Milan Kubec 2008-08-06 09:08:55 UTC
Could you please point me to Bug priority guidelines that says that bug in JDK is P1 issue for NetBeans. Thanks.
Comment 34 Milan Kubec 2008-08-06 09:43:27 UTC
Jesse, could you explain "JAXP looks broken", what should be checked in such a method 'doesJAXPLookBroken()'. If we
refuse validation on certain JDK aren't we going to create invalid documents, that will be refused then on JDK with
correct JAXP implementation?

Why do we want to put another hacks to code, just to refuse buggy JDK? We have Release Notes document provided with each
release with important facts about given release. One of such important facts for 6.5 release is that NetBeans IDE
cannot run on Open JDK 6 because of broken JAXP implementation.

If we would really want to check for the JDK version, shouldn't it be done in installer or launcher?
Comment 35 Milan Kubec 2008-08-06 13:42:09 UTC
This issue needs some discussion, setting as INCOMPLETE until there is clear conclusion about what and how we really
want to fix. 

Lowering priority to P2 since there is no justification why JDK bug should be P1 issue for NetBeans.
Comment 36 Jesse Glick 2008-08-06 15:19:39 UTC
*** Issue 142545 has been marked as a duplicate of this issue. ***
Comment 37 Jesse Glick 2008-08-06 15:39:47 UTC
Clearest way to reproduce is

ant -f openide.util/build.xml test-single -Dtest.includes='**/XMLUtilTest*' -Dnbjdk.home=/space/jdk1.6.0
-Dpermit.jdk6.builds=true

An earlier workaround I had for JDK #6529766 does not seem to be helping here; will investigate more.
Comment 38 Jesse Glick 2008-08-06 16:05:09 UTC
I think I can work around the validator bug. The problem is that

newRootNode.setAttribute("id", rootName)

is actually a DOM Level 1 call which does not work well with some versions of JAXP;

newRootNode.setAttributeNS(null, "id", rootName)

would work better. Since it would be a lot of work to change all occurrences of setAttribute, can just change the
validation code (which AFAIK is all that is affected) to validate a deep copy of the DOM tree in which DOM 1 attributes
have been replaced with DOM 2 attributes.

core-main #5f91025658eb
Comment 39 Jesse Glick 2008-08-06 16:11:25 UTC
Despite the workaround, I can hardly recommend that anyone try to run NB on JDK 1.6.0_00. There have been numerous fixes
made in the various update releases and I expect some of these bugs affect NetBeans. If the current releases of Open JDK
6 do not include the patch updates then I would consider it unsuitable for running production code.
Comment 40 Quality Engineering 2008-08-07 16:35:57 UTC
Integrated into 'main-golden', available in build *200808071401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/5f91025658eb
User: Jesse Glick <jglick@netbeans.org>
Log: #140905: problems validating project.xml files on JDK 6 (no updates), or with standalone Xerces.
Comment 41 graeme_m_ross 2008-09-01 09:23:19 UTC
*** Issue 145593 has been marked as a duplicate of this issue. ***
Comment 42 David Konecny 2008-10-01 20:54:49 UTC
*** Issue 148722 has been marked as a duplicate of this issue. ***
Comment 43 sampathreddy 2011-03-18 11:14:05 UTC
Comment on attachment 65189 [details]
log and uigestures files

Hi,
Comment 44 Marian Mirilovic 2011-06-09 09:54:16 UTC
v/c