开发者

ClassCast exception issue

开发者 https://www.devze.com 2023-01-20 13:00 出处:网络
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

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 e开发者_运维技巧xpected for getAllExplicitPaths(). Since i got classcast exp, i casted it to type Object.

Still i am getting the same error.

Any help is appriciated.

Thanks...


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号