Java.net.MalformedURLException when connecting to WMS
-----------------------------------------------------
Key: UDIG-1216
URL: http://jira.codehaus.org/browse/UDIG-1216
Project: uDIG
Issue Type: Bug
Components: wms
Affects Versions: UDIG 1.1.RC8
Environment: The project I'm involved in is an eclipse RCP based
application which is using components of UDIG in one of its perspectives. We
are currently using UDIG 1.1 RC8. In UDIG this exception never reaches the
surface (i don't no which component catches this) but in our project we get it
every time connecting a wms. This is not tested with 1.1RC9 since we didn't
make an upgrade yet.
Reporter: Tony Roth
Assigned To: Richard Gould
Priority: Minor
To create layers based on an wms server we do this stuff in our project:
IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
List<IService> services = serviceFactory.acquire(url);
List<IGeoResource> layer = new ArrayList<IGeoResource>();
for (IService service : services){
layer.addAll(service.members(null));
}
In "layer.addAll(service.members(null));" we get an
Java.net.MalformedURLException with the following stack trace:
java.net.MalformedURLException: no protocol:
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at
org.geotools.data.wms.xml.WMSComplexTypes$_OnlineResourceType.getValue(WMSComplexTypes.java:4613)
at
org.geotools.xml.handlers.ComplexElementHandler.endElement(ComplexElementHandler.java:156)
at org.geotools.xml.XMLSAXHandler.endElement(XMLSAXHandler.java:248)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:221)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:819)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:322)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:176)
at
org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:140)
at
org.geotools.data.wms.response.WMSGetCapabilitiesResponse.<init>(WMSGetCapabilitiesResponse.java:50)
at
org.geotools.data.wms.WMS1_0_0$GetCapsRequest.createResponse(WMS1_0_0.java:219)
at
org.geotools.data.ows.AbstractOpenWebService.internalIssueRequest(AbstractOpenWebService.java:371)
at org.geotools.data.wms.WebMapServer.issueRequest(WebMapServer.java:91)
at
net.refractions.udig.catalog.internal.wms.WMSServiceImpl$CustomWMS.issueRequest(WMSServiceImpl.java:353)
at
org.geotools.data.ows.AbstractOpenWebService.negotiateVersion(AbstractOpenWebService.java:172)
at
org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:77)
at org.geotools.data.wms.WebMapServer.<init>(WebMapServer.java:75)
at
net.refractions.udig.catalog.internal.wms.WMSServiceImpl$CustomWMS.<init>(WMSServiceImpl.java:343)
at
net.refractions.udig.catalog.internal.wms.WMSServiceImpl.getWMS(WMSServiceImpl.java:124)
at
net.refractions.udig.catalog.internal.wms.WMSServiceImpl.members(WMSServiceImpl.java:230)
at .... the class in our project
I debugged this stuff and found that in
java.net.URL
the constructor
public URL(URL context, String spec, URLStreamHandler handler)
is called with "new URL(null,null,null)"
The layers are created and the map works fine but every time we connect to a
wms we get the exception on stdout (or stderr). As I wrote in the environment
text field, in udig this never reaches the surface since the udig application
catches it somewhere but in our application it is put on stdout (or stderr)
and fills the logfile; we cannot catch this exception.
--
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
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel