Note that there are some explanatory texts on larger screens.

plurals
  1. POjavax.mail.AuthenticationFailedException with Sun Java System Application Server 9.1 and Postfix Mail server
    primarykey
    data
    text
    <p>In my application, I have the following Message Driven Bean to connect to the Postfix SMTP server to send emails to user:</p> <pre><code>@MessageDriven(mappedName = "jms/OutgoingEmailQueue", activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") }) public class OutgoingEmailBean implements MessageListener { //Resource @Resource(name = "mail/MailSession") private Session mailSession; public void onMessage(Message message) { try { .... //Create the email javax.mail.Message email = new MimeMessage(mailSession); .... //Send the email Transport.send(email); } catch (Exception e) { System.out.println(e.toString()); } } } </code></pre> <p>When I deploy this application using NetBeans with GlassFish 2.1 on my laptop, it can connect to the SMTP server and send out emails perfectly. However, when I copy all the settings over to the online Sun Java System Application Server 9.1 and deploy my application, my application no longer can send out emails. Instead, I got the exception javax.mail.AuthenticationFailedException at the line "Transport.send(email)". In the server log, I saw these lines:</p> <pre><code>[#|2011-08-01T15:18:02.077+0400|SEVERE|sun-appserver9.1|ejb.Mailing.OutgoingEmailBean|_ThreadID=34;_ThreadName=p: thread-pool-1; w: 665;_RequestID=52699cfe-71a2-46be-83b0-f3af23d74c0c;|The log message is null. javax.mail.AuthenticationFailedException at javax.mail.Service.connect(Service.java:319) at javax.mail.Service.connect(Service.java:169) at javax.mail.Service.connect(Service.java:118) at javax.mail.Transport.send0(Transport.java:188) at javax.mail.Transport.send(Transport.java:118) at ejb.Mailing.OutgoingEmailBean.onMessage(OutgoingEmailBean.java:110) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067) at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176) at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895) at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986) at com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:1111) at com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:74) at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:179) at $Proxy93.onMessage(Unknown Source) at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:258) at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76) at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555) |#] </code></pre> <p>I spent 2 days looking around to make sure all the local settings of GlassFish 2.1 are identical to the settings of the online appserver but I still cannot solve the problem. I'd be very grateful if someone could give me an advice on how to tackle this issue.</p> <p>Best regards,</p> <p>James Tran </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload