While upgrading Spring boot to 2.5.12, the db migrator script is throwing a bootstrap related error. Suggestions please.

rkavitha

Kavitha Somasundaram

Posted on April 5, 2022

While upgrading Spring boot to 2.5.12, the db migrator script is throwing a bootstrap related error. Suggestions please.

db-migrator | Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.boot.BootstrapRegistryInitializer : org.springframework.cloud.bootstrap.TextEncryptorConfigBootstrapper
db-migrator | at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:456)
db-migrator | at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:438)
db-migrator | at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:431)
db-migrator | at org.springframework.boot.SpringApplication.(SpringApplication.java:261)
db-migrator | at org.springframework.boot.builder.SpringApplicationBuilder.createSpringApplication(SpringApplicationBuilder.java:129)
db-migrator | at org.springframework.boot.builder.SpringApplicationBuilder.(SpringApplicationBuilder.java:102)
db-migrator | at org.springframework.boot.builder.SpringApplicationBuilder.(SpringApplicationBuilder.java:98)
db-migrator | at com.phishme.dbmigrator.Main.main(Main.java:30)
db-migrator | Caused by: java.lang.IllegalArgumentException: class org.springframework.cloud.bootstrap.TextEncryptorConfigBootstrapper is not assignable to interface org.springframework.boot.BootstrapRegistryInitializer
db-migrator | at org.springframework.util.Assert.assignableCheckFailed(Assert.java:720)
db-migrator | at org.springframework.util.Assert.isAssignable(Assert.java:651)
db-migrator | at org.springframework.util.Assert.isAssignable(Assert.java:682)
db-migrator | at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:450)
db-migrator | ... 7 more
db-migrator exited with code 1

I have tried including the following in the POM file:

org.springframework.cloud
spring-cloud-starter-bootstrap

Also created bootstrap.properties and added the following:
spring.cloud.bootstrap.enabled=true

💖 💪 🙅 🚩
rkavitha
Kavitha Somasundaram

Posted on April 5, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related