Java casting / classloader issues

前端 未结 4 472
轻奢々
轻奢々 2021-01-14 17:10

Here is the simplified version of the problem:

 SomeClass c = (SomeClass) obj.getSomeClassParent()

not always but it happens sometimes to t

4条回答
  •  心在旅途
    2021-01-14 17:47

    From the image I see that it looks like a web application. I read 'catalina'. So there is a big chance, that it is a pure classloading problem.

    It could happen, for example, if the ImageReader you get from the ImageIO class was loaded by a different classloader (maybe because it's deployed in a different webapp), so the DicomImageReadParam object returned by the getDefaultReadParam() method is an instance of a - technically spoken - different class.

提交回复
热议问题