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

HttpClientEngine return error #406

Open
sajadmartiny opened this issue Dec 21, 2024 · 0 comments
Open

HttpClientEngine return error #406

sajadmartiny opened this issue Dec 21, 2024 · 0 comments

Comments

@sajadmartiny
Copy link

why return this error?
i use ktor 2.3.13
and test with apache and cio and return same error

Exception in thread "DefaultDispatcher-worker-2" java.lang.AbstractMethodError: Receiver class io.ktor.client.engine.okhttp.OkHttpEngine does not define or inherit an implementation of the resolved method 'abstract kotlinx.coroutines.CoroutineDispatcher getDispatcher()' of interface io.ktor.client.engine.HttpClientEngine.
at io.ktor.client.engine.HttpClientEngineBase$coroutineContext$2.invoke(HttpClientEngineBase.kt:22)
at io.ktor.client.engine.HttpClientEngineBase$coroutineContext$2.invoke(HttpClientEngineBase.kt:21)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at io.ktor.client.engine.HttpClientEngineBase.getCoroutineContext(HttpClientEngineBase.kt:21)
at io.ktor.client.engine.okhttp.OkHttpEngine.(OkHttpEngine.kt:43)
at io.ktor.client.engine.okhttp.OkHttp.create(OkHttp.kt:31)
at io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:42)
at io.ktor.client.HttpClientJvmKt.HttpClient(HttpClientJvm.kt:21)
at com.aallam.openai.client.internal.HttpClientKt.createHttpClient(HttpClient.kt:89)
at com.aallam.openai.client.OpenAIKt.OpenAI(OpenAI.kt:60)
at com.dexist.di.ModuleKt.appModule$lambda$56$lambda$5(Module.kt:43)
at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:50)
at org.koin.core.instance.SingleInstanceFactory.create(SingleInstanceFactory.kt:46)
at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:55)
at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:53)
at org.koin.mp.KoinPlatformTools.synchronized(KoinPlatformTools.kt:36)
at org.koin.core.instance.SingleInstanceFactory.get(SingleInstanceFactory.kt:53)
at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:109)
at org.koin.core.scope.Scope.resolveValue(Scope.kt:248)
at org.koin.core.scope.Scope.resolveInstance(Scope.kt:234)
at org.koin.core.scope.Scope.get(Scope.kt:213)
at com.dexist.di.ModuleKt.appModule$lambda$56$lambda$34(Module.kt:307)
at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:50)
at org.koin.core.instance.SingleInstanceFactory.create(SingleInstanceFactory.kt:46)
at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:55)
at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:53)
at org.koin.mp.KoinPlatformTools.synchronized(KoinPlatformTools.kt:36)
at org.koin.core.instance.SingleInstanceFactory.get(SingleInstanceFactory.kt:53)
at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:109)
at org.koin.core.scope.Scope.resolveValue(Scope.kt:248)
at org.koin.core.scope.Scope.resolveInstance(Scope.kt:234)
at org.koin.core.scope.Scope.get(Scope.kt:213)
at com.dexist.scheduler.TaskHandlers$special$$inlined$inject$default$1.invoke(KoinComponent.kt:67)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.dexist.scheduler.TaskHandlers.getOpenAIService(TaskHandlers.kt:14)
at com.dexist.scheduler.TaskHandlers.handleTask(TaskHandlers.kt:17)
at com.dexist.MonitoringKt$loadDataToRedis$1.invokeSuspend(Monitoring.kt:70)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at com.dexist.MonitoringKt.loadDataToRedis(Monitoring.kt:63)
at com.dexist.ApplicationKt$module$3$2$1.invokeSuspend(Application.kt:57)
at com.dexist.ApplicationKt$module$3$2$1.invoke-Gi7IvD8(Application.kt)
at com.dexist.ApplicationKt$module$3$2$1.invoke(Application.kt)
at io.github.flaxoos.ktor.server.plugins.taskscheduling.managers.TaskManager$execute$runs$1$1.invokeSuspend(TaskManager.kt:29)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@2baf4f1e, Dispatchers.Default]

22:26 [cluster-ClusterId{value='67670f5747e0a7219e380ef8', description='null'}-127.0.0.1:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to {type=STANDALONE, servers=[{address=127.0.0.1:27017, type=STANDALONE, roundTripTime=5.4 ms, state=CONNECTED}]

22:26 [cluster-ClusterId{value='67670f5747e0a7219e380ef8', description='null'}-127.0.0.1:27017] DEBUG org.mongodb.driver.cluster - Checking status of 127.0.0.1:27017

22:26 [cluster-ClusterId{value='67670f5947e0a7219e380f17', description='null'}-127.0.0.1:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to {type=STANDALONE, servers=[{address=127.0.0.1:27017, type=STANDALONE, roundTripTime=0.7 ms, state=CONNECTED}]

22:26 [cluster-ClusterId{value='67670f5947e0a7219e380f17', description='null'}-127.0.0.1:27017] DEBUG org.mongodb.driver.cluster - Checking status of 127.0.0.1:27017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant