Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] uDIG-1.1.1 NullPointerException on ColorBrewer.

Hey Craig:

I found a very useful comment at that line on geotools trunk.

        // force to lower case with US locale for http://jira.codehaus.org/browse/UDIG-1265
        String paletteSet = type.getName().toLowerCase(Locale.US); 

So if we patch GeoTools 2.2.x with the above couple of lines we should be good to go. Is this something I can talk you through?

To make the patch yourself and try it out locally:

- cd 2.2.x
- edit ColorBrewer line 301 to match the above (ie specify use of Locale.US to preserve comma handling)
- mvn clean install
- run refresh.xml to copy the jars into net.refractions.udig.libs/libs
- press F5 in the above directory so that eclipse notices the new jars

To debug geotools I generally have a checkout of the geotools source code on my hard drive; and then associate any of the geotools jars with the appropriate directory. You can then step through the code like normal.

When I need to fix the code I:
- change .m2/settings.xml to have <offline>true</offline>  so that it only checks for jars locally
- change the geotools class
- quickly run "mvn install -Dmaven.test.skip=true"
- run refresh.xml to pick up the jars
- press "F5" in the net.refractions.udig.libs/lib folder so that eclipse notices the new jar

Jody


On 13/09/2009, at 8:36 AM, Craig Taverner wrote:

Hi,

We have a user in Turkey that is getting a strange exception starting uDIG-1.1.1 (actually our RCP app based on SDK from 1.1.1). The plugin net.refractions.udig.project.ui fails to start, and the core exception is a NullPointerException in ColorBrewer.loadPalettes(ColorBrewer.java:301):
Caused by: java.lang.NullPointerException
at org.geotools.brewer.color.ColorBrewer.loadPalettes(ColorBrewer.java:301)
at org.geotools.brewer.color.ColorBrewer.loadPalettes(ColorBrewer.java:266)
at org.geotools.brewer.color.ColorBrewer.instance(ColorBrewer.java:78)
at net.refractions.udig.ui.PlatformGIS.getColorBrewer(PlatformGIS.java:228)
The interesting thing about this is no-one else has the error, and when I did a google search I found an identical report from a Turkish uDIG user last November at http://lists.refractions.net/pipermail/udig-users/2008-November/000379.html (but he did not respond to Jesses questions about OS, drives, etc.)

So this seems likely to be related to the Turkish locale. I asked the user about OS and display and the answers are:
  • WinXP SP2 (core2 duo, 2GB ram)
  • ATI Radeon X2300 1400x900 32-bit color (multiple monitors)
The screenshots he sent seemed to all be in English, not Turkish, so I wondered if the bug only occurs with English Language on Turkish Locale. I'll try ask the user more about that, but wondered if anyone has seen something like this before, and had any ideas on how to debug it? I often debug uDIG code, but have not (yet) gone into Geotools.

Regards, Craig
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top