From d62d919dddd5d3634928197a5ce734a3020aae47 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Thu, 19 Sep 2019 09:05:08 +0000 Subject: [PATCH] Fix for javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/alternative; git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@181735 82a268e6-3cf1-43bd-a215-b396298e98cf --- distro/changelog.xml | 90 +++++++++++++------ pom.xml | 2 +- .../mailing/EmailNotificationsConsumer.java | 8 +- 3 files changed, 69 insertions(+), 31 deletions(-) diff --git a/distro/changelog.xml b/distro/changelog.xml index 6a07dd5..3a175b0 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,39 +1,57 @@ - + Fix for javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/alternative; + Removed Home Library dependency + + Bug #16725, Social networking: emails notification - - Feature #12613, Replace use of "$" character with "_" when sending notification emails about posts and messages + Feature #12613, Replace use of "$" character with "_" when + sending notification emails about posts and messages - - Added support for storage hub model in workspace related notifications - Feature #11739, Revise posts and comments notification emails + Added support for storage hub model in workspace related + notifications + Feature #11739, Revise posts and comments notification emails + - - partially removed portal context dependency (where possible) + partially removed portal context dependency (where possible) + added support to job notifications added support for ticket #6342 - Revised notification text Vre's name is now reported in email's subject - Added original discussion in email's body Vre's name is now reported in email's subject - Added message body in notifications for messages - Added Support for user reply via mail to post and comment notifications @@ -53,55 +71,64 @@ page - Fix for incident #1081 Notification html email formatting problems when post is favorited - Integrated notifications for set/unset shared folder administrator Integrated support for hashtags - Updated email format to actually send text plain emails without garbling html - Implemented direct email sending through an external SMTP Server (if available in the infrastructure) - Fixed bug when notifications involved error in the SMTP server - Fixed bug when notifications involved groups and email buffer was not cleared - Updated email format to both text plain and html Updated email sending with single smtp session Personalized notifications in email subjects - Updated email sender Added notification when a shared folder is a group Removed "notification" suffix in email subjects - Update email notifications, added (configurable) sender as normal text @@ -110,29 +137,34 @@ Added FTP Manager for uploading thumbnails when sharing files - Ported to Feather Weight Stack Removed GCF Dependency Logging with sl4j Enabled - Fix for #1874 Request for enhancement on shared folder notifications - Added support for Calendar Notifications - Modified delete item notifications. Distinguished the move from the delete in a shared folder - Support new user notification preference retrieve method for fine grained notifications @@ -140,12 +172,14 @@ Support for workspace notification items direct opening - Extended support for Notifications Added New Notification Types - First Release diff --git a/pom.xml b/pom.xml index c7ab111..18b898e 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.applicationsupportlayer aslsocial - 1.7.0-SNAPSHOT + 1.7.1-SNAPSHOT jar Social Portal ASL Extension diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/mailing/EmailNotificationsConsumer.java b/src/main/java/org/gcube/applicationsupportlayer/social/mailing/EmailNotificationsConsumer.java index 88b5702..50c4313 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/mailing/EmailNotificationsConsumer.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/mailing/EmailNotificationsConsumer.java @@ -8,6 +8,8 @@ import java.util.Date; import java.util.List; import java.util.Properties; +import javax.activation.CommandMap; +import javax.activation.MailcapCommandMap; import javax.mail.Address; import javax.mail.Message; import javax.mail.MessagingException; @@ -16,7 +18,7 @@ import javax.mail.Session; import javax.mail.Transport; import org.gcube.applicationsupportlayer.social.ScopeBeanExt; -import org.gcube.common.encryption.StringEncrypter; +import org.gcube.common.encryption.encrypter.StringEncrypter; import org.gcube.common.resources.gcore.ServiceEndpoint; import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint; import org.gcube.common.scope.api.ScopeProvider; @@ -113,7 +115,7 @@ public class EmailNotificationsConsumer extends Thread { else { //use localhost (probaly postfix instance) session = Session.getDefaultInstance(props); } - + session.setDebug(true); for (;;) { @@ -126,6 +128,8 @@ public class EmailNotificationsConsumer extends Thread { if (EmailPlugin.BUFFER_EMAILS != null && EmailPlugin.BUFFER_EMAILS.size() > 0) { _log.debug("Emails Buffer not empty, sending emails "); Transport t = null; + //should fix javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/alternative; + Thread.currentThread().setContextClassLoader( getClass().getClassLoader() ); try { t = session.getTransport("smtp"); t.connect();