Hi,

Currently OpenJUMP throws a NPE when trying to make a connection with a WMS and 
if the answer from the server is not what was expected 
Try this 
- Add WMS layer, use url http://demo.opengeo.org/geoserver/wms?SERVICE=WFS
- Press next
- Get NPE

It would better to tell user that something abnormal happened and print the 
message from the server if user presses the Show details button.

A harder to handle may be the case when WMS layer is already added to the map 
but then something goes wrong and server sends an error message in XML format 
instead of a map.  What happens now is that OJ does nothing. It can't show the 
map because server did not send it but it does not show or log the error 
message.

We can simulate this case. This is a working GetMap URL

http://demo.opengeo.org/geoserver/wms?
SERVICE=WMS&
REQUEST=GetMap&
SERVICE=WMS&
VERSION=1.1.0&
WIDTH=459&
HEIGHT=351&
LAYERS=topp:states&
TRANSPARENT=TRUE&
FORMAT=image%2Fpng&
BBOX=-124.731,15.078911764705884,-66.97,59.24908823529412&
SRS=EPSG:4326&
STYLES=

Now let's assume that there is some trouble on the server side and topp:states 
layer is not available.  The server will send an XML error message with MIME 
type application/vnd.ogc.se_xml

We can see how such an error message looks like by making a GetMap request with 
a non-existing layer

http://demo.opengeo.org/geoserver/wms?
SERVICE=WMS&
REQUEST=GetMap&
SERVICE=WMS&
VERSION=1.1.0&
WIDTH=459&
HEIGHT=351&
LAYERS=topp:foo&
TRANSPARENT=TRUE&
FORMAT=image%2Fpng&
BBOX=-124.731,15.078911764705884,-66.97,59.24908823529412&
SRS=EPSG:4326&
STYLES=

A good behavior would be to show the error message or print it to the log file. 
 OpenJUMP should do some brain work here: "I was asking for image/png but  got 
back something with a different MIME type, so it means that it is an error and 
I will tell it" .

It is possible that MIME types do not match exactly with MIME types like 
image/png; mode=8bit. However, if the response is of type 
application/vnd.ogc.se_xml it is certainly not an image and it could safely be 
reported as an error.

-Jukka Rahkonen-


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to