Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039576Openbravo ERPA. Platformpublic2018-11-01 08:282018-12-11 20:22
0039576: JDK 9+: cannot send email
It is not possible to send emails using Java 9, 10 or 11.
In an instance running on Java 10:

1. Open Client window and configure Email settings tabs
2. Create and complete a Sales Invoice
3. Click on Email toolbar button and send it
  -> ERROR: "An unexpected error has occurred"
   In logs:
java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport
    at javax.activation.MailcapCommandMap.<init>(
    at javax.activation.CommandMap.getDefaultCommandMap(
    at javax.activation.DataHandler.getCommandMap(
    at javax.activation.DataHandler.getDataContentHandler(
    at javax.activation.DataHandler.writeTo(
    at javax.mail.internet.MimeUtility.getEncoding(
    at javax.mail.internet.MimeBodyPart.updateHeaders(
    at javax.mail.internet.MimeBodyPart.updateHeaders(
    at javax.mail.internet.MimeMultipart.updateHeaders(
    at javax.mail.internet.MimeBodyPart.updateHeaders(
    at javax.mail.internet.MimeMessage.updateHeaders(
    at javax.mail.internet.MimeMessage.saveChanges(
    at javax.mail.internet.MimeMessage.writeTo(
    at com.sun.mail.smtp.SMTPTransport.sendMessage(
    at org.openbravo.erpCommon.utility.poc.EmailManager.sendEmail(
When running on Java 9 or 10, this issue can be workarrounded by adding JVM argument.

On Java 11, there is no workaround.
No tags attached.
related to feature request 0038196 closed platform support for JDK 10 
related to feature request 0037083 closed alostale support JDK 9 
related to feature request 0037064 closed caristu upgrade hibernate to 5.3.2 
depends on backport 00395773.0PR18Q4 closed alostale JDK 10+: cannot send email 
depends on backport 00395783.0PR18Q3.3 closed alostale JDK 10+: cannot send email 
depends on feature request 0038130 closed caristu support JDK 11 
Issue History
2018-11-01 08:28alostaleNew Issue
2018-11-01 08:28alostaleAssigned To => alostale
2018-11-01 08:28alostaleModules => Core
2018-11-01 08:28alostaleTriggers an Emergency Pack => No
2018-11-01 08:29alostaleReview Assigned To => caristu
2018-11-01 08:30alostaleStatusnew => scheduled
2018-11-01 08:34alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17892#r17892
2018-11-01 08:36alostaleRelationship addedrelated to 0038196
2018-11-01 09:43alostaleRelationship addeddepends on 0038130
2018-11-01 10:03alostaleProposed Solution updated
2018-11-01 11:26hgbotCheckin
2018-11-01 11:26hgbotNote Added: 0107707
2018-11-01 11:26hgbotStatusscheduled => resolved
2018-11-01 11:26hgbotResolutionopen => fixed
2018-11-01 11:26hgbotFixed in SCM revision => [^]
2018-11-01 12:21alostaleDescription Updatedbug_revision_view_page.php?rev_id=17894#r17894
2018-11-01 12:21alostaleProposed Solution updated
2018-11-01 12:21alostaleSummaryJDK 10+: cannot send email => JDK 9+: cannot send email
2018-11-01 12:22alostaleRelationship addedrelated to 0037083
2018-11-05 16:28caristuRelationship addedrelated to 0037064
2018-11-06 17:05egoitzIssue Monitored: egoitz
2018-11-06 17:38anderarangurenIssue Monitored: anderaranguren
2018-11-07 21:40galderromoIssue Monitored: galderromo
2018-11-08 19:34caristuNote Added: 0107814
2018-11-08 19:34caristuStatusresolved => closed
2018-11-08 19:34caristuFixed in Version => 3.0PR19Q1
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108451

2018-11-01 11:26   
Repository: erp/devel/pi
Changeset: 23b23158022977829e4eb1c88b202fa4b4a279b5
Author: Asier Lostalé <asier.lostale <at>>
Date: Thu Nov 01 09:54:53 2018 +0100
URL: [^]

fixed bug 39576: cannot send email with JDK10+

  It was not possible because mail libraries relies on some classes that were
  in hidden modules by default starting from JDK 10 and completelly reomved in

  Fixed by replacing javax.activation-api-1.2.0 by javax.activation-1.2.0

  Note javax.activation-api is not purely an API but it also includes implementation
  for classes in javax.activation package (which was included in previous JDKs)
  but it depends on classes in com.sun.activation which have also been removed
  from JDK and not included in activation-api jar but yes in activation one.

  The contents of javax.activation package are identicall in both jars.

  Note also javax.mail-1.6.1 depends on activation-1.1 (javax.activation:activation)
  to manage MIME data, that version was released in 2009; newer javax.activation-1.2.0
  (2017) has same API including new fixes.

M legal/Licensing.txt
A lib/runtime/javax.activation-1.2.0.jar
R lib/runtime/javax.activation-api-1.2.0.jar
2018-11-08 19:34   
Reviewed + tested OK.
2018-12-11 20:22   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test