[jboss-user] [EJB 3.0] - Resource Injection

mihochan do-not-reply at jboss.com
Thu Feb 1 22:59:11 EST 2007


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

  |   <!-- 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 at 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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009837#4009837

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009837

More information about the jboss-user mailing list