skrapeit / skrape.it

A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion.
https://docs.skrape.it
MIT License
790 stars 57 forks source link

[BUG] Spring Boot 3.0.0-M5 - new logback version included into Spring Boot causing error #207

Closed marceligrabowski closed 1 year ago

marceligrabowski commented 1 year ago

Describe the bug While using Spring Boot 3.0.0-M5 skrape.it is failing as Spring Boot is using internally logback-classic in version >=1.3.0 which changes contract of Configurator Error is:

Caused by: java.lang.AbstractMethodError: Receiver class it.skrape.fetcher.logging.LoggingConfigurator does not define or inherit an implementation of the resolved method 'abstract ch.qos.logback.classic.spi.Configurator$ExecutionStatus configure(ch.qos.logback.classic.LoggerContext)' of interface ch.qos.logback.classic.spi.Configurator.

Code Sample upgrading logback to >=1.3.0 for browser-fetcher and changing LoggingConfigurator from:

override fun configure(loggerContext: LoggerContext) {
        val consoleAppender = ConsoleAppender<ILoggingEvent>()
        // omitted for clarity
        rootLogger.addAppender(consoleAppender)
    }

into:

    override fun configure(loggerContext: LoggerContext): Configurator.ExecutionStatus? {
        val consoleAppender = ConsoleAppender<ILoggingEvent>()
        // omitted for clarity
        rootLogger.addAppender(consoleAppender)
        return Configurator.ExecutionStatus.NEUTRAL
    }

should do the trick.

I'll prepare change and test it with older version of Spring Boot/any app using older logback-classic if that won't harm anything

christian-draeger commented 1 year ago

Thx 🙏