带有Spring-5的Websphere 8.5
作者:互联网
Websphere 8.5.5与Spring 5兼容吗? spring5(validation-api 5)中引用的Validation API导致MethodNotFound异常.任何指针/补丁都可以解决这个问题 – 没有升级到Websphere 9?
Caused by: java.lang.NoSuchMethodError:
javax/validation/Configuration.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
(loaded from
file:/opt/IBM/WebSphere/AppServer/plugins/javax.j2ee.validation.jar by
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@25d460de)
called from class
org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
(loaded from file:../spring-context-5.0.2.RELEASE.jar by
com.ibm.ws.classloader.CompoundClassLoader@1c7dbdd9
解决方法:
在Bean Validation 1.1中添加了方法javax / validation / Configuration.getDefaultParameterNameProvider,因此表明您正在使用的Spring Validator正在尝试使用Bean Validation 1.1 API.根据https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.html:
As of Spring 5.0, this class requires Bean Validation 1.1+
WebSphere 8.5.5提供了Bean Validation 1.0,并且在版本9.0之前没有添加对Bean Validation 1.1的支持.因此,您需要使用Spring 4.x或WebSphere 9.x.
标签:spring,validation,websphere-8 来源: https://codeday.me/bug/20190930/1836075.html