Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039576Openbravo ERPA. Platformpublic2018-11-01 08:282018-12-11 20:22
alostale 
alostale 
urgentmajoralways
closedfixed 
5
 
3.0PR19Q1 
caristu
Core
No
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>(MailcapCommandMap.java:179)
    at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:85)
    at javax.activation.DataHandler.getCommandMap(DataHandler.java:167)
    at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:629)
    at javax.activation.DataHandler.writeTo(DataHandler.java:329)
    at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:340)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1573)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1172)
    at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:522)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1531)
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2271)
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2231)
    at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1910)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315)
    at org.openbravo.erpCommon.utility.poc.EmailManager.sendEmail(EmailManager.java:224)
When running on Java 9 or 10, this issue can be workarrounded by adding --add-modules=java.se.ee 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 => http://code.openbravo.com/erp/devel/pi/rev/23b23158022977829e4eb1c88b202fa4b4a279b5 [^]
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

Notes
(0107707)
hgbot   
2018-11-01 11:26   
Repository: erp/devel/pi
Changeset: 23b23158022977829e4eb1c88b202fa4b4a279b5
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Nov 01 09:54:53 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/23b23158022977829e4eb1c88b202fa4b4a279b5 [^]

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
  11.

  Fixed by replacing javax.activation-api-1.2.0 by javax.activation-1.2.0
  (com.sun.activation:javax.activation).

  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
---
(0107814)
caristu   
2018-11-08 19:34   
Reviewed + tested OK.
(0108451)
hudsonbot   
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: https://code.openbravo.com/erp/devel/main/rev/470e3cd384c5 [^]
Maturity status: Test