Tim Malseed
04/30/2021, 4:13 AMDuplicateApplicationFeatureException
, I believe it's due to a bug in Ktor (sort of tracked here: https://youtrack.jetbrains.com/issue/KTOR-2586)Tim Malseed
04/30/2021, 4:14 AMembeddedServer(
factory = Netty,
port = 8080,
host = "0.0.0.0",
watchPaths = listOf("classes"),
module = {
val daggerAppComponent = DaggerAppComponent
.builder()
.logger(this.log)
.build()
install(CallLogging)
install(CachingHeaders)
artworkRouting(
artworkService = daggerAppComponent.provideArtworkService(),
databaseStorage = daggerAppComponent.provideDatabaseStorage(),
imageProcessor = daggerAppComponent.provideImageProcessor(),
awsClient = daggerAppComponent.provideAwsClient()
)
}
The provideDatabaseStorage
actually throws an exception, due to the SQL Driver being unable to connect, because the application is not started yet.
This exception is swallowed by Ktor, then the application tries to re-instantiate the modules, then fails because some of the modules are already installed.
So, it turns out it's just an error in my code, that caused a misleading exception in Ktor