websphere6.0部署axis2 1.3

养成好的习惯随时记录解决方案

好记性不如烂笔头,以前在WebSphere上部署过axis2今天又折腾了一晚上

决定还是写在这做备案

WebSphere6+axis21.3

发布webservice服务的时候出现下面的异常

java.lang.NoSuchMethodError:   javax/wsdl/Operation.getExtensibilityElements()Ljava/util/List;   at   org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateOperations(WSDL11ToAxisServiceBuilder.java:1010)   at   org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populatePortType(WSDL11ToAxisServiceBuilder.java:399)   at   org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpoints(WSDL11ToAxisServiceBuilder.java:318)   at   org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:288)   at ...

解决方案:

1、
引用
Apache Muse - Conflicting Version of WSDL4J in WebSphere Deployments

WhendeployingyourMuse-basedapplicationsonIBMWebSphereApplicationServer(WAS)6.0or6.1,youneedtobeawarethatMusereliesonWSDL4J1.6.1whiletheserver'scorelibrariesincludeWSDL4J1.4.Ifyouinstallyourapplicationusingthedefaultclassloadingsystem,itwillfailtostartbecausetheMuseframeworkdependsonWSDL4JAPIsthatareonlyavailableinWSDL4J1.5andabove.Toworkaroundthisissue,youcanconfiguretheservertousetheapplication'sclassloaderbeforethecontainerorsystemclassloaders;thiswillensurethattheWSDL4Jclassesthatareinyourapplication's/WEB-INF/libdirectorywillbeloadedbeforethosein$WAS_HOME/lib.

IfyouaredevelopinganddeployingyourapplicationthroughIBMRationalApplicationDeveloper(RAD),youcanmaketherequiredchangesbysettingtheclassloadermodetoPARENT_LASTandtheclassloaderpolicytoSINGLE.

IfyouareinstallingyourapplicationthroughtheWASadminconsole,selectEnterpriseApplications>YourApplication>Classloadingandupdatedetection.Youshouldthenchecktheboxeslabeledasfollows:

*Classesloadedwithapplicationclassloaderfirst

*Singleclassloaderforapplication

Makingthesechangesshouldnotaffectyourother(non-Muse)applicationsbecause,havingnoWSDL4JJARfilesoftheirown,theserverwillcontinueupthechainofclassloadersuntilthecontainer'sclassloaderdiscoversWSDL4J1.4in$WAS_HOME/lib.

就是先加载应用自己的类库最后在加载父类不用WebSphere自带的wsdl类

2、更改之后抛出struts标签不能解析什么的

这个时候把应用里面的servlet.jar删除这个时候用WebSphere自带的

3、再抛出
RAD 6.0.1, DataSource ClassCastException
这个异常

的时候删除这个jar包jdbc2_0-stdext.jar(hibernate带的),可以查询下DataSource这个类在哪些包中没用的都删掉

4、重启发布成功ok

相关推荐