Migrate From Sun Mail to Eclipse Angus Mail

To upgrade from brXM version 15 to version 16, you must migrate your implementation project from Sun Mail to Eclipse Angus Mail.

The project distribution generated by the Maven dist profile changes as a result of this migration.

Eclipse Angus provides the mail-api and activation-api implementations. Unlike the Sun jakarta.activation.jar and jakarta.mail.jar files, which included both API and implementation classes, Eclipse Angus requires you to add the jakarta.activation-api and jakarta.mail-api packages separately.

In recent brXM 15.x versions, Sun's mail and activation JARs were located in the Tomcat /common/lib directory within the distribution.

For brXM 16.0, the /common/lib directory must include:

  • angus-activation-2.0.2.jar
  • angus-mail-2.0.3.jar
  • jakarta.activation-api-2.1.3.jar
  • jakarta.mail-api-2.1.3.jar

Do not include any of these JARs in the CMS or site WAR files.

Follow the steps below to complete the migration.

Update Assembly Includes

Modify /src/main/assembly/common-lib-component.xml to update the library includes.

Replace:

<include>com.sun.activation:jakarta.activation</include> <include>com.sun.mail:jakarta.mail</include>

With:

<include>jakarta.activation:jakarta.activation-api</include> <include>jakarta.mail:jakarta.mail-api</include> <include>org.eclipse.angus:angus-activation</include> <include>org.eclipse.angus:angus-mail</include>

If you deploy on Bloomreach Cloud, include all four dependencies, even if your project does not use mail servers.

Update Java References

Update your Java source files to use the new package names. Replace all occurrences of com.sun.mail.smtp.* with org.eclipse.angus.mail.smtp.*.

In Bloomreach Content product code, this update was required in the com.onehippo.cms7.eforms.hst.util.mail.MailTemplate class from the Enterprise Forms add-on. This class is used by the ConfirmationBehavior and MailFormDataBehavior components.

Verify Dependencies and JARs

Check your implementation project's dependency tree and review the resulting CMS and site web applications in your distribution. The CMS and site WAR files must not contain any mail(-api) or activation(-api) JARs.

Share Feedback
Page: /about/upgrade-guides/v15-v16/migrate-from-sun-mail-to-eclipse-angus-mail
Section: About
Category *