错误500:java.lang.NoSuchMethodError:javax / validation / Validator

时间:2019-01-29 16:10:09

标签: java bean-validation websphere-8

我正在使用包含EAR文件的WebSphere版本8.5.5.1。 我正在使用Java Bean验证,因此我在WebSphere的SHARED_LIBRARY中添加了所有需要的jar。但是,当我进行一些测试时,却遇到了以下错误。

请帮忙。谢谢

  Error 500: java.lang.NoSuchMethodError: 
  javax/validation/Validator.forExecutables()Ljavax/validation/executable 
   /ExecutableValidator&#59;
 --------------------------------

我正在jboss-deployement-structure中使用此配置,并且工作正常,webSphere中的等效项是什么?

    <module name="javaee.api">
        <imports>
            <exclude-set>
                <path name="javax/ws/rs" />
                <path name="javax/ws/rs/core" />
                <path name="javax/ws/rs/ext" />
                <path name="javax/validation" />
                <path name="javax/validation/bootstrap" />
                <path name="javax/validation/constraints" />
                <path name="javax/validation/groups" />
                <path name="javax/validation/metadata" />
                <path name="javax/validation/spi" />
                <path name="javax/el/**" />
            </exclude-set>
        </imports>
    </module>               
</dependencies>

<!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
<exclusions>
    <module name="asm.asm" />
    <module name="javax.ws.rs.api" />
    <module name="org.apache.commons.logging" />
    <module name="org.apache.log4j" />
    <module name="org.jboss.logging" />
    <module name="org.jboss.logging.jul-to-slf4j-stub" />
    <module name="org.jboss.logmanager" />
    <module name="org.jboss.logmanager.log4j" />
    <module name="org.slf4j" />
    <module name="org.slf4j.impl" />
    <module name="org.slf4j.jcl-over-slf4j" />    
    <module name="javaee.api"/>
    <module name="javax.validation.api"/>
    <module name="javax.faces.api"/>
    <module name="org.hibernate.validator"/>
    <module name="javax.el.api" />
</exclusions>

0 个答案:

没有答案