Provider com.oracle.bmc.http.client.jersey.JerseyHttpProvider could not be instantiated
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 243
- Forks
- 171
- Avg merge
- 30m
- Merged PRs (30d)
- 4
Description
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'objectStorageClient' defined in class path resource [com/avalara/elr/dms/upload/configurations/OciConfig.class]: Failed to instantiate [com.oracle.bmc.objectstorage.ObjectStorageClient]: Factory method 'objectStorageClient' threw exception with message: com.oracle.bmc.http.client.HttpProvider: Provider com.oracle.bmc.http.client.jersey.JerseyHttpProvider could not be instantiated
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:645)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1357)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1187)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:289)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1573)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1519)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 52 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.oracle.bmc.objectstorage.ObjectStorageClient]: Factory method 'objectStorageClient' threw exception with message: com.oracle.bmc.http.client.HttpProvider: Provider com.oracle.bmc.http.client.jersey.JerseyHttpProvider could not be instantiated
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.lambda$instantiate$0(SimpleInstantiationStrategy.java:199)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiateWithFactoryMethod(SimpleInstantiationStrategy.java:88)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:168)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 65 common frames omitted
Caused by: java.util.ServiceConfigurationError: com.oracle.bmc.http.client.HttpProvider: Provider com.oracle.bmc.http.client.jersey.JerseyHttpProvider could not be instantiated
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586)
at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
at com.oracle.bmc.http.client.DefaultHolder.findHttpProvider(HttpProvider.java:44)
at com.oracle.bmc.http.client.DefaultHolder.getDefault(HttpProvider.java:34)
at com.oracle.bmc.http.client.HttpProvider.getDefault(HttpProvider.java:21)
at com.oracle.bmc.http.internal.BaseClient.<init>(BaseClient.java:99)
at com.oracle.bmc.http.internal.BaseSyncClient.<init>(BaseSyncClient.java:36)
at com.oracle.bmc.objectstorage.ObjectStorageClient.<init>(ObjectStorageClient.java:49)
at com.oracle.bmc.objectstorage.ObjectStorageClient$Builder.build(ObjectStorageClient.java:145)
at com.avalara.elr.dms.upload.configurations.OciConfig.objectStorageClient(OciConfig.java:38)
at com.avalara.elr.dms.upload.configurations.OciConfig$$SpringCGLIB$$0.CGLIB$objectStorageClient$1(<generated>)
at com.avalara.elr.dms.upload.configurations.OciConfig$$SpringCGLIB$$FastClass$$1.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:258)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:348)
at com.avalara.elr.dms.upload.configurations.OciConfig$$SpringCGLIB$$0.objectStorageClient(<generated>)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.lambda$instantiate$0(SimpleInstantiationStrategy.java:171)
... 68 common frames omitted
Caused by: java.lang.NoClassDefFoundError: javax/ws/rs/ProcessingException
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:421)
at java.base/java.lang.Class.forName(Class.java:412)
at com.oracle.bmc.http.client.jersey.JerseyHttpProvider.checkForApacheDependencies(JerseyHttpProvider.java:52)
at com.oracle.bmc.http.client.jersey.JerseyHttpProvider.<clinit>(JerseyHttpProvider.java:21)
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103)
at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:200)
at java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:549)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)
... 86 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.ProcessingException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
... 100 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:49324', transport: 'socket'
Process finished with exit code 0
Added Dependencies:
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<version>${oci.sdk.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-objectstorage</artifactId>
<version>${oci.sdk.version}</version>
</dependency>
<!-- Choose one of the HTTP client implementations -->
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common-httpclient-jersey</artifactId>
<version>${oci.sdk.version}</version>
</dependency>
Configuration Class
@Configuration
public class OciConfig {
private final String configFilePath = "<configFilePath>"; // Path to OCI config file
private final String profile = "<profile>"; // OCI profile name (usually "DEFAULT")
private final String bucketName = "<bucket-name>";
private final String namespaceName = "<namespace>";
@Bean
public AuthenticationDetailsProvider authenticationDetailsProvider() throws IOException {
// This will look for config file in default location ~/.oci/config
return new ConfigFileAuthenticationDetailsProvider(configFilePath, profile);
// Alternatively, if you want to specify a different config file location:
// return new ConfigFileAuthenticationDetailsProvider("/path/to/config", "DEFAULT");
}
@Bean
public ObjectStorageClient objectStorageClient(AuthenticationDetailsProvider auth) {
return ObjectStorageClient.builder()
.build(auth);
}
@Bean
public HttpProvider httpProvider() {
return new JerseyHttpProvider();
}
}
Java version: 17
Springboot version: 3.4.1
If someone can help me regarding this.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with OciConfig.objectStorageClient and the stack trace at JerseyHttpProvider.checkForApacheDependencies. Inspect the resolved dependencies for the missing javax.ws.rs.ProcessingException, then verify that ObjectStorageClient builds successfully and the Spring application starts without the provider-instantiation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100