Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsatisfiedDependencyException when using oci-java-sdk in Spring Boot #590

Open
psilberk opened this issue Apr 9, 2024 · 0 comments
Open
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@psilberk
Copy link
Member

psilberk commented Apr 9, 2024

Testing a super simple project in Spring Boot with OCI Java SDK for OCI Object Storage ends with this error:

java.lang.IllegalStateException: Request failed with parameters: value=, key=, OCI_PROFILE=DEFAULT, object_url=https://objectstorage.us-phoenix-1.oraclecloud.com/n/oracleonpremjava/b/bucket1/o/payload_ojdbc_file.json, AUTHENTICATION=API_KEY
at oracle.jdbc.provider.oci.OciResourceFactory.request(OciResourceFactory.java:112) ~[ojdbc-provider-oci-1.0.0.jar:na]
at oracle.jdbc.provider.oci.configuration.OciObjectStorageProvider.getJson(OciObjectStorageProvider.java:83) ~[ojdbc-provider-oci-1.0.0.jar:na]
at oracle.jdbc.driver.OracleConfigurationJsonProvider.retrieveProperties(OracleConfigurationJsonProvider.java:164) ~[ojdbc11-23.4.0.23.00.jar:23.4.0.23.00]
at oracle.jdbc.driver.OracleConfigurationJsonProvider.getConnectionProperties(OracleConfigurationJsonProvider.java:128) ~[ojdbc11-23.4.0.23.00.jar:23.4.0.23.00]
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:740) ~[ojdbc11-23.4.0.23.00.jar:23.4.0.23.00]
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:656) ~[ojdbc11-23.4.0.23.00.jar:23.4.0.23.00]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158) ~[spring-jdbc-5.3.10.jar:5.3.10]
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116) ~[spring-jdbc-5.3.10.jar:5.3.10]
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79) ~[spring-jdbc-5.3.10.jar:5.3.10]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:330) ~[spring-jdbc-5.3.10.jar:5.3.10]
at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:184) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateDefaultDdlAutoProvider.getDefaultDdlAuto(HibernateDefaultDdlAutoProvider.java:42) ~[spring-boot-autoconfigure-2.5.5.jar:2.5.5]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.lambda$getVendorProperties$1(HibernateJpaConfiguration.java:130) ~[spring-boot-autoconfigure-2.5.5.jar:2.5.5]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings.getDdlAuto(HibernateSettings.java:41) ~[spring-boot-autoconfigure-2.5.5.jar:2.5.5]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.determineDdlAuto(HibernateProperties.java:143) ~[spring-boot-autoconfigure-2.5.5.jar:2.5.5]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.getAdditionalProperties(HibernateProperties.java:103) ~[spring-boot-autoconfigure-2.5.5.jar:2.5.5]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties.determineHibernateProperties(HibernateProperties.java:95) ~[spring-boot-autoconfigure-2.5.5.jar:2.5.5]
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.getVendorProperties(HibernateJpaConfiguration.java:132) ~[spring-boot-autoconfigure-2.5.5.jar:2.5.5]
at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.entityManagerFactory(JpaBaseConfiguration.java:132) ~[spring-boot-autoconfigure-2.5.5.jar:2.5.5]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.10.jar:5.3.10]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.10.jar:5.3.10]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.10.jar:5.3.10]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.10.jar:5.3.10]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.5.jar:2.5.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.5.jar:2.5.5]
at com.nexxa.corebe.CoreBackend.main(CoreBackend.java:13) ~[classes/:na]
Caused by: java.lang.IllegalStateException: Error occurs while acquiring Object Storage client
at oracle.jdbc.provider.oci.objectstorage.ObjectFactory.request(ObjectFactory.java:128) ~[ojdbc-provider-oci-1.0.0.jar:na]
at oracle.jdbc.provider.oci.OciResourceFactory.request(OciResourceFactory.java:109) ~[ojdbc-provider-oci-1.0.0.jar:na]
... 50 common frames omitted
Caused by: com.oracle.bmc.model.BmcException: Error returned by GetObject operation in ObjectStorage service.(-1, null, false) Unknown error
Timestamp: 2024-04-09T05:55:11.754Z
Client version: Oracle-JavaSDK/3.33.0
Request Endpoint: https://objectstorage.us-phoenix-1.oraclecloud.com/n/oracleonpremjava/b/bucket1/o/payload_ojdbc_file.json
Troubleshooting Tips: See https://docs.oracle.com/en-us/iaas/Content/API/References/apierrors.htm#apierrors_-1__-1_ for more information about resolving this error
Also see https://docs.oracle.com/iaas/api/#/en/objectstorage/20160918/Object/GetObject for details on this operation's requirements.
To get more info on the failing request, you can enable debug level logs as mentioned in Using SLF4J for Logging section in https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconfig.htm.
If you are unable to resolve this ObjectStorage issue, please contact Oracle support and provide them this full error message.
at com.oracle.bmc.model.BmcException.createClientSide(BmcException.java:221) ~[oci-java-sdk-common-3.33.0.jar:na]
at com.oracle.bmc.http.internal.ClientCall.callSync(ClientCall.java:1105) ~[oci-java-sdk-common-3.33.0.jar:na]
at com.oracle.bmc.objectstorage.ObjectStorageClient.getObject(ObjectStorageClient.java:1018) ~[oci-java-sdk-objectstorage-generated-3.33.0.jar:na]
at oracle.jdbc.provider.oci.objectstorage.ObjectFactory.request(ObjectFactory.java:114) ~[ojdbc-provider-oci-1.0.0.jar:na]
... 51 common frames omitted
Caused by: org.glassfish.hk2.api.MultiException: A MultiException has 1 exceptions. They are:

  1. org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl(requiredType=int,parent=DaemonClientAsyncExecutorProvider,qualifiers={@javax.inject.Named(value="ClientAsyncThreadPoolSize")},position=0,optional=false,self=false,unqualified=null,2111700021)

             at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:51) ~[hk2-locator-2.6.1.jar:na]
             at org.jvnet.hk2.internal.Utilities.justCreate(Utilities.java:1055) ~[hk2-locator-2.6.1.jar:na]
             at org.jvnet.hk2.internal.ServiceLocatorImpl.create(ServiceLocatorImpl.java:968) ~[hk2-locator-2.6.1.jar:na]
             at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1072) ~[hk2-locator-2.6.1.jar:na]
             at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:1064) ~[hk2-locator-2.6.1.jar:na]
             at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.createAndInitialize(AbstractHk2InjectionManager.java:189) ~[jersey-hk2-2.33.jar:na]
             at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.createAndInitialize(ImmediateHk2InjectionManager.java:30) ~[jersey-hk2-2.33.jar:na]
             at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
             at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]
             at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[na:na]
             at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
             at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
             at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) ~[na:na]
             at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) ~[na:na]
             at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
             at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
             at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
             at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
             at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
             at org.glassfish.jersey.process.internal.AbstractExecutorProvidersConfigurator.registerExecutors(AbstractExecutorProvidersConfigurator.java:65) ~[jersey-common-2.33.jar:na]
             at org.glassfish.jersey.client.ClientExecutorProvidersConfigurator.init(ClientExecutorProvidersConfigurator.java:139) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:452) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:317) ~[jersey-common-2.33.jar:na]
             at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:814) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:220) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:132) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:92) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:88) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:77) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.client.JerseyInvocation$AsyncInvoker.method(JerseyInvocation.java:558) ~[jersey-client-2.33.jar:na]
             at org.glassfish.jersey.client.JerseyCompletionStageRxInvoker.method(JerseyCompletionStageRxInvoker.java:31) ~[jersey-client-2.33.jar:na]
             at com.oracle.bmc.http.client.jersey.JerseyHttpRequest.execute(JerseyHttpRequest.java:237) ~[oci-java-sdk-common-httpclient-jersey-3.33.0.jar:na]
             at com.oracle.bmc.http.internal.ClientCall.callAsyncImpl(ClientCall.java:1000) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.http.internal.ClientCall.callAsyncTokenRefresh(ClientCall.java:927) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.retrier.BmcGenericRetrier.doFunctionCall(BmcGenericRetrier.java:175) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.retrier.BmcGenericRetrier.doFunctionCallAsync(BmcGenericRetrier.java:181) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.retrier.BmcGenericRetrier.lambda$executeAsync$3(BmcGenericRetrier.java:119) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.waiter.GenericWaiter.executeAsync(GenericWaiter.java:109) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.waiter.GenericWaiter.executeAsync(GenericWaiter.java:98) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.retrier.BmcGenericRetrier.executeAsync(BmcGenericRetrier.java:112) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.http.internal.ClientCall.callAsyncWithRetrier(ClientCall.java:917) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.http.internal.ClientCall.callAsync0(ClientCall.java:864) ~[oci-java-sdk-common-3.33.0.jar:na]
             at com.oracle.bmc.http.internal.ClientCall.callSync(ClientCall.java:1101) ~[oci-java-sdk-common-3.33.0.jar:na]
             ... 53 common frames omitted
    

Caused by: org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl(requiredType=int,parent=DaemonClientAsyncExecutorProvider,qualifiers={@javax.inject.Named(value="ClientAsyncThreadPoolSize")},position=0,optional=false,self=false,unqualified=null,2111700021)
... 96 common frames omitted

@bhagwatvyas bhagwatvyas added the SDK Issue pertains to the SDK itself and not specific to any service label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

2 participants