Azure Blob upload file with java failure

Yu Chen 26 Reputation points
2022-01-28T07:05:36.527+00:00

Add dependency as following in my pom.xml
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.13.0</version>
</dependency>

When call "blobClient.uploadFromFile(localPath + fileName)" always failed in my formal product with below Exception in log file, not sure whether I need add more jar dependency at pom.xml.

2022-01-28T14:20:25.922Z DEBUG <parallel-1> [OpenSsl] Default cipher suites (OpenSSL): [TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256]
2022-01-28T14:20:25.927Z DEBUG <parallel-1> [Operators] Duplicate Subscription has been detected
java.lang.IllegalStateException: Spec. Rule 2.12 - Subscriber.onSubscribe MUST NOT be called more than once (based on object equality)
at reactor.core.Exceptions.duplicateOnSubscribeException(Exceptions.java:180) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.Operators.reportSubscriptionSet(Operators.java:1083) [reactor-core.jar:3.4.6]
at reactor.core.publisher.Operators.setOnce(Operators.java:1188) [reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:109) [reactor-core.jar:3.4.6]
at reactor.core.publisher.Operators.reportThrowInSubscribe(Operators.java:225) [reactor-core.jar:3.4.6]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:71) [reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) [reactor-core.jar:3.4.6]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) [reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDelaySubscription.accept(MonoDelaySubscription.java:52) [reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDelaySubscription.accept(MonoDelaySubscription.java:33) [reactor-core.jar:3.4.6]
at reactor.core.publisher.FluxDelaySubscription$DelaySubscriptionOtherSubscriber.onNext(FluxDelaySubscription.java:130) [reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.propagateDelay(MonoDelay.java:270) [reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.run(MonoDelay.java:285) [reactor-core.jar:3.4.6]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) [reactor-core.jar:3.4.6]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) [reactor-core.jar:3.4.6]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
2022-01-28T14:20:25.932Z ERROR <parallel-1> [Schedulers] Scheduler worker in group main failed with an uncaught exception
java.lang.NoClassDefFoundError: io/netty/internal/tcnative/AsyncSSLPrivateKeyMethod
at io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:831) ~[netty-handler.jar:4.1.69.Final]
at io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:611) ~[netty-handler.jar:4.1.69.Final]
at reactor.netty.tcp.AbstractProtocolSslContextSpec.sslContext(AbstractProtocolSslContextSpec.java:53) ~[reactor-netty-core.jar:1.0.7]
at reactor.netty.tcp.SslProvider.<init>(SslProvider.java:358) ~[reactor-netty-core.jar:1.0.7]
at reactor.netty.tcp.SslProvider$Build.build(SslProvider.java:734) ~[reactor-netty-core.jar:1.0.7]
at reactor.netty.http.client.HttpClientSecure.<clinit>(HttpClientSecure.java:59) ~[reactor-netty-http.jar:1.0.7]
at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.lambda$subscribe$0(HttpClientConnect.java:220) ~[reactor-netty-http.jar:1.0.7]
at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:57) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:76) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57) ~[reactor-core.jar:3.4.6]
at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.subscribe(HttpClientConnect.java:272) ~[reactor-netty-http.jar:1.0.7]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:76) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDelaySubscription.accept(MonoDelaySubscription.java:52) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDelaySubscription.accept(MonoDelaySubscription.java:33) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.FluxDelaySubscription$DelaySubscriptionOtherSubscriber.onNext(FluxDelaySubscription.java:130) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.propagateDelay(MonoDelay.java:270) ~[reactor-core.jar:3.4.6]
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.run(MonoDelay.java:285) ~[reactor-core.jar:3.4.6]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) [reactor-core.jar:3.4.6]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) [reactor-core.jar:3.4.6]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.ClassNotFoundException: io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod
at jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) ~[?:?]
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) ~[?:?]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
... 30 more

But if I follow the tutuial at https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-java?tabs=bash, the uploadFromFile works with the same code.

Anyone can help me, thanks a lot.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,425 questions
{count} votes