Skip to content

[BUG] Exception in thread "main" java.lang.NoClassDefFoundError: io/ktor/client/engine/apache/Apache #246

@h434ni

Description

@h434ni

Describe the bug
unable to run scrape it because of an error

Code Sample

import it.skrape.fetcher.HttpFetcher
import it.skrape.fetcher.response
import it.skrape.fetcher.skrape

fun testFunction1() {
    skrape(HttpFetcher) {
        request {
            url = "google.com"
        }
        response {
            println(responseBody)
            status { code }
        }
    }
}
fun main(){
    testFunction1()
}

Expected behavior
i want it to not throw error and run

Additional context
this is the error im getting:

Exception in thread "main" java.lang.NoClassDefFoundError: io/ktor/client/engine/apache/Apache
	at it.skrape.fetcher.HttpFetcher.configuredClient(HttpFetcher.kt:28)
	at it.skrape.fetcher.HttpFetcher.fetch(HttpFetcher.kt:24)
	at it.skrape.fetcher.HttpFetcher.fetch(HttpFetcher.kt:20)
	at it.skrape.fetcher.FetcherConverter.fetch(Scraper.kt:30)
	at it.skrape.fetcher.Scraper.scrape(Scraper.kt:17)
	at it.skrape.fetcher.ScraperKt.response(Scraper.kt:87)
	at TestKt$testFunction1$1.invokeSuspend(test.kt:10)
	at TestKt$testFunction1$1.invoke(test.kt)
	at TestKt$testFunction1$1.invoke(test.kt)
	at it.skrape.fetcher.ScraperKt$skrape$1.invokeSuspend(Scraper.kt:43)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at it.skrape.fetcher.ScraperKt.skrape(Scraper.kt:42)
	at TestKt.testFunction1(test.kt:6)
	at TestKt.main(test.kt:17)
	at TestKt.main(test.kt)
Caused by: java.lang.ClassNotFoundException: io.ktor.client.engine.apache.Apache
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 22 more

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions