• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Getting "Lookup Error Name comp/env/mail not found in context "java:"." error

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I am getting the "Lookup Error Name comp/env/mail not found in context "java:"., Failed to lookup the configuration path" error in the servlet.

The lines of code is
try{
Context initCtx = new InitialContext();
mailHost = (String) initCtx.lookup("java:comp/env/mail/mail_02");

} catch (NamingException e) {
AtlasLogger.info(
"DMUMail: Failed to lookup the configuration path");
AtlasLogger.error("DMUMail: Lookup Error " + e.getMessage());
}

Please advise me.Thanks.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like you're trying to get the default mail session from your container.

What container are you using?
 
mamata surapaneni
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using WSAD.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like you are trying to lookup a web application environment variable. Environment variables are set up in your web.xml file. Try adding something like this to your web.xml file:

[ July 24, 2007: Message edited by: Merrill Higginson ]
 
mamata surapaneni
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried this, still I am getting the same error. The error saying that 'Broken pipe cannot send mail, look up error, and "Lookup Error Name comp/env/mail not found in context "java:" .

Please help.
 
I child proofed my house but they still get in. Distract them with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic