Azure / azure-functions-java-library

Contains annotations for writing Azure Functions in Java
MIT License
42 stars 42 forks source link

Netty conflict with azure-storage-blob #155

Open vdiddlodka opened 2 years ago

vdiddlodka commented 2 years ago

There remains a dependency conflict issue with Netty when also using library azure-storage-blob within an azure function. Please advise on what changes I need to make to maven pom or what versions of azure-functions-java-library and azure-storage-blob are known to work together.

I'm currently using; com.microsoft.azure.functions:azure-functions-java-library:jar:1.4.2 com.azure:azure-storage-blob:jar:12.13.0

Possibly related issues (note I'm using more recent versions and have a different method error);

110

https://github.com/Azure/azure-functions-java-worker/issues/365

[2021-08-24T16:32:27.992Z] System.Private.CoreLib: Exception while executing function: Functions.REDACTED. System.Private.CoreLib: Result: Failure Exception: NoSuchMethodError: io.netty.handler.logging.LoggingHandler.<init>(Ljava/lang/String;Lio/netty/handler/logging/LogLevel;Lio/netty/handler/logging/ByteBufFormat;)V Stack: java.lang.reflect.InvocationTargetException [2021-08-24T16:32:28.002Z] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [2021-08-24T16:32:28.008Z] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [2021-08-24T16:32:28.012Z] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [2021-08-24T16:32:28.023Z] at java.lang.reflect.Method.invoke(Method.java:498) [2021-08-24T16:32:28.026Z] at com.microsoft.azure.functions.worker.broker.JavaMethodInvokeInfo.invoke(JavaMethodInvokeInfo.java:22) [2021-08-24T16:32:28.035Z] at com.microsoft.azure.functions.worker.broker.JavaMethodExecutorImpl.execute(JavaMethodExecutorImpl.java:54) [2021-08-24T16:32:28.040Z] at com.microsoft.azure.functions.worker.broker.JavaFunctionBroker.invokeMethod(JavaFunctionBroker.java:57) [2021-08-24T16:32:28.042Z] at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:33) [2021-08-24T16:32:28.047Z] at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:10) [2021-08-24T16:32:28.050Z] at com.microsoft.azure.functions.worker.handler.MessageHandler.handle(MessageHandler.java:45) [2021-08-24T16:32:28.053Z] at com.microsoft.azure.functions.worker.JavaWorkerClient$StreamingMessagePeer.lambda$onNext$0(JavaWorkerClient.java:92) [2021-08-24T16:32:28.055Z] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [2021-08-24T16:32:28.063Z] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [2021-08-24T16:32:28.067Z] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [2021-08-24T16:32:28.071Z] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [2021-08-24T16:32:28.074Z] at java.lang.Thread.run(Thread.java:748) [2021-08-24T16:32:28.078Z] Caused by: java.lang.NoSuchMethodError: io.netty.handler.logging.LoggingHandler.<init>(Ljava/lang/String;Lio/netty/handler/logging/LogLevel;Lio/netty/handler/logging/ByteBufFormat;)V [2021-08-24T16:32:28.081Z] at reactor.netty.transport.logging.ReactorNettyLoggingHandler.<init>(ReactorNettyLoggingHandler.java:63) [2021-08-24T16:32:28.085Z] at reactor.netty.transport.logging.AdvancedByteBufFormat.toLoggingHandler(AdvancedByteBufFormat.java:109) [2021-08-24T16:32:28.088Z] at reactor.netty.http.client.HttpClientConfig.<clinit>(HttpClientConfig.java:637) [2021-08-24T16:32:28.095Z] at reactor.netty.http.client.HttpClientConnect.<init>(HttpClientConnect.java:84) [2021-08-24T16:32:28.099Z] at reactor.netty.http.client.HttpClient.create(HttpClient.java:393) [2021-08-24T16:32:28.104Z] at com.azure.core.http.netty.NettyAsyncHttpClientBuilder.build(NettyAsyncHttpClientBuilder.java:97) [2021-08-24T16:32:28.107Z] at com.azure.core.http.netty.NettyAsyncHttpClientProvider.createInstance(NettyAsyncHttpClientProvider.java:17) [2021-08-24T16:32:28.115Z] at com.azure.core.implementation.http.HttpClientProviders.createInstance(HttpClientProviders.java:58) [2021-08-24T16:32:28.124Z] at com.azure.core.http.HttpClient.createDefault(HttpClient.java:50) [2021-08-24T16:32:28.128Z] at com.azure.core.http.HttpClient.createDefault(HttpClient.java:40) [2021-08-24T16:32:28.131Z] at com.azure.core.http.HttpPipelineBuilder.build(HttpPipelineBuilder.java:62) [2021-08-24T16:32:28.136Z] at com.azure.storage.blob.implementation.util.BuilderHelper.buildPipeline(BuilderHelper.java:135) [2021-08-24T16:32:28.143Z] at com.azure.storage.blob.BlobServiceClientBuilder.buildAsyncClient(BlobServiceClientBuilder.java:114) [2021-08-24T16:32:28.148Z] at com.azure.storage.blob.BlobServiceClientBuilder.buildClient(BlobServiceClientBuilder.java:90) [2021-08-24T16:32:28.152Z] at REDACTED [2021-08-24T16:32:28.155Z] at REDACTED [2021-08-24T16:32:28.161Z] at REDACTED [2021-08-24T16:32:28.164Z] ... 16 more

varora1 commented 2 years ago

Hi @vdiddlodka did you happen to find any workaround for this issue?

vdiddlodka commented 2 years ago

@varora1 Unfortunately no. I ended up having to remove that task and place it within our web application which is less than ideal, but necessary due to this problem. I hope you find a solution as well.