Websphere7下部署axis2和cxf

axis2下载:http://axis.apache.org/axis2/java/core/download.cgi

最新的是1.6.2.将下载的war包直接部署websphere7时,会报错。

官方文档:http://axis.apache.org/axis2/java/core/docs/app_server.html

对在websphere下部署1.6.2给了详细的方案。但依然部署失败。报错为moduleavailable。

axis2官方给的部署方案:

1.BeforedeployingtheAxis2WAR,edittheaxis2.xmlfileandsettheEnableChildFirstClassLoadingparametertotrue.

PleasenotethatthisparameterisonlysupportedinAxis21.5.5orhigher.Theparameterisalreadypresentinthedefaultaxis2.xml

fileincludedintheWARdistribution,butitsvalueissettofalse.Thereforeitisenoughtochangetheparametervalue.

2.Afterdeployment,modifytheapplicationconfigurationtoenableparentlastclassloadingfortheWebmodule:intheWebSphereadminconsole,gothetheconfigurationpagefortheenterpriseapplication,clickonManageModulesandlocatetheWARcontainingAxis2(inthedefaultWARdistribution,

themoduleiscalledApache-Axis2),thenchangetheClassloaderorderoptiontoClasses

loaded with local class loader first (parent last). Note that the class loader policy for the enterprise application itself (which can be specified under Class loading and update detection) is irrelevant, unless a custom EAR distribution is used that includes the Axis2 libraries in the EAR instead of the WAR.

无奈之下查websphere的文档。。

IBM针对websphere7下axis2和cxf的部署安装有专门的文档和示范例子供下载:

http://www.ibm.com/developerworks/websphere/library/techarticles/1001_thaker/1001_thaker.html

文档是09年写的,里面的axis2是1.5版的。

可惜,按照1.5版的方法部署1.62还是失败,报异常:

servletAxisAdminServlet创建了未捕获到的init()异常:

javax.servlet.ServletException:javax.servlet.ServletException:

org.apache.axis2.AxisFault:Thesystemisattemptingtoengageamodulethatisnotavailable:addressing

最后,无奈还是选了axis21.5版的,按照示例,部署服务成功。

IBM文档里面有详细的图示,就不上图了。

简而言之,三个步骤:

1.应用的classloader顺序配置变为本地包优先。

2.war包里面META-INF里面的MANIFEST.MF加上:DisableIBMJAXWSEngine:true

3.如果标准的axis1.5部署还是失败,将IBM示例的axis1.5 lib下所有jar包覆盖标准包,标准lib中可能少jar包导致。

以上三步做完,重新启动websphere服务器。

CXF按照IBM示范文档部署正常,不多说了。

相关推荐