]
Wolfgang Knauf commented on JBMETA-363:
---------------------------------------
Same applies to jboss_web_7_1.xsd and jboss_web_8_0.xsd
Using Eclipse 4.4 (WebTools 3.6), the validation error has changed, but I assume it is
still the same source:
"schema_reference.4: Failed to read the schema document 'web-app_3_1.xsd',
because 1) could not find the document; 2) the document could not be read; 3) the root
element of the document is not 'xsd:schema'
Same happens for jboss-app.xml instances based on "jboss-app_7_0.xsd"
The issue now happens always (without me changing the schema location to a local file),
because the JBoss Tools plugin brings all jboss schema files and thus Eclipse can validate
them even if they are not published to the web location.
Validation errors with "jboss-web_7_0.xsd
-----------------------------------------
Key: JBMETA-363
URL:
https://issues.jboss.org/browse/JBMETA-363
Project: JBoss Metadata
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: web
Affects Versions: 7.0.5.Final, 8.1.0.Beta1
Environment: Eclipse
Reporter: Wolfgang Knauf
Assignee: Jean-Frederic Clere
I tried to create a "jboss-web.xml" file based on the
"jboss-web_7_1.xsd"
As this is not uploaded to the web up to now, I created it with a schema location
pointing to my local JBoss 7.2.0Alpha1 snapshot:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web
xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
file:///C:/Temp/jboss-as-7.2.0.Alpha1-SNAPSHOT/docs/schema/jboss-web_7_0.xsd"
version="7.0">
...
</jboss-web>
Eclipse shows validation errors in the XSD file.
The first on is:
sch-props-correct.2: A schema cannot contain two global components with the same name;
this schema contains two
occurences of 'http://java.sun.com/xml/ns/javaee,descriptionGroup'
(occurs in javaee_6.xsd, line 88)
And a lot more of those.
The file was created as part of
https://issues.jboss.org/browse/AS7-1262 - and the one
who created it found the same validation error.
It seems the fix is quite simple:
"jboss-web_7_0.xsd" contains this import:
<xsd:import
namespace="http://java.sun.com/xml/ns/javaee"
schemaLocation="web-app_3_0.xsd"/>
Change it to:
<xsd:import
namespace="http://java.sun.com/xml/ns/javaee"
schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&qu...
The reason seems to be: "jboss-web_7_0.xsd" imports
"jboss-common_6-0.xsd", and this one imports "javaee_6.xsd" with a
full schema location.
The "web-app_3_0.xsd" in "jboss-web_7_0.xsd" has a local schema
location, thus the "javaee_6.xsd" import in "web-app_3_0.xsd" points
also to local.
And this seems to cause a duplicate import of the file.
(might also be an Eclipse valiation bug)