简体   繁体   English

为什么Spring4.1.3 webmvc在weblogic12c中内部调用hibernate-validator

[英]Why Spring4.1.3 webmvc internally calling hibernate-validator in weblogic12c

I am deploying a application in weblogic12c.It is spring4.1.3 build rest service. 我正在weblogic12c中部署一个应用程序,它是spring4.1.3 build rest服务。 Earlier all jars were inside war file and I set 早些时候所有的罐子都放在战争档案里,我把

<prefer-web-inf-classes>true</prefer-web-inf-classes>

Now we removed the supporting jars from war file and deploying the application in weblogic 12c. 现在,我们从war文件中删除了支持jar,并在weblogic 12c中部署了该应用程序。 But now it's throwing below exception. 但是现在,它抛出了异常。 I don't understand how SpringMVC calls the hibernate validator. 我不明白SpringMVC如何调用休眠验证器。 I see hibernate.validator_4_0_1.jar is available in the wlserver/modules folder of weblogic. 我看到hibernate.validator_4_0_1.jar在weblogic的wlserver / modules文件夹中可用。

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.hibernate.validator.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        Truncated. see log file for complete stacktrace
Caused By: java.lang.AbstractMethodError: org.hibernate.validator.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

I fixed this. 我修好了 I got that weblogic has a weblogic.server.merged.jar which is inside weblogic/12c/wlserver/modules/features and It has javax.validation and hibernate.validator packages and causing the mess. 我知道weblogic在weblogic / 12c / wlserver / modules / features内部有一个weblogic.server.merged.jar,它具有javax.validation和hibernate.validator程序包,并造成混乱。 I just updated these packages here manually by latest validation-api.jar and hibernate-validator-5.2.2.jar. 我刚刚通过最新的validation-api.jar和hibernate-validator-5.2.2.jar手动更新了这些软件包。 It worked. 有效。 Weblogic does not really cares jars under wlserver/modules but It has combined all these jars to weblogic.server.merged.jar and I needed to update the packages of the same. Weblogic并不真正在意wlserver / modules下的jar,但已将所有这些jar组合到weblogic.server.merged.jar中,我需要更新相同的软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM