0 Replies Latest reply on Feb 1, 2007 10:59 PM by mihochan

    Resource Injection

    mihochan

      Hi,

      I am having trouble with resource injection.I have defined a Mail Session
      thus,

       <!-- Binds a javax.mail.Session object to JNDI name java:/LeadloaderMail -->
       <mbean code="org.jboss.mail.MailService"
       name="leadloading:service=LeadloaderMail,name=LeadloaderMail">
       <attribute name="JNDIName">LeadloaderMail</attribute>
       <attribute name="User">devcon2</attribute>
       <attribute name="Password">xxxxx</attribute>
       <attribute name="Configuration">
       <configuration>
       <property name="mail.store.protocol" value="imap"/>
       <property name="mail.transport.protocol" value="smtp"/>
       <property name="mail.user" value="devcon2"/>
       <property name="mail.imap.host" value="seth"/>
       <property name="mail.smtp.host" value="seth"/>
       <property name="mail.from" value="someone@somewhere.com"/>
       <property name="mail.debug" value="false"/>
       </configuration>
       </attribute>
       </mbean>
      


      which I want to inject into an MBean. I have tried numerous variations on a theme but none seem to work. What is worse, they fail silently. What am I doing wrong?

      The injection code I am using is thus;
       @Resource (mappedName="LeadloaderMail")
       Session session;
      


      Any pointers would be greatly appreciated.