1.was下webservice发布失败

日志:

Error: java.lang.NoSuchMethodError: javax.wsdl.Operation: method getExtensibilityElements()Ljava/util/List; not found at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateOperations(WSDL11ToAxisServiceBuilder.java:1241) at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populatePortType(WSDL11ToAxisServiceBuilder.java:447) at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpoints(WSDL11ToAxisServiceBuilder.java:360) at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:281) at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:109) at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLFile(ArchiveReader.java:230) at org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLs(ArchiveReader.java:332) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:64) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:137) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:571) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:141) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:318) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:220) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:118) at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:272) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:78) at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:500) at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:420) at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:262) at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1319) at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:84) at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:745) at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:493) at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:379) at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:114) at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:127) at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:776) at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:729) at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:140) at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1019) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1028) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:538) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:724) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:683) at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:1678) at com.ibm.ws.runtime.component.ComponentImpl$_AsynchInitializer.run(ComponentImpl.java:304) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)

 

解决:

打.aar包的时候不要把.WSDL文件打进去。

(引用:http://topic.csdn.net/u/20070517/18/053f6045-1ead-44a1-9992-b2041583fe08.html)

 

痕迹:

1.本机开发时(tomcat)没有此问题,但部署到webspere下,就出现该问题。在网上搜了一把日志,解决方案都是说环境的wsdl4j.jar与应用下wsdl4j-1.6.2.jar包冲突造成的。

第一次尝试了一下2中方案:

a)修改类加载顺序,操作如下:(失败)

Apache Muse - Conflicting Version of WSDL4J in WebSphere Deployments

When deploying your Muse-based applications on IBM WebSphere Application Server (WAS) 6.0 or 6.1, you need to be aware that Muse relies on WSDL4J 1.6.1 while the server's core libraries include WSDL4J 1.4. If you install your application using the default class loading system, it will fail to start because the Muse framework depends on WSDL4J APIs that are only available in WSDL4J 1.5 and above. To work around this issue, you can configure the server to use the application's class loader before the container or system class loaders; this will ensure that the WSDL4J classes that are in your application's /WEB-INF/lib directory will be loaded before those in $WAS_HOME/lib.

If you are developing and deploying your application through IBM Rational Application Developer (RAD), you can make the required changes by setting the class loader mode to PARENT_LAST and the class loader policy to SINGLE.

If you are installing your application through the WAS admin console, select Enterprise Applications > Your Application > Class loading and update detection. You should then check the boxes labeled as follows:

    * Classes loaded with application class loader first

    * Single class loader for application

Making these changes should not affect your other (non-Muse) applications because, having no WSDL4J JAR files of their own, the server will continue up the chain of class loaders until the container's class loader discovers WSDL4J 1.4 in $WAS_HOME/lib.

b)删除wsdl4j.jar。(成功,生产上不可行)

操作步骤:发布完应用,删除wsdl4j.jar,重启服务,webservice发布成功,was不能再发布新的应用。

2.分析源码:

a)反编译wsdl4j和wsdl4j-1.6.2中Operation都没找到getExtensibilityElements

b)重新搜索Operation.getExtensibilityElements,找上面那篇文章解决问题。

 

总结:

1.新版本的东西要按流程操作,不要自己随意发挥。看readme、demo。

2.必要时初始化。在错误上解决问题,是一错再错,开始就错了,为弥补错误的解决方式,无论结果都是错的。可能无可避免得发生错误,僵局时还是要把握策略,不能走的更远,差点否认了axis2,打算回去使用axis1。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值