Hi,
I'm facing an error where I'm trying to create the EPSG:4326 coordinate.
I'm using the GeoTools 20.3, added all those jar libraries to my build path.
I run the following program and got errors (see below). I suspect something
about my environment is not set up correctly, any thoughts?
Thanks,
import org.geotools.referencing.CRS;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
public class Testing
{
public static void main(String[] args)
{
try
{
CoordinateReferenceSystem crs = CRS.decode("EPSG:4326");
}
catch (FactoryException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Mar 29, 2019 9:38:12 AM org.geotools.factory.FactoryRegistry scanForPlugins
WARNING: Can't load a service for category "CRSAuthorityFactory". Cause is
"ServiceConfigurationError: org.opengis.referencing.crs.CRSAuthorityFactory:
Provider org.geotools.referencing.factory.epsg.CartesianAuthorityFactory could
not be instantiated".
java.util.ServiceConfigurationError:
org.opengis.referencing.crs.CRSAuthorityFactory: Provider
org.geotools.referencing.factory.epsg.CartesianAuthorityFactory could not be
instantiated
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$100(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at
org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:1042)
at
org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:921)
at
org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:951)
at
org.geotools.factory.FactoryRegistry.getFactories(FactoryRegistry.java:299)
at
org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:184)
at
org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactories(ReferencingFactoryFinder.java:454)
at
org.geotools.referencing.DefaultAuthorityFactory.getBackingFactory(DefaultAuthorityFactory.java:88)
at
org.geotools.referencing.DefaultAuthorityFactory.<init>(DefaultAuthorityFactory.java:68)
at org.geotools.referencing.CRS.getAuthorityFactory(CRS.java:246)
at org.geotools.referencing.CRS.decode(CRS.java:517)
at org.geotools.referencing.CRS.decode(CRS.java:440)
at ca.airradar.common.formats.rpf.Testing.main(Testing.java:14)
Caused by: java.lang.NoSuchFieldError: ONE
at
org.geotools.referencing.cs.DefaultCoordinateSystemAxis.<clinit>(DefaultCoordinateSystemAxis.java:541)
at org.geotools.referencing.cs.AbstractCS.<clinit>(AbstractCS.java:80)
at
org.geotools.referencing.crs.DefaultEngineeringCRS.<clinit>(DefaultEngineeringCRS.java:79)
at
org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.<clinit>(CartesianAuthorityFactory.java:55)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
... 15 more
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize
class org.geotools.referencing.cs.DefaultCoordinateSystemAxis
at
org.geotools.referencing.factory.TransformedAuthorityFactory.<clinit>(TransformedAuthorityFactory.java:70)
at
org.geotools.referencing.factory.epsg.DirectEpsgFactory.<init>(DirectEpsgFactory.java:533)
at
org.geotools.referencing.factory.epsg.FactoryUsingSQL.<init>(FactoryUsingSQL.java:53)
at
org.geotools.referencing.factory.epsg.FactoryUsingAnsiSQL.<init>(FactoryUsingAnsiSQL.java:122)
at
org.geotools.referencing.factory.epsg.FactoryUsingHSQL.<init>(FactoryUsingHSQL.java:51)
at
org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory$1.<init>(ThreadedHsqlEpsgFactory.java:312)
at
org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory.createBackingStore(ThreadedHsqlEpsgFactory.java:312)
at
org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore0(ThreadedEpsgFactory.java:394)
at
org.geotools.referencing.factory.epsg.ThreadedEpsgFactory.createBackingStore(ThreadedEpsgFactory.java:435)
at
org.geotools.referencing.factory.DeferredAuthorityFactory.getBackingStore(DeferredAuthorityFactory.java:115)
at
org.geotools.referencing.factory.BufferedAuthorityFactory.isAvailable(BufferedAuthorityFactory.java:219)
at
org.geotools.referencing.factory.DeferredAuthorityFactory.isAvailable(DeferredAuthorityFactory.java:101)
at
org.geotools.factory.FactoryRegistry.isAvailable(FactoryRegistry.java:809)
at
org.geotools.factory.FactoryRegistry.isAcceptable(FactoryRegistry.java:632)
at
org.geotools.factory.FactoryRegistry.lambda$getFactories$0(FactoryRegistry.java:301)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.tryAdvance(Unknown Source)
at
java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(Unknown
Source)
at
java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(Unknown
Source)
at
java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(Unknown
Source)
at
java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(Unknown
Source)
at java.util.Spliterators$1Adapter.hasNext(Unknown Source)
at org.geotools.resources.LazySet.isEmpty(LazySet.java:99)
at
org.geotools.referencing.factory.ManyAuthoritiesFactory.<init>(ManyAuthoritiesFactory.java:116)
at
org.geotools.referencing.DefaultAuthorityFactory.getBackingFactory(DefaultAuthorityFactory.java:115)
at
org.geotools.referencing.DefaultAuthorityFactory.<init>(DefaultAuthorityFactory.java:68)
at org.geotools.referencing.CRS.getAuthorityFactory(CRS.java:246)
at org.geotools.referencing.CRS.decode(CRS.java:517)
at org.geotools.referencing.CRS.decode(CRS.java:440)
at ca.airradar.common.formats.rpf.Testing.main(Testing.java:14)
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel