Validation java.lang.Exception:HV000041:调用TraversableResolver.isRecable()引发异常

Validation java.lang.Exception:HV000041:调用TraversableResolver.isRecable()引发异常,validation,websphere,Validation,Websphere,我们在WebSphere8.5上遇到了下面提到的错误 2020-01-07 15:19:37[]调试InvocableHandlerMethod.java.getMethodArgumentValues:174: 无法解析public org.springframework.http.ResponseEntity中的参数[1] com.mycorp.uap.controller.WorkFlowController.updateTask(int,com.mycorp.uap.rest.vo.Ta

我们在WebSphere8.5上遇到了下面提到的错误

2020-01-07 15:19:37[]调试InvocableHandlerMethod.java.getMethodArgumentValues:174: 无法解析public org.springframework.http.ResponseEntity中的参数[1] com.mycorp.uap.controller.WorkFlowController.updateTask(int,com.mycorp.uap.rest.vo.TaskVO) 抛出java.lang.Exception:HV000041:调用TraversableResolver.isRecable()引发异常

方法定义为

public ResponseEntity<TaskVO> updateTask(@PathVariable("id") int taskId, @Valid @RequestBody(required=true) TaskVO task) throws Exception{
public ResponseEntity updateTask(@PathVariable(“id”)int taskId,@Valid@RequestBody(required=true)TaskVO任务)引发异常{
WEB-INF/lib包含以下与hibernate、validation和spring相关的JAR

hibernate-commons-annotations-5.1.0.Final.jar

hibernate-core-5.4.4.Final.jar

hibernate-ehcache-5.4.4.Final.jar

hibernate-jpa-2.1-api-1.0.2.jar

hibernate-validator-6.0.15.Final.jar

validation-api-2.0.1.Final.jar

spring-aop-5.1.9.RELEASE.jar

spring-beans-5.1.9.RELEASE.jar

spring-context-5.1.9.RELEASE.jar

spring-context-support-5.1.9.RELEASE.jar

spring-core-5.1.9.RELEASE.jar

spring-data-commons-2.1.9.RELEASE.jar

spring-data-jpa-2.1.9.RELEASE.jar

spring-expression-5.1.9.RELEASE.jar

springfox-core-2.1.2.jar

springfox-schema-2.1.2.jar

springfox-spi-2.1.2.jar

springfox-spring-web-2.1.2.jar

springfox-swagger2-2.1.2.jar

springfox-swagger-common-2.1.2.jar

springfox-swagger-ui-2.1.2.jar

spring-hateoas-0.17.0.RELEASE.jar

spring-jcl-5.1.9.RELEASE.jar

spring-jdbc-5.1.9.RELEASE.jar

spring-ldap-core-2.3.2.RELEASE.jar

spring-messaging-5.1.9.RELEASE.jar

spring-orm-5.1.9.RELEASE.jar

spring-plugin-core-1.2.0.RELEASE.jar

spring-plugin-metadata-1.2.0.RELEASE.jar

spring-security-acl-5.1.6.RELEASE.jar

spring-security-cas-client.jar

spring-security-config-5.1.6.RELEASE.jar

spring-security-core-5.1.6.RELEASE.jar

spring-security-ldap-5.1.6.RELEASE.jar

spring-security-oauth2-2.3.6.RELEASE.jar

spring-security-openid-5.1.6.RELEASE.jar

spring-security-taglibs-5.1.6.RELEASE.jar

spring-security-web-5.1.6.RELEASE.jar

spring-test-5.1.9.RELEASE.jar

spring-tx-5.1.9.RELEASE.jar

spring-web-5.1.9.RELEASE.jar

spring-webmvc-5.1.9.RELEASE.jar

spring-websocket-5.1.9.RELEASE.jar

ParentLast设置存在于应用程序的WebSphere配置中,因此WebSphere应该优先考虑应用程序的WEB-INF/lib中存在的JAR

在@Valid不存在的情况下,有一种类似的方法可以正常工作

我研究了关于堆栈溢出的类似问题,但未能获得正确的解决方案

正确的解决方案应该是什么?
是否要从WEB-INF/lib中删除任何JAR?

要解决此问题,您需要将HibernatePersistenceProviderResolver类添加到项目中:

并在onStartup方法的应用程序类中注册它

@Override 
public void onStartup(ServletContext servletContext) throws ServletException {
    HibernatePersistenceProviderResolver.register();
    ... 
}