JAVA-gateway打包运行报错,Error creating bean with name ‘discoveryLocatorProperties’

运行没问题,打包就报错

Error creating bean with name ‘discoveryLocatorProperties’ defined in class path resource [org/springframework/cloud/gateway/discovery/GatewayDiscoveryClientAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.gateway.discovery.DiscoveryLocatorProperties]: Factory method ‘discoveryLocatorProperties’ threw exception; nested exception is java.lang.NoClassDefFoundError: javax/validation/ValidationException

检查依赖树,添加下面的依赖


            org.springframework.boot
            spring-boot-starter-validation

你可能感兴趣的:(java,gateway,前端)