Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to everyone for their responses. I was unable to get the autowiring to work, but I got the overall email solution to work by doing the following:</p> <ol> <li><a href="http://docs.oracle.com/cd/E21764_01/apirefs.1111/e13952/taskhelp/mail/CreateMailSessions.html" rel="nofollow">setup</a> the mailSession in weblogic, with a jndi name of "myMailSession"</li> </ol> <p>add to servlet-context.xml:</p> <pre><code>&lt;beans:bean id="mailSession" class="org.springframework.jndi.JndiObjectFactoryBean"&gt; &lt;beans:property name="jndiName" value="myMailSession" /&gt; &lt;/beans:bean&gt; &lt;beans:bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"&gt; &lt;beans:property name="session" ref="mailSession"/&gt; &lt;/beans:bean&gt; &lt;beans:bean id="emailServiceImpl" class="com.name.here.business.EmailServiceImpl"&gt; &lt;beans:property name="mailSender" ref="mailSender"/&gt; &lt;/beans:bean&gt; </code></pre> <p>add to web.xml:</p> <pre><code>&lt;resource-ref&gt; &lt;description&gt;the email session&lt;/description&gt; &lt;res-ref-name&gt;myMailSession&lt;/res-ref-name&gt; &lt;res-type&gt;javax.mail.Session&lt;/res-type&gt; &lt;res-auth&gt;Container&lt;/res-auth&gt; &lt;/resource-ref&gt; </code></pre> <p>add to weblogic.xml:</p> <pre><code>&lt;resource-description&gt; &lt;res-ref-name&gt;myMailSession&lt;/res-ref-name&gt; &lt;jndi-name&gt;myMailSession&lt;/jndi-name&gt; &lt;/resource-description&gt; </code></pre> <p>EmailServiceImpl:</p> <pre><code>@Service public class EmailServiceImpl implements EmailService { private JavaMailSender mailSender; public void setMailSender(JavaMailSender mailSender) { this.mailSender = mailSender; } //..other code } </code></pre>
    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