Community
Participate
Working Groups
There are always a ton of xml errors in our environments, quickstarts, and projects, and after investigating, they very often lead back to cryptic errors indicating that an oracle xsd has errors. This of course seems very nearly impossible, or at least unlikely, so I dug further. If I download and expand eclipse-jee-mars-1-linux-gtk-x86_64.tar.gz, and run it, I get a fresh clean jee installation without any other tools corrupting or conflicting. Steps to reproduce: 1) Create dynamic web project 2) wget and place http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/javaee_web_services_client_1_2.xsd inside the WebContent/WEB-INF folder 3) Open the javaee_web_services_client_1_2.xsd file in the editor. 4) Witness 40 errors This is very strange, because using an online validator, the file seems to validate just fine. But in eclipse / jee installation, it utterly fails. You may suggest that this is just one file, or it's a poorly written one, but the fact is that eclipse then allows these errors to 'cascade' into other xml files. It then becomes an error that a dependent remote schema is invalid, or that a bundled oracle schema in a catalog plugin is invalid. There must be something going on that causes this, and I'm kinda desperate to know what it is, or if others can replicate it ;) Description Resource Path Location Type src-resolve: Cannot resolve the name 'javaee:descriptionGroup' to a(n) 'group' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 175 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:descriptionGroup' to a(n) 'group' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 396 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:fully-qualified-classType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 85 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:fully-qualified-classType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 191 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:fully-qualified-classType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 206 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:fully-qualified-classType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 409 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:jndi-nameType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 177 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:param-valueType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 421 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:pathType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 240 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:resourceGroup' to a(n) 'group' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 314 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:string' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 113 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:string' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 398 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:string' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 438 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:string' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 451 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:true-falseType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 99 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:xsdAnyURIType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 227 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:xsdQNameType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 257 XML Schema Problem src-resolve: Cannot resolve the name 'javaee:xsdQNameType' to a(n) 'type definition' component. javaee_web_services_client_1_2.xsd /DWeb/WebContent/WEB-INF line 425 XML Schema Problem
is the issue not that there is no way to resolve what "http://java.sun.com/xml/ns/javaee" refer to when trying to figure out what xmlns:javaee works for ? Which schema is defining "descriptionGroup" ?
As I understand it, the general idea is that they will resolve *all* xsd they know about (via following the schemaLocation flags, namespace mappings, catalogs, etc,) that contribute to the namespace. It's entirely possible that some contributing xsd do not have a known location, especially if the dependent schema has not referenced it specifically. It's also possible that the parent schema *is* found, but is also "invalid" because one of ITS parents are also unknown / not found. So yes, it's entirely possible there's a missing schema somewhere, but there's not enough information available for me to find out what schema defines these things, much less a validator. Since the namespace is overloaded, the parent schema can be anywhere. > Which schema is defining "descriptionGroup" ? Despite searching for some time, I was unable to figure out what schema defines "descriptionGroup"
I think I've found that javaee_7.xsd at http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/javaee_7.xsd defines a descriptionGroup. javaee_6.xsd similarly defines it, as I imagine all previous versions do as well.
It's worth noting that the schema that is the topic of this issue, javaee_web_services_client_1_2.xsd , is a javaee 5 schema, and so would require javaee_5.xsd to be available. javaee_5.xsd is included in the source-editing distribution, and is available at ./bundles/org.eclipse.jst.standard.schemas/dtdsAndSchemas/javaee_5.xsd So the question is why it's not being resolved. The source-editing plugins not only include the schema but also make it available in their catalog with the following entries: <uri name="http://java.sun.com/xml/ns/javaee/javaee_5.xsd" uri="dtdsAndSchemas/javaee_5.xsd" /> <uri name="http://xmlns.jcp.org/xml/ns/javaee/javaee_5.xsd" uri="dtdsAndSchemas/javaee_5.xsd" /> In plain english, this is telling the validator that when it sees something like xmlns:javaee="http://java.sun.com/xml/ns/javaee/javaee_5.xsd" That it should use the included schema. However, none of the schema are actually *using* that string anywhere. None of the schema are referencing http://java.sun.com/xml/ns/javaee/javaee_5.xsd. They are all just referencing the namespace... http://java.sun.com/xml/ns/javaee Should additional entries in the catalog be made for the generic javaee namespace? Generally (as I understand it), it's ok for multiple schema files to be mapped to the same namespace. Eclipse will (based on the user setting) check all files in the namespace for the missing element / group / etc. But I can imagine that it might somehow run into problems when segregating different versions... Either way, it's clear that while javaee_5.xsd / javaee_6.xsd / javaee_7.xsd all define descriptionGroup, and all are available in the source-editing plugin, none of them are being discovered by the source-editing catalog because the schema do not reference specific namespaces with the filename at the end, but rather generic namespaces for javaee. Is this something that can be fixed?
My idea of adding catalog entries that map the more liberal strings still didn't seem to work. <uri name="http://java.sun.com/xml/ns/javaee" uri="dtdsAndSchemas/javaee_5.xsd" /> <uri name="http://xmlns.jcp.org/xml/ns/javaee" uri="dtdsAndSchemas/javaee_5.xsd" /> So that was a failure. A coworker seems to have indicated the following: <vpakan> after adding javaee_5.xsd to XML catalog and <xsd:include schemaLocation="http://java.sun.com/xml/ns/javaee"/> line to javaee_web_services_client_1_2.xsd file there are no errors only warnings --- I'm not sure how he added it to the catalog, but by his comment I assume he mapped it to the http://java.sun.com/xml/ns/javaee namespace, and the modified the javaee_web_services_client_1_2.xsd to reference it.
1. Download http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/javaee_5.xsd 2. Add this entry to Eclipse XML Catalog: Location: path to javaee_5.xsd on local file system Key Tape: Namespace name Key: http://java.sun.com/xml/ns/javaee After this namespace "http://java.sun.com/xml/ns/javaee" should be available for schema validation within Eclipse instance
Looks like javaee_web_services_client_1_2.xsd is not valid itself only referenced from other xml/xsd file
The XSD entity resolver will only get called if there is at least one include/import. I don't think I can do anything from the XSD validator point of view, short of (a hack by) cloning the schema in question, and injecting imports for the namespaces that are available in the namespace table, and then validating the temporary schema. The change must be in Xerces.