getting java class cast exception.

I want to get the owner ID of the work item. I used the below snippet to get the ID . But i end up with an error java class cast exception,
3 answers

Carefully follow this post and set up your environment for debugging the API: Understanding and Using the RTC Java Client API. In addiion that code does not help if it is unclear where the exception happens and what the handle is.
Comments

Hi Ralph,

There is no work item in your code above. You expect anyone to comment on code you don't show in the question?

The exaception thrown to indicate that your code has attempted to cast an object to a subclass of which it is not an instance. This means that ClassCastException occurs when you try to cast an instance of an Object to a type that it is not. Type Casting only works when the casted object follows an is a relationship to the type you are trying to cast to.
- When you try to cast an object of Parent class to its Child class type, this exception will be thrown.
- When you try to cast an object of one class into another class type that has not extended the other class or they don't have any relationship between them.