Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provider com.oracle.bmc.http.client.jersey.JerseyHttpProvider could not be instantiated #660

Open
@ayush4190

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$doGetBean0ドル(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$instantiate0ドル(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.ServiceLoader3ドル.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$objectStorageClient1ドル(<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$instantiate0ドル(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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /