This content has been marked as final.
Show 1 reply
-
1. Re: Mail with JBoss
lafr May 31, 2005 2:14 PM (in response to kosl)Why do you want to use another jndi-name ? Why not simply use the given name java:/Mail ?
We use a stateless session bean for sending mails with this config and programming:* @ejb.resource-ref * res-ref-name="Mail" * res-type="javax.mail.Session" * res-auth="Container" * @jboss.resource-ref * res-ref-name="Mail" * jndi-name="java:/Mail"
...session = ServiceLocator.getInstance().getSession( "java:comp/env/Mail" );
...
As you can see, res-ref-name defines the the name under java:comp/env to use for accessing the ressource.
jndi-name is the name of the mail service in the jndi tree.