当前位置:  开发笔记 > 编程语言 > 正文

JBoss-如何在jboss-deployment-structure中排除javax.validation?

如何解决《JBoss-如何在jboss-deployment-structure中排除javax.validation?》经验,为你挑选了1个好方法。

我有使用Jersey REST的.war,它在tomCat中工作。但是我需要在JBoss 6.4.0中运行.war,这会导致异常

java.lang.RuntimeException: java.lang.NoSuchMethodError:
javax.validation.spi.ConfigurationState.getParameterNameProvider()

因为JBoss使用旧版本的javax.validation,并且我需要从JBoss部署中排除javax.validation。

我在.war的WEB-INF中创建jboss-deployment-structure.xml




    

        
            
            
            
            
        

        
            
            
            
            
            
            
           

    

这帮助我排除了javax.ws.rs,但是如何排除javax.validation?请帮帮我



1> maslan..:

好,所以您不仅需要排除

 

itself, but also modules that are dependent on javax.validation.api module. The easiest way to see which modules are dependent on javax.validation.api and force it to be included, even though it was excluded, is to search your .xml files in JBOSS_DIRECTORY/modules for javax.validation.api, the modules that are dependent have something like that in module.xml:

>
    
...

And those modules need to be excluded as well. For me - I also needed to exclude:

        
        

And then, javax validation eclusion was working :)

推荐阅读
jerry613
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有