locationtech / geogig

GeoGig project
Other
403 stars 80 forks source link

Error injecting constructor on geogig init #465

Closed jderekito closed 5 years ago

jderekito commented 6 years ago

Hello, I am running GeoGig on Windows with Postgres 9.6. When attempting to initialize a geogig repo from the DOS command line I get the following error:

com.google.inject.ProvisionException: Unable to provision, see the following error:

1) Error injecting constructor, java.lang.ExceptionInInitializerError
  at org.locationtech.geogig.rocksdb.RocksdbObjectDatabase.<init>(Unknown Source)
  while locating org.locationtech.geogig.rocksdb.RocksdbObjectDatabase
  at org.locationtech.geogig.cli.CLIContextBuilder.bind(CLIContextBuilder.java:119) (via modules: com.google.inject.util.Modules$OverrideModule -> org.locationtech.geogig.cli.CLIContextBuilder$DefaultPlugins)
  while locating org.locationtech.geogig.storage.ObjectDatabase annotated with @com.google.inject.multibindings.Element(setName=,uniqueId=30, type=MAPBINDER, keyType=org.locationtech.geogig.storage.VersionedFormat)

Any help in sorting this out would be greatly appreciated. I have verified that the geogig bin dir is on the system path.

Thanks, Derek

dwohlfahrt commented 5 years ago

I'm getting the same issue but I'm on a MacBook Pro running Mojave 10.14.3, and my java version is as follows:

$ java --version
java 11.0.2 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

Lastly, here's a full stack trace when i run geogig init

com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, java.lang.ExceptionInInitializerError
  at org.locationtech.geogig.rocksdb.RocksdbObjectDatabase.<init>(Unknown Source)
  while locating org.locationtech.geogig.rocksdb.RocksdbObjectDatabase
  at org.locationtech.geogig.cli.CLIContextBuilder.bind(CLIContextBuilder.java:119) (via modules: com.google.inject.util.Modules$OverrideModule -> org.locationtech.geogig.cli.CLIContextBuilder$DefaultPlugins)
  while locating org.locationtech.geogig.storage.ObjectDatabase annotated with @com.google.inject.multibindings.Element(setName=,uniqueId=22, type=MAPBINDER, keyType=org.locationtech.geogig.storage.VersionedFormat)

1 error
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
    at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:104)
    at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:104)
    at com.google.inject.multibindings.MapBinder$RealMapBinder$ValueProvider.get(MapBinder.java:746)
    at org.locationtech.geogig.di.FormatSelector.get(FormatSelector.java:41)
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
    at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
    at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    at org.locationtech.geogig.di.GuiceContext.getInstance(GuiceContext.java:72)
    at org.locationtech.geogig.di.GuiceContext.getDecoratedInstance(GuiceContext.java:77)
    at org.locationtech.geogig.di.GuiceContext.objectDatabase(GuiceContext.java:118)
    at org.locationtech.geogig.repository.impl.RepositoryImpl.configure(RepositoryImpl.java:95)
    at org.locationtech.geogig.porcelain.InitOp._call(InitOp.java:167)
    at org.locationtech.geogig.porcelain.InitOp._call(InitOp.java:64)
    at org.locationtech.geogig.repository.AbstractGeoGigOp.call(AbstractGeoGigOp.java:154)
    at org.locationtech.geogig.cli.porcelain.Init.runInternal(Init.java:118)
    at org.locationtech.geogig.cli.AbstractCommand.run(AbstractCommand.java:68)
    at org.locationtech.geogig.cli.GeogigCLI.executeInternal(GeogigCLI.java:532)
    at org.locationtech.geogig.cli.GeogigCLI.execute(GeogigCLI.java:368)
    at org.locationtech.geogig.cli.app.CLI.run(CLI.java:95)
    at org.locationtech.geogig.cli.app.CLI.main(CLI.java:113)
Caused by: java.lang.ExceptionInInitializerError
    at org.locationtech.geogig.storage.datastream.DataStreamSerializationFactoryV2.<init>(DataStreamSerializationFactoryV2.java:52)
    at org.locationtech.geogig.storage.datastream.DataStreamSerializationFactoryV2.<clinit>(DataStreamSerializationFactoryV2.java:43)
    at org.locationtech.geogig.storage.datastream.SerializationFactoryProxy.<clinit>(SerializationFactoryProxy.java:44)
    at org.locationtech.geogig.storage.impl.AbstractObjectStore.<init>(AbstractObjectStore.java:49)
    at org.locationtech.geogig.rocksdb.RocksdbObjectStore.<init>(RocksdbObjectStore.java:95)
    at org.locationtech.geogig.rocksdb.RocksdbObjectStore.<init>(RocksdbObjectStore.java:92)
    at org.locationtech.geogig.rocksdb.RocksdbObjectDatabase.<init>(RocksdbObjectDatabase.java:51)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:86)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
    ... 29 more
Caused by: java.lang.IllegalArgumentException: org.geotools.styling.StyleFactory is not an ImageIO SPI class
    at java.desktop/javax.imageio.spi.ServiceRegistry.checkClassAllowed(ServiceRegistry.java:722)
    at java.desktop/javax.imageio.spi.ServiceRegistry.<init>(ServiceRegistry.java:117)
    at org.geotools.factory.FactoryRegistry.<init>(FactoryRegistry.java:155)
    at org.geotools.factory.FactoryCreator.<init>(FactoryCreator.java:91)
    at org.geotools.factory.CommonFactoryFinder.getServiceRegistry(CommonFactoryFinder.java:76)
    at org.geotools.factory.CommonFactoryFinder.lookup(CommonFactoryFinder.java:346)
    at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:300)
    at org.geotools.feature.AttributeTypeBuilder.<init>(AttributeTypeBuilder.java:192)
    at org.geotools.feature.simple.SimpleFeatureTypeBuilder.<init>(SimpleFeatureTypeBuilder.java:196)
    at org.geotools.feature.simple.SimpleFeatureTypeBuilder.<init>(SimpleFeatureTypeBuilder.java:186)
    at org.locationtech.geogig.storage.datastream.FormatCommonV2.<clinit>(FormatCommonV2.java:131)
    ... 53 more
11:11:43.853 [main] ERROR o.locationtech.geogig.cli.GeogigCLI - Can't access repository at 'file:/Users/dwohlfahrt/workspace/geogig/repo/.geogig'
java.lang.IllegalArgumentException: org.geotools.styling.StyleFactory is not an ImageIO SPI class
    at java.desktop/javax.imageio.spi.ServiceRegistry.checkClassAllowed(ServiceRegistry.java:722) ~[na:na]
    at java.desktop/javax.imageio.spi.ServiceRegistry.<init>(ServiceRegistry.java:117) ~[na:na]
    at org.geotools.factory.FactoryRegistry.<init>(FactoryRegistry.java:155) ~[gt-metadata-18.0.jar:na]
    at org.geotools.factory.FactoryCreator.<init>(FactoryCreator.java:91) ~[gt-metadata-18.0.jar:na]
    at org.geotools.factory.CommonFactoryFinder.getServiceRegistry(CommonFactoryFinder.java:76) ~[gt-api-18.0.jar:na]
    at org.geotools.factory.CommonFactoryFinder.lookup(CommonFactoryFinder.java:346) ~[gt-api-18.0.jar:na]
    at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:300) ~[gt-api-18.0.jar:na]
    at org.geotools.feature.AttributeTypeBuilder.<init>(AttributeTypeBuilder.java:192) ~[gt-main-18.0.jar:na]
    at org.geotools.feature.simple.SimpleFeatureTypeBuilder.<init>(SimpleFeatureTypeBuilder.java:196) ~[gt-main-18.0.jar:na]
    at org.geotools.feature.simple.SimpleFeatureTypeBuilder.<init>(SimpleFeatureTypeBuilder.java:186) ~[gt-main-18.0.jar:na]
    at org.locationtech.geogig.storage.datastream.FormatCommonV2.<clinit>(FormatCommonV2.java:131) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.storage.datastream.DataStreamSerializationFactoryV2.<init>(DataStreamSerializationFactoryV2.java:52) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.storage.datastream.DataStreamSerializationFactoryV2.<clinit>(DataStreamSerializationFactoryV2.java:43) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.storage.datastream.SerializationFactoryProxy.<clinit>(SerializationFactoryProxy.java:44) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.storage.impl.AbstractObjectStore.<init>(AbstractObjectStore.java:49) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.rocksdb.RocksdbObjectStore.<init>(RocksdbObjectStore.java:95) ~[geogig-rocksdb-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.rocksdb.RocksdbObjectStore.<init>(RocksdbObjectStore.java:92) ~[geogig-rocksdb-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.rocksdb.RocksdbObjectDatabase.<init>(RocksdbObjectDatabase.java:51) ~[geogig-rocksdb-1.2.0.jar:1.2.0]
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
    at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:86) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:104) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:104) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.multibindings.MapBinder$RealMapBinder$ValueProvider.get(MapBinder.java:746) ~[guice-multibindings-4.0.jar:na]
    at org.locationtech.geogig.di.FormatSelector.get(FormatSelector.java:41) ~[geogig-core-1.2.0.jar:1.2.0]
    at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) ~[guice-4.0-no_aop.jar:na]
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012) ~[guice-4.0-no_aop.jar:na]
    at org.locationtech.geogig.di.GuiceContext.getInstance(GuiceContext.java:72) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.di.GuiceContext.getDecoratedInstance(GuiceContext.java:77) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.di.GuiceContext.objectDatabase(GuiceContext.java:118) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.repository.impl.RepositoryImpl.configure(RepositoryImpl.java:95) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.porcelain.InitOp._call(InitOp.java:167) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.porcelain.InitOp._call(InitOp.java:64) ~[geogig-core-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.repository.AbstractGeoGigOp.call(AbstractGeoGigOp.java:154) ~[geogig-api-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.cli.porcelain.Init.runInternal(Init.java:118) ~[geogig-cli-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.cli.AbstractCommand.run(AbstractCommand.java:68) ~[geogig-cli-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.cli.GeogigCLI.executeInternal(GeogigCLI.java:532) ~[geogig-cli-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.cli.GeogigCLI.execute(GeogigCLI.java:368) ~[geogig-cli-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.cli.app.CLI.run(CLI.java:95) ~[geogig-cli-app-1.2.0.jar:1.2.0]
    at org.locationtech.geogig.cli.app.CLI.main(CLI.java:113) ~[geogig-cli-app-1.2.0.jar:1.2.0]
Can't access repository at 'file:/Users/dwohlfahrt/workspace/geogig/repo/.geogig'

Any help would be much appreciated!!

groldan commented 5 years ago

Hi, geogig currently runs on Java 8, so you'll need a Java8 JRE.

careyshan commented 4 years ago

Hi,

I switched my java version to Java 8 and still get the same result