aspose file tools*
The moose likes Other Java Products and Servers and the fly likes Configuring Mail Session for Orion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Configuring Mail Session for Orion" Watch "Configuring Mail Session for Orion" New topic
Author

Configuring Mail Session for Orion

rastin purr
Ranch Hand

Joined: Jul 20, 2002
Posts: 73
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

Joined: Oct 10, 2002
Posts: 39
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

Joined: Jul 20, 2002
Posts: 73
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

Joined: Oct 10, 2002
Posts: 39
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

Joined: Oct 10, 2002
Posts: 39
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

Joined: Mar 25, 2001
Posts: 1746
    
    2
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

Joined: Oct 10, 2002
Posts: 39
@michael:
done
 
 
subject: Configuring Mail Session for Orion