wsdl4j和axis-wsdl4j冲突

[b]1.异常及分析[/b]
[img]http://dl2.iteye.com/upload/attachment/0095/9469/6aaf4adc-049a-35cf-aff8-eb24e7eaa3cd.bmp[/img]

[b]分析:[/b]从错误上看是没有方法,到工程里去找此类,发现有两个地方,wsdl4j-1.6.2.jar和axis-wsdl4j-1.5.1.jar里有同名的类,但是前者是由这个方法的,后者没有。更进一步发现,两者类结构几乎都一样。
于是查找两者的关系,在[url]http://stackoverflow.com/questions/8219215/difference-between-axis-wsdl4j-and-wsdl4j[/url]
找到蛛丝马迹,两者其实差不多,前者有一段时间没有往中央仓库发布版本,中间axis就自己发布了版本,直到1.5.1之后wsdl4j自己开始发布,并更新了版本。
原文:
[quote][b]axis:axis-wsdl4j[/b] appears to be the [b]exact same[/b] distribution as [b]wsdl4j:wsdl4j[/b]. 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[b] 1.0 and 1.4[/b] 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.[/quote]

[b]那什么原因导致的同时有两个依赖jar包呢?[/b]
通过maven的Dependency Hierarchy可以看到axis-wsdl4j是axis的依赖,项目中使用了webservice.而wsdl4j是项目框架使用了tuscany,tuscany依赖了wsdl4j。
[img]http://dl2.iteye.com/upload/attachment/0095/9488/10b75ac4-af16-3460-a711-5089a35f157d.bmp[/img]

[b]2.解决[/b]
有了上面的分析,问题就清楚了,两者几乎是一样的,前者的版本更新。所以就只使用前者,把axis-wsdl4j-1.5.2排除依赖即可。
在pom.xml里修改axis的依赖配置,添加排除:

axis
axis
1.4


axis
axis-wsdl4j


你可能感兴趣的:(问题记录,soa-tuscany)