- ► 2010 (20)
- ► 2009 (59)
- ► 2008 (50)
- Apache JAMES Server 2.3.1 released
- Apachecon Flickr Group
- Cows go out
- UK tests Moon lander technology
- Democracy is getting sooo complicated...
- Quote of the [specify timeperiod]
- Apache James at Apachecon US 2007
- JSR-000313 Java Platform, Enterprise Edition 6 Spe...
- Still having trouble with ClassCastException?
- Gmail atom feeds - per label
- Apache James at Apachecon EU 2007
- Ain't it a weird new world we live in...
- Swim Across the Atlantic ocean 3,462 miles
- ▼ April (13)
Monday, April 16, 2007
swim across the atlantic ocean" is about to overtake it thanks, I can only guess, to fans of Detroit Roller Derby (don't ask ...).
So to be helpful to those readers who are not from Michigan I thought I'd clarify things as much as I can, be warned though it isn't much.
Because Sun's spec doesn't enforce a requirement for ClassCastExceptions to show the classes of the objects which you are trying to cast (see this earlier post) it is normally only possible to make any sense of a ClassCastException by reading the source code, and you really need to attach a debugger and examine the object that your programme is trying to cast before you can start to figure out why it won't work.
If your object seems to be of the correct class the problem is probably related to ClassLoaders, this article explains succinctly why that happens.
Sometimes, if you're smart, you can make a smart guess.
Sometimes (more often if programmers will take my advice) the exception message will tell you, but don't count on it.
If you are seeing a ClassCastException being thrown by a product you have installed then you need to check its documentation.
If the documentation doesn't help then you need to get help from the people who wrote it.
The Apache Software Foundation Announces Apache® cTAKES™ v4.0 - *Widely adopted Open Source biomedical data extraction, annotation, and clinical information management platform now faster and easier to use.* *Forest Hil...6 hours ago
ApacheCon Seville 2016 – Building a Container Solution on Top of Apache CloudStack- Steve Roles - Building a Container Solution on Top of Apache CloudStack- Steve Roles Cloud native applications running in containerised environments look set to create a...2 months ago
You’re invited to help us celebrate an unlikely pairing in open source - We are just days away from reaching a significant milestone for our team and the open source and open standards communities: the first anniversary of Micro...4 years ago
I know nothing, I'm not a fortune teller, and you'd be insane to think that I am. This disclaimer was cribbed from an email footer I once received. It is so ridiculous I had to have it for myself.
Statements in this blog that are not purely historical are forward-looking statements including, without limitation, statements regarding my expectations, objectives, anticipations, plans, hopes, beliefs, intentions or strategies regarding the future. Factors that could cause actual results to differ materially from the forward looking statements include risks and uncertainties such as any unforeseen event or any unforeseen system failures, and other risks. It is important to note that actual outcomes could differ materially from those in such forward-looking statements.
Danny Angus Copyright © 2006-2013 (OMG that's seven years of this nonsense)