• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuring Mail Session for Orion

 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Does anyone know how to configure orion such that i get a Mail session returned when calling lookup method form initial context? I don't seems to find a mail.xml file under the config directory. Any sites that have orion information would be great.
Hopefully i get answered.
Thanks
Ras
 
christoph weingarten
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you are trying to send mails from within an orion-application you can use mail.jar.
or did i misunderstood your question?
 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi sni,
thanks for the answer.
I wanna know how to get a mail session from initial context (jndi)
for example
InitialContext ic=new InitialContext();
Session s=ic.lookup(mail/MyMail); /*this return the mail session*/
I know it could be done in jboss and many other j2ee container out there. Please help if you can
Thanks again
 
christoph weingarten
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can add resources for jndi-lookups in your ejb-jar.xml
here is an example:
.
.
<!-- my EntityBean -->
<entity><display-name>MyEJB</display-name>
.
.
<!-- database -->
<resource-ref><res-ref-name>jdbc/mydb</res-ref-name><res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<!-- simple String -->
<env-entry><env-entry-name>lifetime</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>60000</env-entry-value>
</env-entry>
.
.
</entity>
maybe it's allowed to add mail as a ressource. but i am not sure about that.
[ October 11, 2002: Message edited by: sni ]
 
christoph weingarten
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rastin,
try this:
<resource-ref>
<res-ref-name>mail/Mail</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
 
Michael Matola
whippersnapper
Ranch Hand
Posts: 1817
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sni,
Please take another look at the JavaRanch Naming Policy. We'd like to have you continue posting here, so please update your display name. You can do so here.
Thanks for fielding questions!
Michael
 
christoph weingarten
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@michael:
done
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic