JavaPulse

a finger on the pulse of the freelance Java™ market in the Netherlands

Axis 1.4 dependency conflicts in Maven

Posted on | 22 September 2007 |
Tags: | |

Awhile back, I was converting an existing project from an Ant build to a Maven build. The project used Axis to send some soap messages. With the Ant build as a reference, I added the appropriate dependencies. But with the Maven build, the Axis call invoke method returned null without throwing an exception. Properly designed software would normally throw a useful exception. And I expect Axis would do so, since it is used so often. I was not able to find anything on the internet that described this problem. And even downloading Axis and debugging through it didn’t reveal what was happening.

Finally, I noticed that the Maven build (maven-dependency-plugin:copy-dependencies) added more external jars in the classpath than was previously in the Ant build. It contained gnujaxp which was added transitively by jfreechart, also used by the application. By excluding gnujaxp, the Axis call finally worked as expected. I guess the moral of the story is: when getting completely unexpected behavior, there is a good chance that it is dependency conflicts. Looking carefully at the Maven copied dependencies could reveal any unnecessary dependencies. It would be useful to know which part of the code uses which dependencies. In any case, I wonder how many implementation of jaxp are out there.

Comments

Leave a Reply