WFSCapabilitiesComplexTypes does not support empty OnlineResource
-----------------------------------------------------------------
Key: GEOT-3255
URL: http://jira.codehaus.org/browse/GEOT-3255
Project: GeoTools
Issue Type: Bug
Components: data wfs
Affects Versions: 2.6.5
Environment: win32, win64, linux, OGC WFS 1.0.0
Reporter: Matthias Kretschmar
The OGC-WFS Specification marks the element
<WFS_Capabilities><Service><OnlineResource/> as an element with unspecified
content (see http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd). This
means, the content of this element can also be empty. In this case the class
org.geotools.xml.wfs.WFSCapabilitiesComplexType (line 1993 to 2000) tries to
create an URL-Object from an URI-Object that is not absolute. This ends in an
Exception thrown by the URI-Object.
I think, a solution could look like this:
//line 1993
if (elements[4].getName().equals(value[i].getElement().getName())) {
try {
URI uri = (URI) value[i].getValue();
if(uri.isAbsolute())
service.setOnlineResource(uri.toURL());
else //i.e. if uri is empty
service.setOnlineResource(new
java.net.URL("http://localhost/"));//create dummy url
} catch (MalformedURLException e1) {
throw new SAXException(e1);
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel