Uploaded image for project: 'Apache Sedona'
  1. Apache Sedona
  2. SEDONA-478

Sedona 1.5.1 context initialization fails without GeoTools coverage

    XMLWordPrintableJSON

Details

    Description

      If GeoTools coverage module isn't on the classpath, UDF registration fails during context initialization:

      [info]   java.lang.NoClassDefFoundError: Could not initialize class org.apache.sedona.sql.UDF.Catalog$
      [info]   at org.apache.sedona.sql.UDF.UdfRegistrator$.registerAll(UdfRegistrator.scala:31)
      [info]   at org.apache.sedona.spark.SedonaContext$.create(SedonaContext.scala:51)
      [info]   ...
      [info]   Cause: java.lang.ExceptionInInitializerError: Exception scala.ScalaReflectionException: class org.geotools.coverage.grid.GridCoverage2D in JavaMirror with jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7 of type class jdk.internal.loader.ClassLoaders$AppClassLoader with classpath [<unknown>] and parent being jdk.internal.loader.ClassLoaders$PlatformClassLoader@4569b692 of type class jdk.internal.loader.ClassLoaders$PlatformClassLoader with classpath [<unknown>] and parent being primordial classloader with boot classpath [<unknown>] not found. [in thread "pool-1-thread-1"]
      [info]   at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:141)
      [info]   at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:29)
      [info]   at org.apache.spark.sql.sedona_sql.expressions.raster.RS_Union_Aggr$$typecreator1$1.apply(AggregateFunctions.scala:123)
      ...
      [info]   at org.apache.spark.sql.sedona_sql.expressions.raster.RS_Union_Aggr.<init>(AggregateFunctions.scala:123)
      [info]   at org.apache.sedona.sql.UDF.Catalog$.<init>(Catalog.scala:271)
      [info]   at org.apache.sedona.sql.UDF.Catalog$.<clinit>(Catalog.scala) 

      This is an issue for projects that don't want the full GeoTools suite, whether through the wrapper or not.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hygt Henry Genet
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m