Closed mveitas closed 6 years ago
Thanks for the details, but it's not enough to diagnose the problem. Can you provide a complete, minimal, verifiable sample that reproduces the problem?
Sure I'll spin up a sample repo that can reproduce this
I narrowed down the issue to an older version of hibernate-validator being pulled into our app. The exception being thrown at app startup doesn't surface the cause and after some debugging found the real reason:
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'defaultContext'
This would explain why things started to break after 2.0.0.M5 when this change was made: https://github.com/spring-cloud/spring-cloud-consul/commit/01e93da27e9e2756206782f998ea18b387458065
Did you read the comment above? https://github.com/spring-cloud/spring-cloud-consul/issues/405#issuecomment-371132420
I am having a similar issue where I am trying to start spring cloud aws with secrets manager and I get the same error.
Pom.xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Greenwich.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.1.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-autoconfigure</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-aws-secrets-manager-config -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws-secrets-manager-config</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.4.Final</version>
</dependency>
Failed to bind properties under 'aws.secretsmanager' to org.springframework.cloud.aws.secretsmanager.AwsSecretsManagerProperties:
Reason: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'defaultContext'
Action:
Update your application's configuration
@sarbajitdutta your app doesn't include spring-cloud-consul.
If you can provide a complete, minimal, verifiable sample that reproduces the problem, please open an issue in spring-cloud-aws. It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
I recently tried to update to using Spring Boot 2.0.0.RELEASE along with
spring-cloud-consul:2.0.0.M6
.When starting the app I get the following:
This is the contents of the bootstrap.yaml that we are using:
Below is the maven dep tree for reference: