Cannot be cast to class because they are in unnamed module of loader ‘app’

We Are Going To Discuss About Cannot be cast to class because they are in unnamed module of loader ‘app’. So lets Start this Java Article.

Cannot be cast to class because they are in unnamed module of loader ‘app’

  1. Cannot be cast to class because they are in unnamed module of loader 'app'

    I had a similar case, and (as mentioned by @Holger in the comment) the module info in the message is simply misleading – this is an actual case of trying to cast something to something that doesn't match it.

  2. Cannot be cast to class because they are in unnamed module of loader 'app'

    I had a similar case, and (as mentioned by @Holger in the comment) the module info in the message is simply misleading – this is an actual case of trying to cast something to something that doesn't match it.

Solution 1

I had a similar case, and (as mentioned by @Holger in the comment) the module info in the message is simply misleading – this is an actual case of trying to cast something to something that doesn’t match it.

In your case, ClientImpl simply is not a subtype of XigniteCurrenciesSoap.

Original Author Of This Content

Solution 2

The stacktrace is trying to tell you that you have casted XigniteCurrenciesSoap to ClientImpl.

Such as the example below:

Object returnObj= getXigniteCurrenciesSoap();
return (ClientImpl) returnObj;

You have to find out where you did that in your code and fix it.

Original Author Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment