Hi,
on the build server, JDK11 build, there are a bunch of build failures all related to XML validation,
a few happening in the CSW module (which validates requests) and a couple in WMS, when
sending over a SLD and asking it to be validated.
All these code paths end up in the GeoTools Parser class, enable its validator, and on the build server,
fail validation due to problems in the schema.
Your SLD is not valid.
Most common problems are:
(1) no namespaces - use <ows:GetMap>, <sld:Rule>, <ogc:Filter>, <gml:Point> - the part before the ':' is important
(2) capitialization - use '<And>' not '<and>'
(3) Order - The order of elements is important
(4) Make sure your first tag imports the correct namespaces. ie. xmlns:sld="[http://www.opengis.net/sld"](http://www.opengis.net/sld%22) for EVERY NAMESPACE
1: <StyledLayerDescriptor xmlns="[http://www.opengis.net/sld"](http://www.opengis.net/sld%22) xmlns:se="[http://www.opengis.net/se"](http://www.opengis.net/se%22) version="1.1.0"> <NamedLayer> <se:Name>sf:states</se:Name> <UserStyle> <se:Name>UserSelection</se:Name> <se:FeatureTypeStyle> <se:Rule> <ogc:Filter xmlns:ogc="[http://www.opengis.net/ogc">](http://www.opengis.net/ogc%22%3E) <ogc:PropertyIsEqualTo> <ogc:PropertyName>STATE_ABBR</ogc:PropertyName> <ogc:Literal>IL</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> <se:PolygonSymbolizer> <se:Fill> <se:SvgParameter name="fill">#FF0000</se:SvgParameter> </se:Fill> </se:PolygonSymbolizer> </se:Rule> <se:Rule> <se:LineSymbolizer> <se:Stroke/> </se:LineSymbolizer> </se:Rule> </se:FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor>
(line 25, column 71)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,_Id'](http://www.opengis.net/ogc,_Id').
(line 26, column 88)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,FeatureId'](http://www.opengis.net/ogc,FeatureId').
(line 27, column 92)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,GmlObjectId'](http://www.opengis.net/ogc,GmlObjectId').
(line 29, column 54)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Filter'](http://www.opengis.net/ogc,Filter').
(line 30, column 39)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,FilterType'](http://www.opengis.net/ogc,FilterType').
(line 39, column 84)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,comparisonOps'](http://www.opengis.net/ogc,comparisonOps').
(line 40, column 115)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsEqualTo'](http://www.opengis.net/ogc,PropertyIsEqualTo').
(line 41, column 118)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsNotEqualTo'](http://www.opengis.net/ogc,PropertyIsNotEqualTo').
(line 42, column 116)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsLessThan'](http://www.opengis.net/ogc,PropertyIsLessThan').
(line 43, column 119)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsGreaterThan'](http://www.opengis.net/ogc,PropertyIsGreaterThan').
(line 44, column 125)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsLessThanOrEqualTo'](http://www.opengis.net/ogc,PropertyIsLessThanOrEqualTo').
(line 45, column 128)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsGreaterThanOrEqualTo'](http://www.opengis.net/ogc,PropertyIsGreaterThanOrEqualTo').
(line 46, column 108)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsLike'](http://www.opengis.net/ogc,PropertyIsLike').
(line 47, column 108)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsNull'](http://www.opengis.net/ogc,PropertyIsNull').
(line 48, column 114)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsBetween'](http://www.opengis.net/ogc,PropertyIsBetween').
(line 49, column 63)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,ComparisonOpsType'](http://www.opengis.net/ogc,ComparisonOpsType').
(line 50, column 78)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,spatialOps'](http://www.opengis.net/ogc,spatialOps').
(line 51, column 98)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Equals'](http://www.opengis.net/ogc,Equals').
(line 52, column 100)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Disjoint'](http://www.opengis.net/ogc,Disjoint').
(line 53, column 99)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Touches'](http://www.opengis.net/ogc,Touches').
(line 54, column 98)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Within'](http://www.opengis.net/ogc,Within').
(line 55, column 100)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Overlaps'](http://www.opengis.net/ogc,Overlaps').
(line 56, column 99)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Crosses'](http://www.opengis.net/ogc,Crosses').
(line 57, column 102)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Intersects'](http://www.opengis.net/ogc,Intersects').
(line 58, column 100)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Contains'](http://www.opengis.net/ogc,Contains').
(line 59, column 98)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,DWithin'](http://www.opengis.net/ogc,DWithin').
(line 60, column 97)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Beyond'](http://www.opengis.net/ogc,Beyond').
(line 61, column 85)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,BBOX'](http://www.opengis.net/ogc,BBOX').
(line 62, column 60)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,SpatialOpsType'](http://www.opengis.net/ogc,SpatialOpsType').
(line 63, column 74)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,logicOps'](http://www.opengis.net/ogc,logicOps').
(line 64, column 91)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,And'](http://www.opengis.net/ogc,And').
(line 65, column 90)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Or'](http://www.opengis.net/ogc,Or').
(line 66, column 90)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,Not'](http://www.opengis.net/ogc,Not').
(line 67, column 58)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,LogicOpsType'](http://www.opengis.net/ogc,LogicOpsType').
(line 68, column 60)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,AbstractIdType'](http://www.opengis.net/ogc,AbstractIdType').
(line 69, column 42)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,FeatureIdType'](http://www.opengis.net/ogc,FeatureIdType').
(line 76, column 44)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,GmlObjectIdType'](http://www.opengis.net/ogc,GmlObjectIdType').
(line 83, column 51)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,BinaryComparisonOpType'](http://www.opengis.net/ogc,BinaryComparisonOpType').
(line 93, column 47)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsLikeType'](http://www.opengis.net/ogc,PropertyIsLikeType').
(line 107, column 47)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsNullType'](http://www.opengis.net/ogc,PropertyIsNullType').
(line 116, column 50)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,PropertyIsBetweenType'](http://www.opengis.net/ogc,PropertyIsBetweenType').
(line 127, column 46)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,LowerBoundaryType'](http://www.opengis.net/ogc,LowerBoundaryType').
(line 132, column 46)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,UpperBoundaryType'](http://www.opengis.net/ogc,UpperBoundaryType').
(line 137, column 48)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,BinarySpatialOpType'](http://www.opengis.net/ogc,BinarySpatialOpType').
(line 151, column 37)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,BBOXType'](http://www.opengis.net/ogc,BBOXType').
(line 161, column 47)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,DistanceBufferType'](http://www.opengis.net/ogc,DistanceBufferType').
(line 172, column 41)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,DistanceType'](http://www.opengis.net/ogc,DistanceType').
(line 179, column 46)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,BinaryLogicOpType'](http://www.opengis.net/ogc,BinaryLogicOpType').
(line 191, column 45)sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of '[http://www.opengis.net/ogc,UnaryLogicOpType'](http://www.opengis.net/ogc,UnaryLogicOpType').
The SLD in question is actually valid, it’s the other issue, “A schema cannot contain two global components with the same name”, that happens multiple times in all failing tests.
On the local machine I cannot reproduce, I’ve tried with both Oracle JDK11 and OpenJDK11, no dice.
To setup the validation the code in parser creates a synthetic import making sure all the required XSD come from classpath
and are there, I’ve added a system out (that will need to be removed) to get the list of XSD, they are in the same order both locally
and on the build server.
I even downloaded the jars from the build server and re-run locally, nope, still works fine locally.
The debug statement that I’ve added is reporting no extras:
Setting schema location to http://www.w3.org/1999/xlink
jar:file:/var/jenkins/workspace/java11/./m2/org/geotools/xsd/gt-xsd-core/21-SNAPSHOT/gt-xsd-core-21-SNAPSHOT.jar!/org/geotools/xlink/xlinks.xsd http://www.w3.org/2001/SMIL20/
jar:file:/var/jenkins/workspace/java11/./m2/org/geotools/xsd/gt-xsd-gml3/21-SNAPSHOT/gt-xsd-gml3-21-SNAPSHOT.jar!/org/geotools/gml3/smil/smil20.xsd http://www.w3.org/2001/SMIL20/Language
jar:file:/var/jenkins/workspace/java11/./m2/org/geotools/xsd/gt-xsd-gml3/21-SNAPSHOT/gt-xsd-gml3-21-SNAPSHOT.jar!/org/geotools/gml3/smil/smil20-language.xsd http://www.opengis.net/gml
jar:file:/var/jenkins/workspace/java11/./m2/org/geotools/xsd/gt-xsd-gml3/21-SNAPSHOT/gt-xsd-gml3-21-SNAPSHOT.jar!/org/geotools/gml3/gml.xsd http://www.opengis.net/ogc
jar:file:/var/jenkins/workspace/java11/./m2/org/geotools/xsd/gt-xsd-filter/21-SNAPSHOT/gt-xsd-filter-21-SNAPSHOT.jar!/org/geotools/filter/v1_1/filter.xsd http://www.opengis.net/se
jar:file:/var/jenkins/workspace/java11/./m2/org/geotools/xsd/gt-xsd-sld/21-SNAPSHOT/gt-xsd-sld-21-SNAPSHOT.jar!/org/geotools/se/v1_1/FeatureStyle.xsd http://www.opengis.net/sld
jar:file:/var/jenkins/workspace/java11/./m2/org/geotools/xsd/gt-xsd-sld/21-SNAPSHOT/gt-xsd-sld-21-SNAPSHOT.jar!/org/geotools/sld/v1_1/StyledLayerDescriptor.xsd
Checkng online, it seems that the issue might be happening if one has multiple times the same XSD in the list, but it’s not the case
So… I’m at a loss. Is there anyone else that can reproduce (and hence debug) this issue?
Cheers
Andrea
···
== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.