0

Portion of the build file that references spring-cloud-sleuth is provided below.

dependencyManagement {
  imports {
        //where springCloudVersion = "Dalston.SR5" & springBootVersion = '1.5.9.RELEASE'

    mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
  }
} 
//in dependencies, added the following line
compile 'org.springframework.cloud:spring-cloud-starter-sleuth'

after adding this dependency, the application fails to start with the following exception (added based on comments)

support.AbstractApplicationContext (AbstractApplicationContext.java:551) - 
Exception encountered during context initialization - cancelling refresh attempt: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'misds': 
Could not bind properties to HikariDataSource (prefix=mis.datasource, ignoreInvalidFields=false, ignoreUnknownFields=true, ignoreNestedProperties=false); nested exception is org.springframework.validation.BindException: org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanPropertyBindingResult: 4 errors
Field error in object 'mis.datasource' on field 'driverClassName': rejected value [oracle.jdbc.OracleDriver]; 
codes [methodInvocation.mis.datasource.driverClassName,methodInvocation.driverClassName,methodInvocation.java.lang.String,methodInvocation]; 
arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [mis.datasource.driverClassName,driverClassName]; 
arguments []; default message [driverClassName]]; default message [Property 'driverClassName' threw exception; 
nested exception is java.lang.IllegalStateException: The configuration of the pool is sealed once started.  
Use HikariConfigMXBean for runtime changes.]

I am using slf4j over log4j for logging framework and the application runs fine when I remove the sleuth dependency.

I noticed that the following 'additional' propertysources are present when spring-cloud dependency is included.

env.MutablePropertySources (MutablePropertySources.java:106) - Adding PropertySource 'springCloudClientHostInfo' with lowest search precedence
env.MutablePropertySources (MutablePropertySources.java:106) - Adding PropertySource 'defaultProperties' with lowest search precedence
env.MutablePropertySources (MutablePropertySources.java:106) - Adding PropertySource 'Management Server' with lowest search precedence
patb23
  • 387
  • 5
  • 21
  • 1
    `Dalston.SR5` is extremely old. Please upgrade to `Edgware.SR3` and see if the problem still persits – Marcin Grzejszczak Apr 03 '18 at 18:22
  • Also add the full exception – spencergibb Apr 03 '18 at 18:39
  • Thanks @MarcinGrzejszczak, the edgeware upgrade worked. I was under the wrong impression that only Dalston is compatible with Boot <2.0. Would it be possible to point to any issue in Github, just for my understanding? Thanks. Also, could your comment be moved to 'answer' so I can close this? – patb23 Apr 03 '18 at 18:51

1 Answers1

0

Always check if the latest release train doesn't solve your problems. Honestly, I don't really know which issue is related to this problem :/ Edgware release train is compatible with Boot < 2.0

Marcin Grzejszczak
  • 10,624
  • 1
  • 16
  • 32