Gary W. Lucas ha scritto:
>
>
> I've been trying to run GeoTools 2.4-M1 and have been getting some
> mysterious exceptions.
> I was wondering whether anyone could point me in the right direction.
> The following occurs when
> I try to use the StreamingRenderer class to plot a ShapeFile. The
> shapefile is a global-scale map
> with simple polygons and nothing special in the SLD file except to draw
> lines. Although the
> picture appears, this exception is rather alarming and I suspect it
> means that even though the
> picture does appear something serious is going to go wrong downstream.
>
> Apr 9, 2007 12:50:44 PM org.geotools.renderer.lite.StreamingRenderer
> processStylers
> SEVERE: 0
> _ java.lang.ArrayIndexOutOfBoundsException_ _: 0
> at com.vividsolutions.jts.geom.GeometryCollection.getGeometryN(
> GeometryCollection.java:136 )
> at org.geotools.geometry.jts.GeomCollectionIterator.init(
> GeomCollectionIterator.java:82 )
> at org.geotools.geometry.jts.LiteShape2.getPathIterator(
> LiteShape2.java:578 )
> at org.geotools.geometry.jts.LiteShape2.getPathIterator(
> LiteShape2.java:643 )
Hum, yeah, this one looks bad, but funny, too. For some reason I don't
understand, the renderer is getting a geometry collection (a
multypolygon if you're playing with shapefile polygons) that's empty,
that is, it does not have a single geometry. And it's not protecting
itself against that case.
Also, I do believe this happens only if optimized data loading is not
enabled. You don't have this code there, right?
Map rendererParams = new HashMap();
rendererParams.put("optimizedDataLoadingEnabled", new Boolean(true));
renderer.setRendererHints(rendererParams);
Anyways, this has been reported already twice, GEOT-1139, GEOT-1154,
so I guess this is enough, I'm fixing it.
> _Also, the main thing I am trying to accomplish by moving to 2.4-M1 is
> to get GeoTiff images
> to plot. However I am getting the following Exception when I try to add
> GeoTiff image code.
> I am attempting to run GeoTools as part of an eclipse plug-in and I
> believe, but cannot absolutely be sure,
> that I've got the JAI stuff properly installed. Any suggestions?
>
> SEVERE: null
> java.lang.ExceptionInInitializerError
> at org.geotools.coverage.processing.DefaultProcessor.<clinit>( _
> DefaultProcessor.java:86_ )
...
> Caused by: _ java.lang.ClassCastException_ :
> com.sun.media.jai.imageioimpl.ImageReadWriteSpi
> at javax.media.jai.OperationRegistry.registerServices( _
> OperationRegistry.java:2047_ )
> at javax.media.jai.ThreadSafeOperationRegistry.registerServices( _
> ThreadSafeOperationRegistry.java:612_ )
> at javax.media.jai.OperationRegistry.initializeRegistry( _
> OperationRegistry.java:365_ )
> at javax.media.jai.JAI.<clinit>( _JAI.java:560_ )
Hum, this one is scary. OperationRegistry.registerServices is here:
https://jai.dev.java.net/source/browse/jai-core/src/share/classes/javax/media/jai/OperationRegistry.java?rev=1.1&view=markup
as you can see it looks for OperationRegistrySpi implementors in the SPI
subsystem and works against them. The classcast exception tells us that
apparently com.sun.media.jai.imageioimpl.ImageReadWriteSpi is not an
OperationRegistrySpi implementor. But in fact, it is, and it has been
for quite some time at least, see here:
https://jai-imageio-core.dev.java.net/source/browse/jai-imageio-core/src/share/classes/com/sun/media/jai/imageioimpl/ImageReadWriteSpi.java?rev=1.1&view=markup
Now, the two files are in separate jars. I see from you stack trace
that you're playing in an Eclipse environment, and there there are
classloading issues that would take any man out of mental sanity.
I'm not an RCP expert, but are you sure both JAI and JAI-ImageIO
are visible, exported, or in the buddy list, whatever is needed to
make both be seen by the same classloader just once?
I'd suggest you ask the uDig guys since they should have already
faced this kind of issue.
Cheers
Andrea
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users