Exception in thread "main" java.lang.NoClassDefFoundError: reactor/core/Disposable at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:756) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:473) at java.net.URLClassLoader.access$100(URLClassLoader.java:74) at java.net.URLClassLoader$1.run(URLClassLoader.java:369) at java.net.URLClassLoader$1.run(URLClassLoader.java:363) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:362) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at com.azure.core.http.netty.NettyAsyncHttpClientProvider.createInstance(NettyAsyncHttpClientProvider.java:81) at dev.langchain4j.model.azure.InternalAzureOpenAiHelper.setupOpenAIClientBuilder(InternalAzureOpenAiHelper.java:71) at dev.langchain4j.model.azure.InternalAzureOpenAiHelper.setupSyncClient(InternalAzureOpenAiHelper.java:51) at dev.langchain4j.model.azure.AzureOpenAiChatModel.<init>(AzureOpenAiChatModel.java:123) at dev.langchain4j.model.azure.AzureOpenAiChatModel$Builder.build(AzureOpenAiChatModel.java:536)
at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:756) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:473) at java.net.URLClassLoader.access$100(URLClassLoader.java:74) at java.net.URLClassLoader$1.run(URLClassLoader.java:369) at java.net.URLClassLoader$1.run(URLClassLoader.java:363) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:362) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at reactor.netty.resources.DefaultLoopKQueue.getChannel(DefaultLoopKQueue.java:50) at reactor.netty.resources.LoopResources.onChannel(LoopResources.java:243) at reactor.netty.tcp.TcpResources.onChannel(TcpResources.java:251) at reactor.netty.transport.TransportConfig.lambda$connectionFactory$1(TransportConfig.java:277) at reactor.netty.transport.TransportConnector.doInitAndRegister(TransportConnector.java:277) at reactor.netty.transport.TransportConnector.connect(TransportConnector.java:164) at reactor.netty.transport.TransportConnector.connect(TransportConnector.java:123) at reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnectionAllocator.lambda$connectChannel$0(DefaultPooledConnectionProvider.java:519) at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:61) at reactor.core.publisher.Mono.subscribe(Mono.java:4568) at reactor.core.publisher.Mono.subscribeWith(Mono.java:4634) at reactor.core.publisher.Mono.subscribe(Mono.java:4534) at reactor.core.publisher.Mono.subscribe(Mono.java:4470) at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool.drainLoop(SimpleDequePool.java:437) at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool.pendingOffer(SimpleDequePool.java:600) at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool.doAcquire(SimpleDequePool.java:296) at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.request(AbstractPool.java:430) at reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onSubscribe(DefaultPooledConnectionProvider.java:204) at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool$QueueBorrowerMono.subscribe(SimpleDequePool.java:720) at reactor.netty.resources.PooledConnectionProvider.lambda$acquire$2(PooledConnectionProvider.java:170) at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:61) at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.lambda$subscribe$0(HttpClientConnect.java:273) at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:61) at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:81) at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:63) at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.subscribe(HttpClientConnect.java:276) at reactor.core.publisher.Mono.subscribe(Mono.java:4568) at reactor.core.publisher.Mono.block(Mono.java:1778) at com.azure.core.http.netty.NettyAsyncHttpClient.sendSync(NettyAsyncHttpClient.java:199) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:51) at com.azure.core.http.policy.HttpLoggingPolicy.processSync(HttpLoggingPolicy.java:183) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.implementation.http.policy.InstrumentationPolicy.processSync(InstrumentationPolicy.java:101) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.policy.KeyCredentialPolicy.processSync(KeyCredentialPolicy.java:115) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.policy.CookiePolicy.processSync(CookiePolicy.java:73) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.policy.AddDatePolicy.processSync(AddDatePolicy.java:50) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.policy.RetryPolicy.attemptSync(RetryPolicy.java:211) at com.azure.core.http.policy.RetryPolicy.processSync(RetryPolicy.java:161) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.policy.AddHeadersPolicy.processSync(AddHeadersPolicy.java:66) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.policy.AddHeadersFromContextPolicy.processSync(AddHeadersFromContextPolicy.java:67) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.policy.RequestIdPolicy.processSync(RequestIdPolicy.java:77) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.policy.HttpPipelineSyncPolicy.processSync(HttpPipelineSyncPolicy.java:51) at com.azure.core.http.policy.UserAgentPolicy.processSync(UserAgentPolicy.java:174) at com.azure.core.http.HttpPipelineNextSyncPolicy.processSync(HttpPipelineNextSyncPolicy.java:53) at com.azure.core.http.HttpPipeline.sendSync(HttpPipeline.java:138) at com.azure.core.implementation.http.rest.SyncRestProxy.send(SyncRestProxy.java:62) at com.azure.core.implementation.http.rest.SyncRestProxy.invoke(SyncRestProxy.java:83) at com.azure.core.implementation.http.rest.RestProxyBase.invoke(RestProxyBase.java:124) at com.azure.core.http.rest.RestProxy.invoke(RestProxy.java:95) at com.sun.proxy.$Proxy24.getChatCompletionsSync(Unknown Source) at com.azure.ai.openai.implementation.OpenAIClientImpl.getChatCompletionsWithResponse(OpenAIClientImpl.java:1444) at com.azure.ai.openai.OpenAIClient.getChatCompletionsWithResponse(OpenAIClient.java:318) at com.azure.ai.openai.OpenAIClient.getChatCompletions(OpenAIClient.java:685) at dev.langchain4j.model.azure.AzureOpenAiChatModel.generate(AzureOpenAiChatModel.java:257) at dev.langchain4j.model.azure.AzureOpenAiChatModel.generate(AzureOpenAiChatModel.java:215)
Header header = new Header("User-Agent", "langchain4j-azure-openai"); clientOptions.setHeaders(Collections.singletonList(header)); // HttpClient httpClient = new NettyAsyncHttpClientProvider().createInstance(clientOptions); HttpClient httpClient = new OkHttpAsyncClientProvider().createInstance(clientOptions);
HttpLogOptions httpLogOptions = new HttpLogOptions(); if (logRequestsAndResponses) { httpLogOptions.setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS); }
maxRetries = getOrDefault(maxRetries, 3); ExponentialBackoffOptions exponentialBackoffOptions = new ExponentialBackoffOptions(); exponentialBackoffOptions.setMaxRetries(maxRetries); RetryOptions retryOptions = new RetryOptions(exponentialBackoffOptions);
// before HttpClient httpClient = new NettyAsyncHttpClientProvider().createInstance(clientOptions); // after HttpClient httpClient = new OkHttpAsyncClientProvider().createInstance(clientOptions);
at com.azure.core.http.rest.RestProxy.<init>(RestProxy.java:56) at com.azure.core.http.rest.RestProxy.create(RestProxy.java:140) at com.azure.ai.openai.implementation.OpenAIClientImpl.<init>(OpenAIClientImpl.java:144) at com.azure.ai.openai.OpenAIClientBuilder.buildInnerClient(OpenAIClientBuilder.java:283) at com.azure.ai.openai.OpenAIClientBuilder.buildClient(OpenAIClientBuilder.java:351)