I'm trying to create a Spring Boot Application that is able to reach out to Azure Storage.
Here are some of the Dependencies I've attempted to declare in build.gradle
thus far...
implementation 'com.azure:azure-storage-blob:+' // Current Dependency
implementation 'com.azure.spring:azure-spring-boot-starter-storage:+' // Previous Dependency
Both give me access to the BlobServiceClient
class which I'm using to access my Azure Blob Container.
In my application.properties
file, I have the following properties:
#Storage settings
# Current Attempt
azure.connection=${STORAGE_ACCOUNT_CONNECTION}
# Previous Attempt
azure.storage.account-name=${STORAGE_ACCOUNT_NAME}
azure.storage.account-key=${STORAGE_ACCOUNT_KEY}
azure.storage.blob-endpoint=${STORAGE_ACCOUNT_ENDPOINT}
I then use these properties in a Spring Service Class called StorageService
to manage the BlobServiceClient
. Here are my two attempts to set it up:
1 (Current).
@Autowired
StorageService(@Value("${azure.connection}") String connection)
{
client = new BlobServiceClientBuilder().connectionString(connection).buildClient();
objectMapper = new ObjectMapper();
}
- (Previous).
@Autowired
StorageService(@Value("${azure.storage.account-name}") String name,
@Value("${azure.storage.account-key}") String key,
@Value("${azure.storage.blob-endpoint}") String endpoint)
{
AzureNamedKeyCredential credential = new AzureNamedKeyCredential(name, key);
client = new BlobServiceClientBuilder().credential(credential).endpoint(endpoint).buildClient();
objectMapper = new ObjectMapper();
}
I even tried using both Java 11 and Java 17. However, each time I manage to run it in Intelli-J, I get this error.
Caused by: java.lang.NoSuchFieldError: NOOP_CONFIGURER
at reactor.netty.ChannelPipelineConfigurer.emptyConfigurer(ChannelPipelineConfigurer.java:40)
at reactor.netty.transport.TransportConfig.<init>(TransportConfig.java:207)
at reactor.netty.transport.ClientTransportConfig.<init>(ClientTransportConfig.java:164)
at reactor.netty.http.client.HttpClientConfig.<init>(HttpClientConfig.java:327)
at reactor.netty.http.client.HttpClientConnect.<init>(HttpClientConnect.java:85)
at reactor.netty.http.client.HttpClient.create(HttpClient.java:393)
at com.azure.core.http.netty.NettyAsyncHttpClientBuilder.build(NettyAsyncHttpClientBuilder.java:141)
at com.azure.core.http.netty.NettyAsyncHttpClientProvider.createInstance(NettyAsyncHttpClientProvider.java:19)
at com.azure.core.implementation.http.HttpClientProviders.createInstance(HttpClientProviders.java:67)
at com.azure.core.http.HttpClient.createDefault(HttpClient.java:50)
at com.azure.core.http.HttpClient.createDefault(HttpClient.java:40)
at com.azure.core.http.HttpPipelineBuilder.build(HttpPipelineBuilder.java:73)
at com.azure.storage.blob.implementation.util.BuilderHelper.buildPipeline(BuilderHelper.java:138)
at com.azure.storage.blob.BlobServiceClientBuilder.buildAsyncClient(BlobServiceClientBuilder.java:135)
at com.azure.storage.blob.BlobServiceClientBuilder.buildClient(BlobServiceClientBuilder.java:114)
at com.trecapps.users.services.StorageService.<init>(StorageService.java:40)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)
... 49 common frames omitted
And when I googled "NOOP_CONFIGURER"
(with the quotes), I get 2 results, so this error does not seem to be well documented. Any suggestions on how to get my app to launch?