Example needed for creating an executable jar spring boot that extends bridge admin spring boot.
Good morning, after integrating the Kotlin dependencies from MVN public repo, we are getting below errors, Looks like some unsatisfied dependencies. We have included all the mentioned dependencies (with latest versions) in our pom.xml still we are getting below error, we did not see this issue when we use Kotlin source code. Could you please have a look (highlighted part below) and let us know.
Also I still see below code in Application.kt file ( at line 64)
SpringApplication.run(Application::class.java, *args)
Could you please remove it and provide the dependencies? We will start the Spring boot application in our wrapper, so that it will be easier for us to add our services. Please let me know if you have any questions?
Error log:
[36mConfigServletWebServerApplicationContext[0;39m [2m:[0;39m Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminController' defined in URL [jar:file:/home/vcap/app/BOOT-INF/lib/nats-jms-bridge-springboot-app-0.21.3-beta18.jar!/io/nats/bridge/admin/AdminController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bridgeConfigRepo' defined in class path resource [io/nats/bridge/admin/Configuration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.nats.bridge.admin.ConfigRepo]: Factory method 'bridgeConfigRepo' threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.module.kotlin.KotlinModule.<init>(IILkotlin/jvm/internal/DefaultConstructorMarker;)V
2020-09-16T03:10:02.511-04:00 [APP/PROC/WEB/0] [OUT] [2m2020-09-16 07:10:02.510[0;39m [32m INFO[0;39m [35m13[0;39m [2m---[0;39m [2m[ main][0;39m [36mo.apache.catalina.core.StandardService [0;39m [2m:[0;39m Stopping service [Tomcat]
2020-09-16T03:10:02.546-04:00 [APP/PROC/WEB/0] [OUT] [2m2020-09-16 07:10:02.545[0;39m [32m INFO[0;39m [35m13[0;39m [2m---[0;39m [2m[ main][0;39m [36mConditionEvaluationReportLoggingListener[0;39m [2m:[0;39m
2020-09-16T03:10:02.546-04:00 [APP/PROC/WEB/0] [OUT] Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] [2m2020-09-16 07:10:02.549[0;39m [31mERROR[0;39m [35m13[0;39m [2m---[0;39m [2m[ main][0;39m [36mo.s.b.d.LoggingFailureAnalysisReporter [0;39m [2m:[0;39m
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] ***************************
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] APPLICATION FAILED TO START
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] ***************************
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] Description:
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] An attempt was made to call a method that does not exist. The attempt was made from the following location:
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] io.nats.bridge.admin.util.ObjectMapperUtils.getYamlObjectMapper(ObjectMapperUtils.kt:13)
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] The following method did not exist:
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] com.fasterxml.jackson.module.kotlin.KotlinModule.<init>(IILkotlin/jvm/internal/DefaultConstructorMarker;)V
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] The method's class, com.fasterxml.jackson.module.kotlin.KotlinModule, is available from the following locations:
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] jar:file:/home/vcap/app/BOOT-INF/lib/jackson-module-kotlin-2.11.2.jar!/com/fasterxml/jackson/module/kotlin/KotlinModule.class
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] The class hierarchy was loaded from the following locations:
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] com.fasterxml.jackson.module.kotlin.KotlinModule: file:/home/vcap/app/BOOT-INF/lib/jackson-module-kotlin-2.11.2.jar
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] com.fasterxml.jackson.databind.module.SimpleModule: file:/home/vcap/app/BOOT-INF/lib/jackson-databind-2.10.3.jar
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] com.fasterxml.jackson.databind.Module: file:/home/vcap/app/BOOT-INF/lib/jackson-databind-2.10.3.jar
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] Action:
2020-09-16T03:10:02.549-04:00 [APP/PROC/WEB/0] [OUT] Correct the classpath of your application so that it contains a single, compatible version of com.fasterxml.jackson.module.kotlin.KotlinModule
2020-09-16T03:10:02.686-04:00 [APP/PROC/WEB/0] [OUT] Exit status 1
Example needed for creating an executable jar spring boot that extends bridge admin spring boot.