Groovy Build issues

175 views
Skip to first unread message

scott bortman

unread,
Feb 6, 2014, 10:39:52 PM2/6/14
to geos...@googlegroups.com
Hey Jared,

Just an FYI,   having some build issues on the master
branch.   Here is the message:

[ERROR] /Users/sbortman/projects/geoscript-groovy/src/main/groovy/geoscript/workspace/Database.groovy:[83,39] 1. ERROR in /Users/sbortman/projects/geoscript-groovy/src/main/groovy/geoscript/workspace/Database.groovy (at line 83)
(ds as JDBCDataStore).createIndex(new org.geotools.jdbc.Index(layerName, indexName, unique, fieldNames as String[]))
                                     ^^^^^^^^^^^^^^^^^^^^^^^
Groovy:unable to resolve class org.geotools.jdbc.Index

Funny thing is,   if I try 2 more times,   it gets to the test phase.   And that fails.  
The first errors seem to be with NetCDF stuff:

  drawToImage(geoscript.filter.ColorTestCase): javax.imageio.spi.ImageReaderSpi: Provider org.geotools.imageio.netcdf.NetCDFImageReaderSpi could not be instantiated: java.lang.NoClassDefFoundError: org/geotools/coverage/grid/io/FileSetManager

Any ideas?
--scottie

PS:  I'm on OSX Mavericks using JDK 1.7b51 if that helps.


jericks

unread,
Feb 6, 2014, 10:52:32 PM2/6/14
to geos...@googlegroups.com
Hi Scottie!

Something like this happened to me recently.  As far as I could tell, it was because the GeoTools SNAPSHOT jar were not being updated.  So, I deleted all 11-SNAPSHOT jars from my local repo with this command:

cd ~/.m2
find . -name 11-SNAPSHOT -exec rm -rf {} \;

And then I could build again.  If it helps, I just ran that command and did a mvn clean install and it compiled cleanly and all of the tests passed.  The Boundless CI server seems happy too:


Let me know how it goes.

Jared

scott bortman

unread,
Feb 6, 2014, 11:14:21 PM2/6/14
to geos...@googlegroups.com
Duh,   why didn't I think of that.   Actually,  I whacked my whole repo.   
All is well again,  thanks!     

Back to figuring out how the heck images are rendered in GeoTools....


--
--
You received this message because you are subscribed to the GeoScript mailing list.
To post to this group, send email to geos...@googlegroups.com
To unsubscribe from this group, send email to geoscript+...@googlegroups.com
Visit this group at http://groups.google.com/group/geoscript or see http://geoscript.org
 
---
You received this message because you are subscribed to the Google Groups "GeoScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoscript+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

scott bortman

unread,
Feb 7, 2014, 9:05:21 AM2/7/14
to geos...@googlegroups.com
Whoa,  spoke too soon:


import geoscript.layer.Format

def file = '/data/bmng2/200406.A1.tif' as File
def format = Format.getFormat(file)
def raster = format.read(file)

raster.dispose()

Causes:

java.util.ServiceConfigurationError: javax.imageio.spi.ImageReaderSpi: Provider org.geotools.imageio.netcdf.NetCDFImageReaderSpi could not be instantiated: java.lang.NoClassDefFoundError: Could not initialize class org.geotools.imageio.netcdf.NetCDFImageReaderSpi
at org.geotools.image.io.ImageIOExt.getImageInputStreamSPI(ImageIOExt.java:221)
at org.geotools.image.io.ImageIOExt.getImageInputStreamSPI(ImageIOExt.java:204)
at org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java:196)
at org.geotools.gce.geotiff.GeoTiffFormat.getReader(GeoTiffFormat.java:283)
at org.geotools.gce.geotiff.GeoTiffFormat$getReader.call(Unknown Source)
at geoscript.layer.Format.read(Format.groovy:192)
at geoscript.layer.Format$read$1.callCurrent(Unknown Source)
at geoscript.layer.Format.read(Format.groovy:111)
at geoscript.layer.Format.read(Format.groovy)
at geoscript.layer.Format$read$0.call(Unknown Source)
at ConsoleScript2.run(ConsoleScript2:5)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.geotools.imageio.netcdf.NetCDFImageReaderSpi
... 11 more


Missing dependency?

jericks

unread,
Feb 7, 2014, 5:39:04 PM2/7/14
to geos...@googlegroups.com
Hey Scottie!

Thank you for testing!  I forgot to add NetCDF support to the Format.getFormat(File file) method.  I just pushed a fix to the repo.  Also, with NetCDF you will have to pass in the raster name not the file in the read method.  This should work:

import geoscript.layer.Format

def file = '/data/bmng2/200406.A1.tif' as File
def format = Format.getFormat(file)
def raster = format.read("SOME NAME HERE")

raster.dispose()

That stack trace doesn't reflect what I was seeing though.  Do you have Java Advanced Imaging and ImageIO installed?

Jared

scott bortman

unread,
Feb 7, 2014, 6:28:53 PM2/7/14
to geos...@googlegroups.com
Jared,

Cool.   I'll give it a whirl.   Hopefully,  I'm wearing out my welcome with all the spam
I'm sending you!  :-)

Yes,  I usually install JAI and JAI ImageIO at the JDK level to avoid having EVERY
project depend on them.    I do a lot of imagery work,  if you haven't guessed already.  

--scottie

scott bortman

unread,
Feb 7, 2014, 7:44:39 PM2/7/14
to geos...@googlegroups.com
Compiles and all tests pass.   

But,  I'm still getting exceptions.   Attaching the stack trace.
I did a maven clean install before running.

Maybe I'll try whacking my repo again.


stacktrace.txt

jericks

unread,
Feb 8, 2014, 11:57:32 AM2/8/14
to geos...@googlegroups.com
Scottie,

I think I know whats going on. I noticed this error in the stack trace:

SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.

The same error was causing problems for me last night. Maven could compile and run all tests successfully, but running geoscript on the command line was failing because it couldn’t connect to the EPSG database (so everything using Projection was failing).  Wierd.  I fixed it by excluding log4j-over-slf4j from the netcdf dependency.  Here is the commit:


Could pull this change down, rebuild, and try again?

Thanks,
Jared

scott bortman

unread,
Feb 8, 2014, 12:34:40 PM2/8/14
to geos...@googlegroups.com
You sir,  are a Steely Eyed Missile Man  ;-)

Compiles,  Tests Pass,  and (most importantly),  works.

Thanks!
--scottie
Reply all
Reply to author
Forward
0 new messages