1

I am developer at Capgemini and I have an issue with a Java EE application that I am developing.

I am calling a webservice with Axis2 in a junit test in a project and it works. But when I call the same method in an other project that refers to the first (with maven dependencies) and I launch my application I have the following error :

java.lang.NoSuchMethodError: org/apache/axiom/om/OMFactory.createOMElement(Lorg/apache/axiom/om/OMDataSource;)Lorg/apache/axiom/om/OMSourcedElement;

Does anyone has an idea of what I am doing wrong?

If you need more information ask me.

Thank you

Matteo Baldi
  • 5,613
  • 10
  • 39
  • 51

1 Answers1

2

The error means that the second project runs with a version of the Axiom library that is older than the version expected by the first project. There are two possible reasons for that:

  • The runtime environment in which you deploy the second project has its own version of Axiom. That would e.g. be the case for a Java EE application deployed on WebSphere.

  • The second project has another (direct or indirect) dependency on the Axiom library with a different version as the first project, and Maven selects that version. You should be able to see that when you execute mvn dependency:tree on the second project. If that's the case, add a dependencyManagement section to the POM to force it to use the right version.

Andreas Veithen
  • 8,868
  • 3
  • 25
  • 28