I'm attempting to deploy a Spring Boot (2.0.2) application on JBoss EAP 7.1 server.
The code that's causing the problem is:
import javax.validation.constraints.NotBlank;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
@Component
@Validated
public class AppProperties {
@NotBlank
private String name;
When the application is deployed on JBoss I get the following exception:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
16:44:25,861 ERROR [org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter] (ServerService Thread Pool -- 6 7)
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'app' to com.example.security.config.AppProperties:
Property: app.contextpath
Value: /api
Origin: class path resource [application.yml]:5:18
Reason: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotBlank' validating type 'java.lang.String'. Check configuration for 'name'
Action:
Update your application's configuration
I've tried adding the file jboss-deployment-structure.xml with the following contents to WEB-INF/classes:
<jboss-deployment-structure>
<ear-subdeployments-isolated>true</ear-subdeployments-isolated>
<deployment>
<exclude-subsystems>
<subsystem name="jaxrs"/>
</exclude-subsystems>
<exclusions>
<module name="javaee.api"/>
<module name="javax.validation.api"/>
<module name="javax.faces.api"/>
<module name="org.hibernate.validator"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
But, no luck. What's the workaround? Thanks in advance.