java – ClassCast exception issue – Education Career Blog

I am getting this exception –

java Exception in thread “main” java.lang.ClassCastException: java.lang.Object cannot be cast to ws.v1.tmf854.snc.http.GetAllExplicitPathsResponse

though i have the code properly casted.
Have a look at the code below.

            Object t = expRPC.getAllExplicitPaths(mtosiHeader, mtosiBody);
            //expList = expRPC.getAllExplicitPaths(mtosiHeader, mtosiBody);

            System.out.println("Type---->"+t.getClass()+ t.hashCode() + t.toString());

The type of expList is the return type expected for getAllExplicitPaths().
Since i got classcast exp, i casted it to type Object.

Still i am getting the same error.

Any help is appriciated.



I think the cast error is not in the code you post…

Leave a Comment