dcsimg
How to deploy mailBean in weblogic? need any changes in weblogic.properties?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   beula_sc
Posted On:   Tuesday, April 10, 2001 04:41 AM

I deployed mail bean,i made some changes in "weblogic.properties" like weblogic.httpd.MailSession.testBean= mail.from=myname@mycompany.com, mail.host=mailserver part of the program is as follows: Properties h = new Properties(); Message pmsMsg=null; try{ h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); h.put(Context.PROVIDER_URL, "t3://localhost:7001"); InitialContext ic = new InitialContext(h); Session session = (Session)ic.lookup("testBean"); Properties props = new Properties(); props   More>>

I deployed mail bean,i made some changes in "weblogic.properties"


like



weblogic.httpd.MailSession.testBean=

mail.from=myname@mycompany.com,

mail.host=mailserver



part of the program is as follows:


Properties h = new Properties();

Message pmsMsg=null;

try{

h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

h.put(Context.PROVIDER_URL, "t3://localhost:7001");

InitialContext ic = new InitialContext(h);

Session session = (Session)ic.lookup("testBean");

Properties props = new Properties();

props.put("mail.transport.protocol","smtp");

props.put("mail.smtp.host", "myserver");

props.put("mail.from", "myname@mycompany.com");

Session session2 = session.getInstance(props);

pmsMsg = new MimeMessage(session2);

}catch(Exception ess)

{

System.out.println("Exception in context: "+ess);

}


Exceptionis:


javax.naming.NameNotFoundException: 'testBean'; remaining name 'testBean'


if anyone has come across this please suggest

   <<Less
About | Sitemap | Contact