• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Configuring Mail Session for Orion

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
whippersnapper
Posts: 1843
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@michael:
done
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic