带有Spring-5的Websphere 8.5 [英] Websphere 8.5 with Spring-5

查看:539
本文介绍了带有Spring-5的Websphere 8.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Websphere 8.5.5是否与Spring 5兼容?在spring5(validation-api 5)中引用的Validation API导致MethodNotFound异常.

Is Websphere 8.5.5 compatible with Spring 5? The Validation API referenced in spring5 (validation-api 5) is resulting in MethodNotFound exception.. Any pointers/patch available to get this solved - short of upgrading to Websphere 9?

原因:java.lang.NoSuchMethodError: javax/validation/Configuration.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider; (从 文件:/opt/IBM/WebSphere/AppServer/plugins/javax.j2ee.validation.jar org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@25d460de) 上课叫 org.springframework.validation.beanvalidation.LocalValidatorFactoryBean (从文件:../spring-context-5.0.2.RELEASE.jar加载 com.ibm.ws.classloader.CompoundClassLoader@1c7dbdd9

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

推荐答案

方法javax/validation/Configuration.getDefaultParameterNameProvider已添加到Bean Validation 1.1中,因此表明您正在使用的Spring Validator尝试使用Bean Validation 1.1 API.根据 https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.html :

The method javax/validation/Configuration.getDefaultParameterNameProvider was added in Bean Validation 1.1, so that indicates the Spring Validator you are using is attempting to use the Bean Validation 1.1 API. According to https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.html:

从Spring 5.0开始,此类需要Bean Validation 1.1 +

As of Spring 5.0, this class requires Bean Validation 1.1+

WebSphere 8.5.5提供Bean验证1.0,并且直到9.0版才添加对Bean验证1.1的支持.因此,您将需要使用Spring 4.x或WebSphere 9.x.

WebSphere 8.5.5 provides Bean Validation 1.0 and did not add support for Bean Validation 1.1 until version 9.0. So, you'll either need to use Spring 4.x or WebSphere 9.x.

这篇关于带有Spring-5的Websphere 8.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆