I just recently ported from Codehaus XFire to Apache CXF.
There's lots of little gotchas in that migration process. One problem is that existing libraries that worked, might not work now because CXF depends on a whole heap of libraries that could be identical to older/newer versions of libraries your project is already depending on. You might get some ClassNotFound exceptions, etc ... it's probably because you've got multiple instances of it sitting in your jars.
One of these annoying gotchas has to do with the mail api. CXF includes a whole heap of geronimo libraries out of the box. One of them it requires is geronimo-javamail_1.4_spec (v1.3). This overrides javamail. v1.3 is old. There is also a bug with SMTPS in this version since the provider class name is called by the name "SMTPTSransport" which is obviously a spelling problem. Secondly, the provider classes are not automatically pulled back by Maven (since they don't seem to be defined in the pom properly).
The way around this is to include the following maven dependencies in addition to your CXF maven dependencies:
* org.apache.geronimo.specs.geronimo-javamail_1.4_spec:1.7
* org.apache.geronimo.javamail.geronimo-javamail_1.4_provider:1.6
The providers miraculously become available, and your code fires up again.
Just another tip for those that fight the endless cycle of dependency and classloader problem resolution. Hope it helps someone.
Wednesday, March 25, 2009
Subscribe to:
Posts (Atom)
