aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes strange ClassCastException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "strange ClassCastException " Watch "strange ClassCastException " New topic
Author

strange ClassCastException

pj kode
Greenhorn

Joined: Aug 26, 2003
Posts: 1
hi,
the following code is working fine when I am running it as an application.I am working on linux platform.but the same code shows ClassCastException at run time when i am running it inside my application which is running inside the web server as a .war file.please help me.

javax.mail.Session session = getCommonSession(true);
javax.mail.Store theStore = session.getStore("imap");
IMAPStore store = (IMAPStore)theStore;
thanks
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1815
Hi, PJ, and Welcome to JavaRanch!
You might try the following line:
System.out.println(theStore.getClass().getName());
to see what class you are actually working with, and wheter or not it can be cast to an IMAPStore.
Please note the following from the IMAPStore javadoc (I assume that you are using SUN's):
WARNING: The APIs unique to this class should be considered EXPERIMENTAL. They may be changed in the future in ways that are incompatible with applications using the current APIs.
(This holds true for pretty much anything in the com.sun.* packages; SUN actively discourages their use, as they are prone to sudden, unannounced changes. SUN does not consider them part of the public API)


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: strange ClassCastException
 
Similar Threads
OracleCallableStatment in Tomcat
sorting a Vector
importing j2ee package in an applet
Oracle-ds.xml and Connection Pooling
Oracle-ds.xml and Connection Pooling