[
https://issues.jboss.org/browse/JBMETA-363?page=com.atlassian.jira.plugin...
]
Wolfgang Knauf commented on JBMETA-363:
---------------------------------------
First of all: Eclipse cannot find the XSD in the web, because it is not published to the
JBoss website. But JBossTools extends the Eclipse schema catalog with all JBoss XSDs. So
it finds the XSD there (using the schema location URL as a lookup key).
I think the problem arises because of the way you include e.g.
"web-app_3_1.xsd": you use just the XSD name, without a url. This is a
"relative path", thus, the Eclipse validator seeks it at the same location as
"jboss_web_7_1.xsd", which would be inside some JAR file of the JBossTools
schema catalog plugin. But JBossTools does NOT bundle the JavaEE standard schemas, because
they are already part of the Eclipse WebTools Platform plugin.
You could work around this by including the JavaEE xsds with a "full path", e.g.
"http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd". This full path can be found
on the web, and is also a valid lookup key to the Eclipse schema catalog.
Hope that I could clarify my point of view ;-)
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)
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)