Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16560

Cannot send mails from XWiki instances on JAVA 11+

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 11.6-rc-1, 11.3.2
    • 11.3, 11.4, 11.5
    • Dependency Upgrades
    • Windows 10 Pro 64 bit, IE11, using a local instance of XWiki 11.5, on MySQL 5.7 and HSQL 2.5.0 (tested on JAVA 8 and JAVA 11)
    • Unknown
    • N/A
    • N/A

    Description

      STEPS TO REPRODUCE

      1. Login as Admin
      2. Configure Mail Sending section from Administration
      3. Go to Main.WebHome (or other page) and share the page by mail

      EXPECTED RESULTS

      The page is shared successfully.

      ACTUAL RESULTS

      An error occurs in the browser and the mail is not sent:

       Error number 4001 in 4: Error while evaluating velocity template shareinline.vm 

      Also, in console there is the following stacktrace:

      2019-07-02 15:44:46,447 [http://localhost:1150/xwiki/bin/get/Main/?form_token=699WqQUxg0JRsLa4FeXj8g&send=1&target=XWiki.U1&target=&includeDocument=link&message=I+wanted+to+share+this+page+with+you.&xpage=shareinline] ERROR c.x.x.XWiki                    - Error while evaluating velocity template [shareinline.vm]
      org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [/templates/shareinline.vm]
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:227)
              at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:358)
              at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:884)
              at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:755)
              at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:730)
              at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
              at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:729)
              at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:708)
              at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:694)
              at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78)
              at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2381)
              at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:179)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:513)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:215)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
              at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
              at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
              at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
              at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
              at org.eclipse.jetty.server.Server.handle(Server.java:530)
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
              at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
              at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
              at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
              at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
              at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
              at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'sendMessageFromTemplate' in  class com.xpn.xwiki.plugin.mailsender.MailSenderPluginApi threw exception java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport at 84:/templates/shareinline.vm[line 51, column 45]
              at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:261)
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187)
              at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
              at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
              at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
              at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420)
              at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420)
              at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
              at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
              at org.apache.velocity.runtime.parser.node.ASTElseIfStatement.render(ASTElseIfStatement.java:92)
              at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
              at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
              at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
              ... 63 common frames omitted
      Caused by: java.lang.NoClassDefFoundError: com/sun/activation/registries/LogSupport
              at javax.activation.MailcapCommandMap.<init>(MailcapCommandMap.java:149)
              at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:55)
              at javax.activation.DataHandler.getCommandMap(DataHandler.java:137)
              at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:599)
              at javax.activation.DataHandler.writeTo(DataHandler.java:299)
              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.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 com.xpn.xwiki.plugin.mailsender.MailSenderPlugin.createMimeMessage(MailSenderPlugin.java:256)
              at com.xpn.xwiki.plugin.mailsender.MailSenderPlugin.sendMails(MailSenderPlugin.java:652)
              at com.xpn.xwiki.plugin.mailsender.MailSenderPlugin.sendMail(MailSenderPlugin.java:599)
              at com.xpn.xwiki.plugin.mailsender.MailSenderPlugin.sendMail(MailSenderPlugin.java:585)
              at com.xpn.xwiki.plugin.mailsender.MailSenderPlugin.sendMailFromTemplate(MailSenderPlugin.java:761)
              at com.xpn.xwiki.plugin.mailsender.MailSenderPlugin.sendMailFromTemplate(MailSenderPlugin.java:809)
              at com.xpn.xwiki.plugin.mailsender.MailSenderPluginApi.sendMessageFromTemplate(MailSenderPluginApi.java:148)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
              at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
              at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
              ... 83 common frames omitted
      Caused by: java.lang.ClassNotFoundException: com.sun.activation.registries.LogSupport
              at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
              at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:565)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
              ... 112 common frames omitted 

       

      This affects also the notifications sent by mail.

      I've tested also on JAVA 8 and the mails are sent properly.

      I've tested also on XWiki 11.3 and 11.4 and the issue reproduces as well.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: