1st I'm not sure if any one has tested beyond Java 11 yet. 2nd in the upgrade to Javal 11 a number of classes had to be moved to accommodate the new module system. See https://docs.geotools.org/stable/userguide/welcome/upgrade.html for more details.
Ian On Sat, 10 Aug 2019 at 06:23, Rob <rob_mil...@hotmail.com> wrote: > I’m attempting to use GeoTools 21.2 in a Java 12 project (upgrading from > GeoTools 14.1). I’ve updated the imports from vividsolutions to > locationtech. However, when my code runs and hits a call to CRS.decode() I > get the following error: java.lang.NoClassDefFoundError: Could not > initialize class org.geotools.referencing.cs.DefaultCoordinateSystemAxis > (see the stack trace below). > > > > The referencing jar is included in the project, is on the classpath, and > is imported in the class where the error is occurring. I cannot figure out > why I’m getting the NoClassDefFoundError. > > > > I would really appreciate any help you can provide. > > > > Rob Milton > > > > Exception in thread "Thread-41" java.lang.NoClassDefFoundError: Could not > initialize class org.geotools.referencing.cs.DefaultCoordinateSystemAxis > > at > org.geotools.referencing.factory.TransformedAuthorityFactory.<clinit>(TransformedAuthorityFactory.java:69) > > at > org.geotools.referencing.factory.epsg.DirectEpsgFactory.<init>(DirectEpsgFactory.java:532) > > at > org.geotools.referencing.factory.epsg.FactoryUsingSQL.<init>(FactoryUsingSQL.java:52) > > at > org.geotools.referencing.factory.epsg.FactoryUsingAnsiSQL.<init>(FactoryUsingAnsiSQL.java:121) > > at > org.geotools.referencing.factory.epsg.hsql.FactoryUsingHSQL.<init>(FactoryUsingHSQL.java:51) > > at > org.geotools.referencing.factory.epsg.hsql.ThreadedHsqlEpsgFactory$1.<init>(ThreadedHsqlEpsgFactory.java:319) > > at > org.geotools.referencing.factory.epsg.hsql.ThreadedHsqlEpsgFactory.createBackingStore(ThreadedHsqlEpsgFactory.java:319) > > at > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore0(ThreadedEpsgFactory.java:393) > > at > org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:434) > > at > org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:114) > > at > org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:218) > > at > org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:100) > > at > org.geotools.util.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:808) > > at > org.geotools.util.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:631) > > at > org.geotools.util.factory.FactoryRegistry.lambda$getFactories$0(FactoryRegistry.java:300) > > at > java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176) > > at > java.base/java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812) > > at > java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294) > > at > java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206) > > at > java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161) > > at > java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300) > > at > java.base/java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681) > > at org.geotools.util.LazySet.isEmpty(LazySet.java:98) > > at > org.geotools.referencing.factory.ManyAuthoritiesFactory.<init>(ManyAuthoritiesFactory.java:115) > > at > org.geotools.referencing.DefaultAuthorityFactory.getBackingFactory(DefaultAuthorityFactory.java:114) > > at > org.geotools.referencing.DefaultAuthorityFactory.<init>(DefaultAuthorityFactory.java:67) > > at > org.geotools.referencing.CRS.getAuthorityFactory(CRS.java:253) > > at org.geotools.referencing.CRS.decode(CRS.java:533) > > at org.geotools.referencing.CRS.decode(CRS.java:447) > > at > utilities.shapeFiles.BN_Shapefile.setTargetCRS(BN_Shapefile.java:635) > > at > utilities.shapeFiles.BN_Shapefile.initialize(BN_Shapefile.java:333) > > at > utilities.shapeFiles.BN_Shapefile.<init>(BN_Shapefile.java:289) > > at > module.GeoImageLoader.GeoImageLoader$1.run(GeoImageLoader.java:760) > > at java.base/java.lang.Thread.run(Thread.java:835) > _______________________________________________ > GeoTools-GT2-Users mailing list > GeoTools-GT2-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > -- Ian Turton
_______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users