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.
-create new web service in a web project => ProjectManager.getDefault().saveProject(prj) throws: java.io.IOException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'extension'. One of '{"http://www.netbeans.org/ns/ant-build-extender/1":extension}' is expected. 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) ... which results in no build extension element in project.xml and thus no relationship between build-impl.xml and jaxws-build.xml scripts although everything except project.xml is generated correctly (I'm using netbeans-hudson-trunk-3126-java.zip)
maybe issue 140640 and this are related
Created attachment 66056 [details] ide log
Yes, same problem as what I reopened issue #140640 for. I will close that one so we have just one tracker.
Never mind, already fixed it seems. *** This issue has been marked as a duplicate of 140640 ***
http://hg.netbeans.org/main/rev/f0e20f45bb1a well I actually tried webstart, groovy and webservices before pushing the initial schema change. Just shows how the schema verification thing is fragile and shall not have been pushed in production code at all.
What's fragile? Apparently you did not try "create new web service in a web project". The schema declared that there must be at least one extension, which clearly did not match what the code actually did.
I did create a new webservice, in j2se project though. The fact that each behaves differently just highlights how many other boobytraps of seldom used generation code we can run into in the future. another case for having the schema as relaxed as possible, rather than restrictive.
The schema should match what you need to generate, and what you intend to read. The generation code in question here is hardly "seldom used"; adding WS support to a web project is a basic use case which should should get tested (whether by developers, functional tests, QE, or users) on a regular basis.
well, works fine on jdk1.5.0_15, not on jdk1.6.0_10-b27, thus reopening...
confirmed. The stuff works under 1.5 but fails under 1.6. with rather absurd message: java.io.IOException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'extension'. One of '{"http://www.netbeans.org/ns/ant-build-extender/1":extension}' is expected. If anyone has any idea how to fix, please speak up. Othewise I'm just going to delete the schema file and pretend it never existed.
The message is indeed not very helpful but likely points to a real error - in the code generating the XML, not the validator. Element child = doc.createElement(AntBuildExtenderAccessor.ELEMENT_EXTENSION); is incorrect. It should I think be Element child = doc.createElementNS(AntBuildExtenderAccessor.AUX_NAMESPACE, AntBuildExtenderAccessor.ELEMENT_EXTENSION); Check other parts of your code for accidental calls to DOM Level 1 methods (e.g. I see one place later in the same method), which can behave rather erratically in the various versions of JAXP. The nasty part is that XML serialization will normally proceed without so much as a warning in case an element with a namespace has a child with no namespace, yet DOM inspection of the in-memory XML tree with distinguish the two.
http://hg.netbeans.org/main/rev/64d614f5b4a6 well, I consider that a bug in the memory model DOM inspection.
It's hard to say; the spec is pretty complicated. I think the DOM model is behaving correctly, it is the serialization which fails to issue an error. (Such a document cannot be serialized correctly AFAIK.) One other namespace oddity: <a xmlns="n"> <b x="y"/> </a> the names "a" and "b" are in the namespace "n", but the attribute name "x" is in the default namespace! That is, only element names, not attribute names, inherit a namespace from context.
Integrated into 'main-golden', available in build *200808021401* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/64d614f5b4a6 User: Milos Kleint <mkleint@netbeans.org> Log: #142230 have all elements the correct namespace
*** Issue 142667 has been marked as a duplicate of this issue. ***
*** Issue 142670 has been marked as a duplicate of this issue. ***
*** Issue 142695 has been marked as a duplicate of this issue. ***
v.