`
足至迹留
  • 浏览: 485680 次
  • 性别: Icon_minigender_1
  • 来自: OnePiece
社区版块
存档分类
最新评论

wsdl4j和axis-wsdl4j冲突

阅读更多
1.异常及分析


分析:从错误上看是没有方法,到工程里去找此类,发现有两个地方,wsdl4j-1.6.2.jar和axis-wsdl4j-1.5.1.jar里有同名的类,但是前者是由这个方法的,后者没有。更进一步发现,两者类结构几乎都一样。
于是查找两者的关系,在http://stackoverflow.com/questions/8219215/difference-between-axis-wsdl4j-and-wsdl4j
找到蛛丝马迹,两者其实差不多,前者有一段时间没有往中央仓库发布版本,中间axis就自己发布了版本,直到1.5.1之后wsdl4j自己开始发布,并更新了版本。
原文:
引用
axis:axis-wsdl4j appears to be the exact same distribution as wsdl4j:wsdl4j. looking at versions released to maven central for both wsdl4j and axis-wsdl4j it looks like axis had to upload the wsdl4j artifacts themselves because wsdl4j didnt publish anything between 1.0 and 1.4 to maven central, but stopped doing so after 1.5.1 (both published 1.5.1 - axis a bit earlier - but only the wsdl4j:wsdl4j artifact has seen any regular updates since).

in terms of code they are the same code

it looks like axis started packaging wsdl4j themselves in version 1.1:

    We include a more recent version of wsdl4j.jar (23/mar/2003)

but will stop doing so when 1.4.1 is out

    WSDL4J has been upgraded from 1.5.1 to 1.6.2

the license for wsdl4j (in both distributions is the Common Public License - v 1.0) - in /lib/wsdl4j-1.5.1.LICENSE in the axis 1.4 source distribution. thats also the license in the sourceforge page for the project.


那什么原因导致的同时有两个依赖jar包呢?
通过maven的Dependency Hierarchy可以看到axis-wsdl4j是axis的依赖,项目中使用了webservice.而wsdl4j是项目框架使用了tuscany,tuscany依赖了wsdl4j。


2.解决
有了上面的分析,问题就清楚了,两者几乎是一样的,前者的版本更新。所以就只使用前者,把axis-wsdl4j-1.5.2排除依赖即可。
在pom.xml里修改axis的依赖配置,添加排除:
       
<dependency>
            <groupId>axis</groupId>
            <artifactId>axis</artifactId>
            <version>1.4</version>
            <exclusions>  
                <exclusion>      
                    <groupId>axis</groupId>          
                    <artifactId>axis-wsdl4j</artifactId>  
               </exclusion>  
           </exclusions> 
        </dependency>
  • 大小: 14.9 KB
  • 大小: 45.1 KB
0
2
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics