Azure Storage Blob erhalten die IO.NETTY.Channel.StacklessClesedChannelexception beim Generieren /Herunterladen der aus Java

Java-Forum
Guest
 Azure Storage Blob erhalten die IO.NETTY.Channel.StacklessClesedChannelexception beim Generieren /Herunterladen der aus

Post by Guest »

Ich verwende den folgenden Code, um den ByteStream aus der SasUrl des Azure-Speichers zu generieren

Code: Select all

 ConnectionProvider connectionProvider =
ConnectionProvider.builder("custom-connection-provider")
.maxConnections(200)
.pendingAcquireMaxCount(5000)
.build();

BlobClient blobClient = new BlobClientBuilder()
.endpoint(searchMultipleWrapper.getSasUrl().trim()) // IT IS MY VALID SAS URL
.httpClient(new NettyAsyncHttpClientBuilder()
.connectionProvider(connectionProvider)
.readTimeout(Duration.ofMinutes(10))
.writeTimeout(Duration.ofMinutes(10))
.responseTimeout(Duration.ofMinutes(10))
.build())
.retryOptions(new RequestRetryOptions(
RetryPolicyType.EXPONENTIAL,
5,
2,
null,
null,
null
))
.buildClient();

log.info("BlobClient Object check {} ", blobClient);

// Use try-with-resources to ensure InputStream is closed
try (InputStream inputStream = blobClient.openInputStream();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {

// Transfer data from InputStream to ByteArrayOutputStream
inputStream.transferTo(byteArrayOutputStream);

// Convert to Base64
byte[] imageBytes = byteArrayOutputStream.toByteArray();
String base64Image = Base64.getEncoder().encodeToString(imageBytes);

log.info("Base 64 : {} ", base64Image);

// Log the Base64 string (truncated for safety)
log.info("Base64 Image (truncated): " + base64Image.substring(0, Math.min(base64Image.length(), 100)) + "...");
} catch (Exception e) {
log.error("Error while processing blob content", e);

}

Ausnahme, die ich wie folgt erhalte:-

stack_trace":"reactor.core.Exceptions$ReactiveException:
io.netty.channel.StacklessClosedChannelException\n\tat
Überschrift ##reactor.core.Exceptions.propagate(Exceptions.java:410)\n\tat
reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:102)\n\ tat
reactor.core.publisher.Mono.block(Mono.java:1779)\n\tat
com.azure.storage.blob.specialized.BlobClientBase.openInputStream(BlobClientBase.java:393)\n\tat
com.azure.storage.blob.specialized.BlobClientBase.openInputStream(BlobClientBase.java:323) \n\tat
com.azure.storage.blob.specialized.BlobClientBase.openInputStream(BlobClientBase.java:312)\n\tat
com.azure.storage.blob.specialized.BlobClientBase.openInputStream(BlobClientBase.java:299) \n

Ich denke, dass es das Versionierungsproblem ist, das den Fehler auf dem Windows-System verursacht. Bitte überprüfen Sie die Referenz dazu.
Klicken Sie hier
Bitte helfen Sie mir, dieses Problem zu beheben

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post