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] Exception in thread "main" java.lang.NoClassDefFoundError: io/ktor/client/engine/apache/Apache #246

Open
h434ni opened this issue Oct 11, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@h434ni
Copy link

h434ni commented Oct 11, 2024

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
@h434ni h434ni added the bug Something isn't working label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants