Hi all,
I'm experiencing a consistent build failure on my box
on 2.5.x with imagemosaic.

The failure is:

Failed tests:
   crop(org.geotools.gce.imagemosaic.ImageMosaicReaderTest)
   alpha(org.geotools.gce.imagemosaic.ImageMosaicReaderTest)
   defaultParameterValue(org.geotools.gce.imagemosaic.ImageMosaicReaderTest)


I can reproduce the same in Eclipse. Since it's local to my machine
I investigated a little and found out that tests are failing
on the rgbAURL case, which points to a directory (not a shp file):
file:/home/aaime/devel/gt2.5.x/modules/plugin/imagemosaic/target/test-classes/org/geotools/gce/imagemosaic/test-data/rgba/

The contents of the directory are:

aa...@phoenix:~/devel/gt2.5.x/modules/plugin/imagemosaic$ ls 
/home/aaime/devel/gt2.5.x/modules/plugin/imagemosaic/target/test-classes/org/geotools/gce/imagemosaic/test-data/rgba/
error.txt               passA2006128193711.prj  passA2006128194218.png 
passA2006128194218.wld  passA2006128211927.prj
passA2006128193711.png  passA2006128193711.wld  passA2006128194218.prj 
passA2006128211927.png  passA2006128211927.wld

It took some time to figure out the actual exception because it's logged
at FINE level only, but it turned out to be a failure in building
the mosaic .shp/.properties files:


java.lang.NullPointerException
        at 
org.geotools.gce.imagemosaic.IndexBuilder$MosaicDirectoryWalker.handleFile(IndexBuilder.java:553)
        at org.apache.commons.io.DirectoryWalker.walk(DirectoryWalker.java:367)
        at org.apache.commons.io.DirectoryWalker.walk(DirectoryWalker.java:335)
        at 
org.geotools.gce.imagemosaic.IndexBuilder$MosaicDirectoryWalker.<init>(IndexBuilder.java:682)
        at org.geotools.gce.imagemosaic.IndexBuilder.run(IndexBuilder.java:962)
        at 
org.geotools.gce.imagemosaic.ImageMosaicUtils.createMosaic(ImageMosaicUtils.java:201)
        at 
org.geotools.gce.imagemosaic.ImageMosaicUtils.checkSource(ImageMosaicUtils.java:289)
        at 
org.geotools.gce.imagemosaic.ImageMosaicFormat.accepts(ImageMosaicFormat.java:196)
        at 
org.geotools.coverage.grid.io.GridFormatFinder.findFormats(GridFormatFinder.java:174)
        at 
org.geotools.coverage.grid.io.GridFormatFinder.findFormat(GridFormatFinder.java:203)
        at 
org.geotools.gce.imagemosaic.ImageMosaicReaderTest.getFormat(ImageMosaicReaderTest.java:337)
        at 
org.geotools.gce.imagemosaic.ImageMosaicReaderTest.imageMosaicCropTest(ImageMosaicReaderTest.java:359)
        at 
org.geotools.gce.imagemosaic.ImageMosaicReaderTest.crop(ImageMosaicReaderTest.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
        at 
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
        at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
        at 
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
        at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
        at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
        at 
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
        at 
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
        at 
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
        at 
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
        at 
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
        at 
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
        at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:36)
        at 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

The issue being globEnvelope == null.

I guess this is happening because of a different file order scanning on 
my ext4 file system compared to windows and ext3 on the build server.
Also, and again guessing, it's due to the mosaic stumbling into a file
that's not a coverage (a .prj, a .wld) before reding a file that
can be added.
Either the code stops relying on fileIndex to decide whether it's the
first file loaded or fileIndex is incremented only on successful reads
(suggestion, why don't you use the gloEnvelope itself as the sentinel
for the first file check?)

Cheers
Andrea


-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to