dcsimg
java.lang.ClassCastException when trying to send mail using weblogic(EntityBean)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   beula_sc
Posted On:   Tuesday, April 10, 2001 09:17 PM

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("ma   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:

java.lang.ClassCastException: occuring in the place of

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



if anyone has come across this please help me

   <<Less

Re: java.lang.ClassCastException when trying to send mail using weblogic(EntityBean)

Posted By:   AlessandroA_Garbagnati  
Posted On:   Wednesday, April 11, 2001 10:33 AM

Hi,

I've already answered to the other post:

http://www.jguru.com/forums/view.jsp?EID=401255.

Please, in the future, avoid to post the same message more than once.
About | Sitemap | Contact