Apache axis2/axiom NoSuchMethodError

7.3k views Asked by At

Using RAD v7 with WebSphere AS v6.1, I am receiving the following;

java.lang.NoSuchMethodError: org/apache/axiom/om/OMAbstractFactory.getMetaFactory()Lorg/apache/axiom/om/OMMetaFactory;

Other answers (here and here) have indicated that this is due to conflicting jars. I have installed the latest RAD/WS fixpack, made sure I'm using only one version of axis2 (v1.6.2) & axiom-api (v1.2.13), cleaned & built my workspace multiple times and made sure the correct jars are being deployed. I have also tried setting the WAS class loader policy to "parent last".

My question: Is there any reason other than conflicting jar versions that would cause this problem?

Longer error:

WebApp E [Servlet Error]-[EOEServlet]: java.lang.NoSuchMethodError: org/apache/axiom/om/OMAbstractFactory.getMetaFactory()Lorg/apache/axiom/om/OMMetaFactory; at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:150) at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:133) at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:104) at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:590) at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:575) at org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:97) at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:90) at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:857) at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:210) at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:151) at org.apache.axis2.client.ServiceClient.(ServiceClient.java:144)

4

There are 4 answers

0
Andreas Veithen On BEST ANSWER

Axis2 and Axiom are part of the WebSphere runtime in version 7.0 and above, as well as in version 6.1 with the Web Services Feature Pack installed. They provide the JAX-WS implementation in WebSphere and their classes are visible to applications. That causes conflicts with applications that package their own versions of these libraries. To solve this problem, you need to switch the class loader policy to parent last.

Note that in some cases this may not be enough and you need to make some additional changes as described here:

https://axis.apache.org/axis2/java/core/docs/app_server.html

4
paulsm4 On

For whatever it's worth, Axiom v1.2.13 is indeed the correct version to use with Axis2 v1.6.2.

I have WAS 8.5 (vs. your 6.1), and I stopped using RAD Developer a long time ago (I'm usually able to do everything I want/need with Eclipse).

But you might want to look at the WAS class loader viewer to determine whether your app is actually loading the correct .jars:

http://weblogic-wonders.com/weblogic/2012/12/18/troubleshooting-classloader-issues-with-websphere/

0
Raj kannan Iyyappan On

As noted in other answers , it is conflicting with web-sphere axis libraries. Create shared library with Axis2 jars and associate them with EAR works for me. Steps for creating shared library

0
Feng Zhang On

Agree with most of posts here. What we did is to add the axis2 (1.6.2) jar explicitly in our lib and redeployed. That fixed the issue.