简体   繁体   English

WebMethods8.2中的Axis2 WS使用者

[英]Axis2 WS consumer in WebMethods8.2

I've got into a scenario where I have to get an Axis2 based ws consumer working within WebMethods as a java service. 我遇到了一个场景,我必须让基于Axis2的ws使用者在WebMethods中作为Java服务工作。 I've implemented the ws consumer first in netbeans just to see if it works and thus i found that the minimal amount of jars I'll require are the following: 我首先在netbeans中实现了ws消费者,只是看它是否有效,因此我发现我需要的最少量jars是:

[ xmlschema-1.4.7.jar, apache-mime4j-core-0.7.2.jar, axiom-api-1.2.13.jar, axiom-impl-1.2.13.jar, axis2-adb-1.6.2.jar, axis2-kernel-1.6.2.jar, axis2-transport-http-1.6.2.jar, axis2-transport-local-1.6.2.jar, commons-codec-1.3.jar, commons-httpclient-3.1.jar, commons-logging-1.1.1.jar, httpcore-4.0.jar, mail-1.4.jar, neethi-3.0.2.jar, wsdl4j-1.6.2.jar ] [xmlschema-1.4.7.jar,apache-mime4j-core-0.7.2.jar,axiom-api-1.2.13.jar,axiom-impl-1.2.13.jar,axis2-adb-1.6.2.jar ,axis2-kernel-1.6.2.jar,axis2-transport-http-1.6.2.jar,axis2-transport-local-1.6.2.jar,commons-codec-1.3.jar,commons-httpclient-3.1.jar ,commons-logging-1.1.1.jar,httpcore-4.0.jar,mail-1.4.jar,neethi-3.0.2.jar,wsdl4j-1.6.2.jar]

I've uploaded these jar files under the IS/packages/{package_name}/code/jars folder. 我已将这些jar文件上传到IS / packages / {package_name} / code / jars文件夹下。 Whenever I try to execute the java service that would send the request and process the response I get the following exception: 每当我尝试执行将发送请求并处理响应的java服务时,都会收到以下异常:

java.lang.reflect.InvocationTargetException: org.apache.axiom.om.OMFactory.getMetaFactory()Lorg/apache/axiom/om/OMMetaFactory; java.lang.reflect.InvocationTargetException:org.apache.axiom.om.OMFactory.getMetaFactory()Lorg / apache / axiom / om / OMMetaFactory;

From the IS error log file I found that the actual error message is as follows: 从IS错误日志文件中,我发现实际的错误消息如下:

org.apache.axiom.om.OMFactory.getMetaFactory()Lorg/apache/axiom/om/OMMetaFactory; org.apache.axiom.om.OMFactory.getMetaFactory()Lorg /阿帕奇/公理/ OM / OMMetaFactory; Caused by: java.lang.reflect.InvocationTargetException: null Caused by: java.lang.NoSuchMethodError:org.apache.axiom.om.OMFactory.getMetaFactory()Lorg/apache/axiom/om/OMMetaFactory; 原因:java.lang.reflect.InvocationTargetException:null原因:java.lang.NoSuchMethodError:org.apache.axiom.om.OMFactory.getMetaFactory()Lorg / apache / axiom / om / OMMetaFactory;

The platform is WebMethods 8.2 under Linux environment. 该平台是Linux环境下的WebMethods 8.2。 The JDK version is 1.6.0_32 and the application server under WebMethods is Jetty. JDK版本是1.6.0_32,WebMethods下的应用程序服务器是Jetty。

Actually the solve of this problem was a bit more tricky. 实际上,解决这个问题要复杂得多。 First of all I manually had to configure the manifest file of the package on the IS server to use the jars provided in the package abnd thus it wouldn't get in conflict with the Axis used by the IS itself. 首先,我必须手动在IS服务器上配置软件包的清单文件,以使用软件包中提供的jar,因此它不会与IS本身使用的Axis发生冲突。 On the other hand I had to manually add the ClassLoader because WebMethods can't use META-INF based information from jar files as it seems. 另一方面,我不得不手动添加ClassLoader,因为WebMethods似乎无法使用jar文件中基于META-INF的信息。 To solve this problem simply use: 要解决此问题,只需使用:

System.setProperty("org.apache.axiom.om.OMMetaFactory", "org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory");

That solves all the problems. 那解决了所有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM