Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to get JMapFrame to work to visualize some feature. Unfortunately I keep getting errors although this test app can be started. Toolbars etc. are shown.

18.02.2011 16:44:38 org.geotools.renderer.lite.StreamingRenderer paint

SEVERE: null

java.lang.NullPointerException
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1771)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:722)

(full stack trace here)

My source code is here. (And pom.xml here)

I assume the problem must be anywhere in "myStyle". Is there maybe a default style?

share|improve this question

2 Answers 2

This one looks like the culprit:

Graphic graph = sb.createGraphic(null, new Mark[] { testMark }, null,
            sb.literalExpression(1), sb.attributeExpression("size"),
            sb.attributeExpression("rotation"));

you are creating graphic marker with a null graphic. I'm pretty sure you're hitting this issue (not an issue imo, more an error on the user side):

http://jira.codehaus.org/browse/GEOT-1772

share|improve this answer
    
Thanks for the answer. Unfortunately I cannot test it but if it works for anyone, I'll accept it. –  Philip Dec 27 '11 at 12:34
    
well, voting up wouldn't be a bad start ;-) –  unicoletti Dec 27 '11 at 13:37

From a quick scan it seems that you are trying to symbolize a line with a PointSymbolizer. The first thing to try would be to load a simple SLD file that you know works (build and test it in UDig). This would allow you be sure that it isn't a problem with your features. Then I'd add a logger and turn up the logging level before stepping through the program in a debugger to see what exactly is null.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.