Issue
I have a Kotlin Spring Boot application and tried to integrate the JobRunr Spring Boot Starter dependency, along with the Kotlin JobRunr Support Module. Dependencies:
// Jackson JSON Serialization
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3")
// Spring Boot Version is 2.7.1 (latest)
// Jobs
implementation("org.jobrunr:jobrunr-spring-boot-starter:5.1.6")
implementation("org.jobrunr:jobrunr-kotlin-1.7-support:5.1.6")
I configured JobRunr like this:
@Configuration
class JobRunrConfiguration {
@Bean
fun jobMapper(): JobMapper {
return JobMapper(JacksonJsonMapper(jacksonObjectMapper()))
}
}
I'm using Postgres as my database.
Application properties are as follows:
# JobRunr
org.jobrunr.background_job_server=true
org.jobrunr.dashboard=true
It is quite basic stuff after following the documentation, but when I try to start the application I get the error:
Failed to bind properties under 'org.jobrunr.background-job-server' to org.jobrunr.spring.autoconfigure.JobRunrProperties$BackgroundJobServer". Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [org.jobrunr.spring.autoconfigure.JobRunrProperties$BackgroundJobServer]
I tried different object mappers and configurations, swapping out dependencies, but nothing is working. Anyone have some pointers or ideas in the right direction?
Solution
It fails to parse the configuration below:
# JobRunr
org.jobrunr.background_job_server=true
org.jobrunr.dashboard=true
according to the source code the configuration should look like:
org.jobrunr.background-job-server.enabled=true
org.jobrunr.dashboard.enabled=true
Answered By - Andrey B. Panfilov
Answer Checked By - Willingham (JavaFixing Volunteer)