[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] NPE in BasicWMSRenderer2
|
A null check is not sufficient. THe reason this happens is because
the renderer needs to determine the EPSG code of the map however if
the first layer added to the map provided its own WKT then the EPSG
code is not present in the CRS object. In 1.1 I added a section that
looks up the code. I guess I didn't port it to trunk. The EPSG
lookup code is different on trunk so only the code in the 1.1 renderer
needs to be ported to trunk. I will try to find time to do this.
Jesse
On 10-Oct-08, at 5:26 PM, Emily Gouge wrote:
Thanks for hunting this down. I added an empty and null check to
the code; so try it out. Hopefully this fix will work for you.
Emily
Ugo Taddei wrote:
Hello,
Emily Gouge wrote:
Hello Ugo,
I can't reproduce this with our test wms server. Any chance you
can share your wms server url?
Unfortunately not. It's behind the firewall. It's not the WMS, as
I've tested with a GeoServer 1.6.3, a GS 1.7, a deegree WMS and
another WMS.
So I had a look and think I've found the problem (line 223):
List<Layer> wmsLayers = getWMSLayers();
wmsLayer is empty. Further down:
String requestCRScode = findRequestCRS(wmsLayers, getViewportCRS(),
getContext().getMap());
requestCRScode is null and the cause of the exception throw in the
next line.
CoordinateReferenceSystem requestCRS = CRS.decode(requestCRScode);
Fix is probably simply
if (wmsLayers.isEmpty()) {
return;
}
Cheers,
Ugo
Ugo Taddei wrote:
Hello,
after an SVN update, and libs/refresh.xml I get this
!ENTRY net.refractions.udig.catalog.internal.wms 4 0 2008-10-09
09:21:23.536
!MESSAGE GetCapabilities: http://***.***.***.***/***/wms?
REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS
15
net.refractions.udig.project.render.RenderException:
java.lang.NullPointerException
at
net
.refractions
.udig
.render
.internal
.wms.basic.BasicWMSRenderer2.render(BasicWMSRenderer2.java:316)
at
net
.refractions
.udig
.render
.internal
.wms.basic.BasicWMSRenderer2.render(BasicWMSRenderer2.java:161)
at
net
.refractions
.udig
.project
.internal.render.impl.RenderJob.startRendering(RenderJob.java:106)
at
net
.refractions
.udig.project.internal.render.impl.RenderJob.run(RenderJob.java:
211)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
at org.geotools.referencing.CRS.decode(CRS.java:419)
!ENTRY net.refractions.udig.render.wms.basic 1 0 2008-10-09
09:21:24.821
!MESSAGE WARNING: WMS Renderer contains no layers.
This happens when udig starts, and a WMS layer is unchecked (in
the layers list). When I make the layer visible, the exception
goes. This was working yesterday, and appeared after a general
update.
Any ideas?
Cheers,
Ugo
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel