> Java > java.lang.NoClassDefFoundError:reactor/netty/transport/ClientTransport 오류

java.lang.NoClassDefFoundError:reactor/netty/transport/ClientTransport 오류

WBOY
풀어 주다: 2024-02-05 22:21:07
앞으로
1313명이 탐색했습니다.
问题内容

我正在开发一个要在应用程序中上传的 jar 文件,该应用程序将利用它连接到 azure 密钥保管库并检索凭据以进一步在服务器上运行一些操作。我正在使用 maven,并陷入此错误:

java.lang.noclassdeffounderror: reactor/netty/transport/clienttransport
    at java.base/java.lang.classloader.defineclass1(native method)
로그인 후 복사

这是代码部分:

clientcertificatecredential clientcertificatecredential = new clientcertificatecredentialbuilder()
    .tenantid(tenantid)
    .clientid(clientid)
    .pfxcertificate(certificatepath, certificatepassword)
    .build();
            
    secretclient secretclient = new secretclientbuilder()
    .vaulturl(keyvaulturl)
    .credential(clientcertificatecredential)
    .buildclient();
로그인 후 복사

我已经尝试了相当多版本的依赖项,但仍然无法解决它,因为我是新手。现在已经坚持了几天了。依赖部分如下所示:

<!--<dependency>
            <groupid>com.azure</groupid>
            <artifactid>azure-core</artifactid>
            <version>1.26.0</version>
        </dependency>-->
        <dependency>
            <groupid>com.azure</groupid>
            <artifactid>azure-identity</artifactid>
            <version>1.7.0</version>
        </dependency>
        
        <dependency>
            <groupid>com.azure</groupid>
            <artifactid>azure-security-keyvault-secrets</artifactid>
            <version>4.2.3</version>
        </dependency>
        
        <!--<dependency>
            <groupid>com.fasterxml.jackson.core</groupid>
            <artifactid>jackson-core</artifactid>
            <version>2.14.0</version>
        </dependency>-->
        <dependency>
            <groupid>io.projectreactor</groupid>
            <artifactid>reactor-core</artifactid>
            <version>3.4.10</version>
        </dependency>

        <dependency>
            <groupid>io.projectreactor.netty</groupid>
            <artifactid>reactor-netty</artifactid>
            <version>1.0.11</version>
        </dependency>
로그인 후 복사

我已经尝试过几个版本的依赖项,但我对此很陌生,无法弄清楚。

更新: 我在 pom 文件中添加了 azure bom,但错误仍然略有变化:

java.lang.NoClassDefFoundError: reactor/netty/transport/ClientTransport 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.security.keyvault.secrets.SecretClientBuilder.buildAsyncClient(SecretClientBuilder.java:225) at com.azure.security.keyvault.secrets.SecretClientBuilder.buildClient(SecretClientBuilder.java:147) at com.snc.discovery.CredentialResolver.resolve(CredentialResolver.java:177) at com.service_now.mid.services.CredentialResolverProxy.resolveWithSemaphore(CredentialResolverProxy.java:392) at com.service_now.mid.services.CredentialResolverProxy.lambda$resolveFromVault$1(CredentialResolverProxy.java:329) at java.base/java.util.Optional.orElseGet(Optional.java:369) at com.service_now.mid.services.CredentialResolverProxy.resolveFromVault(CredentialResolverProxy.java:329) at com.service_now.mid.services.CredentialResolverProxy.lambda$resolve$0(CredentialResolverProxy.java:313) at java.base/java.util.Optional.orElseGet(Optional.java:369) at com.service_now.mid.services.CredentialResolverProxy.resolve(CredentialResolverProxy.java:313) at com.service_now.mid.creds.provider.standard.HighSecurityCredential.callResolver(HighSecurityCredential.java:55) at com.service_now.mid.creds.provider.standard.HighSecurityCredential.getAttribute(HighSecurityCredential.java:177) at com.snc.automation_common.integration.creds.Credential.isMidServerServiceAccount(Credential.java:151) at com.service_now.mid.win.powershell.api.APowershellSession.testCredential(APowershellSession.java:416) at com.service_now.mid.win.powershell.api.PowerShellConnectionFactory.getConnection(PowerShellConnectionFactory.java:60) at com.service_now.mid.win.powershell.api.PowerShellConnectionFactory.getConnection(PowerShellConnectionFactory.java:22) at com.snc.core_automation_common.util.AKeyedConnectionFactory.getConnectionUseOneCred(AKeyedConnectionFactory.java:266) at com.snc.core_automation_common.util.AKeyedConnectionFactory.getConnectionIterateOverCreds(AKeyedConnectionFactory.java:208) at com.snc.core_automation_common.util.AKeyedConnectionFactory.getConnection(AKeyedConnectionFactory.java:158) at com.snc.core_automation_common.util.AKeyedConnectionFactory.getConnection(AKeyedConnectionFactory.java:145) at com.snc.core_automation_common.util.AKeyedConnectionFactory.getConnection(AKeyedConnectionFactory.java:133) at com.service_now.mid.pipeline.command.TestCredentialCommandImpl.executeRawCommand(TestCredentialCommandImpl.java:126) at com.snc.core_automation_common.pipeline.ACommand.execute(ACommand.java:114) at com.service_now.mid.probe.CommandPipeline.probe(CommandPipeline.java:67) at com.service_now.mid.probe.AProbe.process(AProbe.java:155) at com.service_now.mid.queue_worker.AWorker.runWorker(AWorker.java:131) at com.service_now.mid.queue_worker.AWorkerThread.run(AWorkerThread.java:20) at com.service_now.mid.threadpool.ResourceUserQueue$RunnableProxy.run(ResourceUserQueue.java:640) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
로그인 후 복사

正确答案


我已经能够通过从 azure 依赖项(azure-identity 和 azure-security-keyvault-secrets)中排除 azure-core-http-netty 并添加 azure-core-http-okhttp 工件来解决该错误。 参考了这个帖子: https://github.com/Azure/azure-sdk-for- java/issues/19041

위 내용은 java.lang.NoClassDefFoundError:reactor/netty/transport/ClientTransport 오류의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

원천:stackoverflow.com
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿