Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NoClassDefFoundError: io/netty/handler/codec/http/HttpDecoderConfig #40070

Closed
FranciscoMMMicrosoft opened this issue May 7, 2024 · 4 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. dependency-issue Issue that is caused by dependency conflicts needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@FranciscoMMMicrosoft
Copy link

Describe the bug
The bug is appearing when trying to use the template for Azure OpenAI AudioTranscriptionSample.java

The problem is that it is showing the following error log: java.lang.NoClassDefFoundError:

Exception or Stack Trace
java.lang.NoClassDefFoundError: io/netty/handler/codec/http/HttpDecoderConfig
at reactor.netty.http.client.HttpClientConfig.configureHttp11Pipeline(HttpClientConfig.java:684)
at reactor.netty.http.client.HttpClientConfig$HttpClientChannelInitializer.onChannelInit(HttpClientConfig.java:956)
at reactor.netty.transport.TransportConfig$TransportChannelInitializer.initChannel(TransportConfig.java:418)
at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:938)
at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:181)
at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:358)
at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:339)

To Reproduce
Steps to reproduce the behavior: Following the template but without using the configuration function (adding the credentials instead)

Code Snippet
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.ai.openai.usage;

import com.azure.ai.openai.OpenAIClient;
import com.azure.ai.openai.OpenAIClientBuilder;
import com.azure.ai.openai.models.AudioTranscription;
import com.azure.ai.openai.models.AudioTranscriptionFormat;
import com.azure.ai.openai.models.AudioTranscriptionOptions;
import com.azure.core.credential.AzureKeyCredential;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Configuration;

import java.nio.file.Path;
import java.nio.file.Paths;

/**

  • A sample demonstrates how to transcript a given audio file.
    /
    public class AudioTranscriptionSample {
    /
    *
    • Runs the sample algorithm and demonstrates how to get the images for a given prompt.

    • @param args Unused. Arguments to the program.
      */
      public static void main(String[] args) {
      String azureOpenaiKey = Configuration.getGlobalConfiguration().get("AZURE_OPENAI_KEY");
      String endpoint = Configuration.getGlobalConfiguration().get("AZURE_OPENAI_ENDPOINT");
      String deploymentOrModelId = "{azure-open-ai-deployment-model-id}";
      String fileName = "batman.wav";
      Path filePath = Paths.get("src/samples/java/com/azure/ai/openai/resources/" + fileName);

      OpenAIClient client = new OpenAIClientBuilder()
      .endpoint(endpoint)
      .credential(new AzureKeyCredential(azureOpenaiKey))
      .buildClient();

      byte[] file = BinaryData.fromFile(filePath).toBytes();

      // To request timestamps for 'segments' and/or 'words', specific the desired response format as
      // 'AudioTranscriptionFormat.VERBOSE_JSON' and provide the desired combination of enum flags for the available
      // timestamp granularities. If not otherwise specified, 'segments' will be provided. Note that 'words', unlike 'segments',
      // will introduce additional processing latency to compute.
      AudioTranscriptionOptions transcriptionOptions = new AudioTranscriptionOptions(file)
      .setResponseFormat(AudioTranscriptionFormat.JSON);

      AudioTranscription transcription = client.getAudioTranscription(deploymentOrModelId, fileName, transcriptionOptions);

      System.out.println("Transcription: " + transcription.getText());
      }
      }

Expected behavior
Expected the code to answer with the Transcription given by whispers model.

Setup (please complete the following information):

  • OS: Windows
  • IDE: java
  • Library/Libraries: the ones at the template but configuration
  • Java version: NA
  • App Server/Environment: NA
  • Frameworks: NA

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree NA
  • exception message, full stack trace, and any available logs
    java.lang.NoClassDefFoundError: io/netty/handler/codec/http/HttpDecoderConfig
    at reactor.netty.http.client.HttpClientConfig.configureHttp11Pipeline(HttpClientConfig.java:684)
    at reactor.netty.http.client.HttpClientConfig$HttpClientChannelInitializer.onChannelInit(HttpClientConfig.java:956)
    at reactor.netty.transport.TransportConfig$TransportChannelInitializer.initChannel(TransportConfig.java:418)
    at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
    at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
    at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:938)
    at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
    at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:181)
    at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:358)
    at io.netty.channel.DefaultChannelPipeline.addFirst(DefaultChannelPipeline.java:339)

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [ Y] Bug Description Added
  • [ Y] Repro Steps Added
  • [ Y] Setup information Added
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 7, 2024
@alzimmermsft alzimmermsft added the dependency-issue Issue that is caused by dependency conflicts label May 7, 2024
@alzimmermsft alzimmermsft self-assigned this May 7, 2024
@github-actions github-actions bot removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 7, 2024
@alzimmermsft
Copy link
Member

Hi @FranciscoMMMicrosoft, thank you for reporting this. Could you include the dependencies being used in your application as this is likely a dependency conflict resulting in HttpDecoderConfig failing to be initialized.

This guide can help work through getting the dependencies being used: https://learn.microsoft.com/azure/developer/java/sdk/troubleshooting-dependency-version-conflict

@alzimmermsft alzimmermsft changed the title [BUG] [BUG] NoClassDefFoundError: io/netty/handler/codec/http/HttpDecoderConfig May 7, 2024
@alzimmermsft alzimmermsft added the needs-author-feedback More information is needed from author to address the issue. label May 8, 2024
Copy link

github-actions bot commented May 8, 2024

Hi @FranciscoMMMicrosoft. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@FranciscoMMMicrosoft
Copy link
Author

Hello! I have passed the suggestions to my customer, and she gave me the feedback that everything is working great now :)
Thank you so much for your help and sorry about not providing faster feedback.

@github-actions github-actions bot added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels May 8, 2024
@alzimmermsft
Copy link
Member

Closing as resolved given your feedback @FranciscoMMMicrosoft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. dependency-issue Issue that is caused by dependency conflicts needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

2 participants