How can I disable javax.validation.api in JBoss 6.4

后端 未结 3 2002
轮回少年
轮回少年 2020-12-06 20:43

Similar questions:

How to use bean validation 1.1 in JBoss EAP 6.4.0?

How to change bean-validation version on jboss EAP 6.3?

Can you use bean valida

相关标签:
3条回答
  • 2020-12-06 21:19

    For jboss 6.2 i want to use cxf and bean validation 1.1, the previous answer didnt work for me, to make it work first i had to exclude all the dependencies then add again the javee.api excluding the imports to the javax packages like this:

    <exclusions>
                <module name="javaee.api"/>
                <module name="javax.validation.api"/>
                <module name="javax.faces.api"/>
                <module name="javax.faces.api" slot="1.2"/>
                <module name="org.hibernate.validator"/>
    
    
            </exclusions>
            <dependencies>
                <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/spi"/>
                            <path name="javax/validation/constraints"/>
                            <path name="javax/validation/groups"/>
                            <path name="javax/validation/metadata"/>
                        </exclude-set>
                    </imports>
                </module>
    
            </dependencies>
    

    Then repeat on the subdeployments of my ear.

    0 讨论(0)
  • 2020-12-06 21:20

    JBoss EAP 6.x is a JEE6 implementation container. Also keep in mind that changing the bean validation modules that are shipped with JBoss EAP6 breaks the supported bits.

    Bean Validation is part of JEE7 specification. You will need to upgrade to JBoss EAP7 or use WildFly 9 or 10 from the community. Both of them implement JEE7 spec which includes Bean Validation 1.1.

    0 讨论(0)
  • 2020-12-06 21:23

    I have verified this answer given by Redhat support -

    You can exclude the JBoss provided javax.validation api classes from the JBoss EAP 6 by excluding the jaxrs subsystem.

    In addition to excluding validation classes themselves modules that depend on them should be excluded as well. Thus, the exclusion part of jboss-deployment-structure.xml should look like this:

    <exclude-subsystems>
      <subsystem name="jaxrs"/>
    </exclude-subsystems>
    <exclusions>
      <module name="javaee.api"/>
      <module name="javax.validation.api"/>
      <module name="javax.faces.api"/>
      <module name="org.hibernate.validator"/>
    </exclusions>
    

    *note - excluding the javaee module limits the available support by RedHat

    0 讨论(0)
提交回复
热议问题