See the email pasted below from the Rice user list. The solution that I think we need to do is just manually exclude the geronimo mail jar from our CXF dependency in our POM file.
We're using the rice-release-0-9-4-br code base, planning on having a
central rice instance for KIM but, at least for now, embedding KEW in
our application (embedded, not bundled, if I've kept the terms straight)
It was recently brought to my attention that the email we generate from
our application is now missing the "To:", "From:", and "Subject:" lines,
in our development version where we're adding the rice code.
I've tracked this problem down to the "Geronimo" javamail jar that we
get out of the rice build.
From what I've been able to glean so far, the rice pom.xml references
Apache CXF which, in turn, references Apache Geronimo. The ultimate
result is that several "geronimo-*.jar" files end up in our deployed
app, and specifically geronimo-javamail_1.4_spec-1.3.jar – which
conflicts with Sun's mail.jar
If I remove the geronimo javamail jar our email starts working again.
Since this is an implementation of JavaMail I thought I could remove the
standard mail.jar and use what Rice gave me, but when I tried that the
SMTP send fails because there's no transport class for it:
org.apache.geronimo.javamail.transport.smtp is not in any of the
geronimo-* jar files.
It seems there's a javamail-providers jar file I've seen mentioned while
trying to track this down, but it may be part of the CXF or Geronimo
Maven build and not out there available for a simple download; anyway, I
haven't found one.
Also, an old email thread from the cxf-user list
implies it is supposed to be safe to drop the geronimo jar in favor of
the standard sun mail.jar but there was once a dependency problem that's
likely fixed now.
Are the geronimo jars – the CXF and/or Geronimo classes – still used
in rice, or might they be cruft from earlier versions? That is, is it
safe to just delete the jar file that's giving me a problem?
If they're still used, is it safe at this point to delete that jar
anyway and rely on mail.jar for whatever dependencies rice has?
If it's not, that seems to imply that I have to switch to the Apache
Geronimo implementation for JavaMail, and in that case the rice pom
should also include the transport providers in some way, otherwise rice
will break existing email implementations.