On 20/06/2012 14:10, Bob Lannoy wrote:
Hi Francesco,
glad you understand the problem ;)
I'm using core as an artifact. I tried putting this into the core
pom.xml but the libs are still there. I guess this is because of the
war-overlay.
I added this to the core pom.xml and it seems to remove the libs:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay>
<groupId>org.apache.syncope</groupId>
<artifactId>syncope-core</artifactId>
<excludes>
<exclude>WEB-INF/lib/geronimo-javamail_1.4_provider-*.jar</exclude>
<exclude>WEB-INF/lib/geronimo-javamail_1.4_spec-*.jar</exclude>
</excludes>
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
Correct :)
On 20 June 2012 13:35, Francesco Chicchiriccò <[email protected]> wrote:
On 20/06/2012 13:26, Bob Lannoy wrote:
Hi,
I'm using the notification system and it happily sends emails in its own
container (tomcat 6).
However, we've deployed syncope on a tomcat container together with
another webapp that uses the javamail jar from Sun. When syncope is the
first one to send emails, the other app can't send any since it looks for
handler classes associated with the mime-type of the email to send. When the
other app is first to send an email (after a server restart) it succeeds,
but then syncope fails to send an email, stating it can't find com.sun.*
classes related to the mime-type.
The exception is:
org.apache.geronimo.javamail.transport.smtp.SMTPSendFailedException: Send
failure (javax.mail.MessagingException:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type
multipart/mixed;
On this web page
(http://blog.hpxn.net/2009/12/02/tomcat-java-6-and-javamail-cant-load-dch/)
there is some info on the problem. When I put the activation debugging on I
get the underlying exception:
Can't load DCH com.sun.mail.handlers.multipart_mixed; Exception:
java.lang.ClassNotFoundException: com/sun/mail/handlers/multipart_mixed.
It seems that the activation framework loads the mimetype list and the
associated classes once for both webapps.
The working solution at the moment is to delete the geronimo javamail
libraries in syncope and put in the javamail library from the other app.
Anyone seen this behaviour?
Hi Bob,
I haven't encountered the problem you describe above but it - unfortunately
- sounds more than logical to me :(
As you suggest, the problem derives from an incompatibility between "stock"
mail.jar and activation.jar and the ones that are shipped by default with
Syncope, from Geronimo.
Probably the cleanest solution that comes into my mind is:
1. set the Geronimo mail deps as 'provided' in your project core's POM: this
will avoid these two JAR files to be included in your core WAR package
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-javamail_1.4_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.javamail</groupId>
<artifactId>geronimo-javamail_1.4_provider</artifactId>
<scope>provided</scope>
</dependency>
2. add "stock" activation.jar in your external Tomcat's classpath (mail.jar
should already be in $CATALINA_HOME/lib)
How do you see this?
Regards.
--
Francesco Chicchiriccò
ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/