dcsimg
ClassCastException error with ctx.lookup(String);
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Garrett_Smith
Posted On:   Friday, October 25, 2002 12:13 AM

I don't understand how this code: Session session; try{ session = (Session) envCtx.lookup(Mailer.url); } catch(ClassCastException cce){ throw new ClassCastException("envCtx.lookup(Mailer.url).class = " +envCtx.lookup(Mailer.url).getClass().getName()); } can produce the following error: java.lang.ClassCastException: envCtx.lookup(Mailer.url).class = javax.mail.Session at com.dhtmlkitchen.reg.mail.Mailer.sendMail(Mailer.java:110) at com.dhtmlkitchen.reg.mail.Mailer.sendReminder(Mailer.java:72) at com.dhtmlkitchen.reg.ChangeAccount.doPost(ChangeAccount.java:68) But it happens every time.    More>>

I don't understand how this code:

			
Session session;
try{
session = (Session) envCtx.lookup(Mailer.url);
}
catch(ClassCastException cce){
throw new ClassCastException("envCtx.lookup(Mailer.url).class = "
+envCtx.lookup(Mailer.url).getClass().getName());
}

can produce the following error:

			
java.lang.ClassCastException: envCtx.lookup(Mailer.url).class = javax.mail.Session
at com.dhtmlkitchen.reg.mail.Mailer.sendMail(Mailer.java:110)
at com.dhtmlkitchen.reg.mail.Mailer.sendReminder(Mailer.java:72)
at com.dhtmlkitchen.reg.ChangeAccount.doPost(ChangeAccount.java:68)

But it happens every time.    <<Less
About | Sitemap | Contact