No provider for smtp

38 views
Skip to first unread message

Juan Corrales

unread,
Apr 5, 2019, 7:53:22 AM4/5/19
to Dataverse Users Community
Hi all,

  in e-cienciaDatos (https://edatos.consorciomadrono.es) feedback and contact mails are not sending. We have a NoSuchProviderException in the server.log. We have found this exception in v4.11 and v4.8.3, but not in v4.9.3.

  In our current installation, code calls to MailServiceBean.sendMail (String from, String to, String subject, String messageText) and not to MailServiceBean.sendMail(String host, String reply, String to, String subject, String messageText).
  
  We have "solved" this problem harcoding our localhost mail server:
    public void sendMail(String reply, String to, String subject, String messageText, Map<Object, Object> extraHeaders) {
        try {
            Properties props = System.getProperties();
            String host="127.0.0.1";
            props.put("mail.smtp.host", host);
            Session session = Session.getDefaultInstance(props, null);

  Our asadmin call was:
asadmin create-javamail-resource --mailhost 127.0.0.1 --mailuser eciencia\@consorciomadrono\.es --fromaddress eciencia\@consorciomadrono\.es mail/notifyMailSession

  javax.mail.NoSuchProviderException: No provider for smtp
       at javax.mail.Session.getProvider(Session.java:479)
       at javax.mail.Session.getTransport(Session.java:681)
       at javax.mail.Session.getTransport(Session.java:662)
       at javax.mail.Session.getTransport(Session.java:719)
       at javax.mail.Transport.send0(Transport.java:248)
       at javax.mail.Transport.send(Transport.java:124)
       at edu.harvard.iq.dataverse.MailServiceBean.sendMail(MailServiceBean.java:205)
       at edu.harvard.iq.dataverse.MailServiceBean.sendMail(MailServiceBean.java:168)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
       at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
       at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4786)
       at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
       at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
       at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
       at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)
       at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
       at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
       at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
       at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
       at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
       at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
       at sun.reflect.GeneratedMethodAccessor113.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
       at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
       at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
       at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4758)
       at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4746)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
       at com.sun.proxy.$Proxy243.sendMail(Unknown Source)
       at edu.harvard.iq.dataverse.__EJB31_Generated__MailServiceBean__Intf____Bean__.sendMail(Unknown Source)
       at edu.harvard.iq.dataverse.SendFeedbackDialog.sendMessage(SendFeedbackDialog.java:212)

[...]

Could it be a configuration problem or a Dataverse bug?

Best regards,

Juan

Philip Durbin

unread,
Apr 5, 2019, 8:00:14 AM4/5/19
to dataverse...@googlegroups.com
Hi Juan,

If not a bug in the code, it sounds like the installation guide could be improved (the code and docs are in the same git repo). Can you please open an issue at https://github.com/IQSS/dataverse/issues ?

Thanks!

Phil

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To post to this group, send email to dataverse...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/c65481b4-13a9-463e-863a-29b7727d7ce5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Juan Corrales

unread,
Apr 5, 2019, 8:09:01 AM4/5/19
to dataverse...@googlegroups.com
Thanks Phil,

  I will open the issue next Monday.
  Best,

Juan


You received this message because you are subscribed to a topic in the Google Groups "Dataverse Users Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dataverse-community/Ti8LkHOz6-c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dataverse-commu...@googlegroups.com.

To post to this group, send email to dataverse...@googlegroups.com.

Philip Durbin

unread,
Apr 5, 2019, 12:58:33 PM4/5/19
to dataverse...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages