grailsfan
grailsfan

Reputation: 35

GroovyCastException: Cannot cast object A with class A to class A

I've a problem with a grails 3 application using dcm4che3 DICOM toolkit.

First of all the code is running and doing what it is supposed to do. But after a while it's not working anymore and I receive a GroovyCastException.

This is the Exception message I don't really understand:

org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.dcm4che3.imageio.plugins.dcm.DicomImageReader@2e5177d0' with class 'org.dcm4che3.imageio.plugins.dcm.DicomImageReader' to class 'org.dcm4che3.imageio.plugins.dcm.DicomImageReader'

In my code it looks like this:

Iterator<ImageReader> iter    = ImageIO.getImageReadersByFormatName("DICOM");
DicomImageReader dReader      = (DicomImageReader) iter.next();

There is a image reader registered for DICOM. And it is returned and working well. But after a while it seems to brake somehow.

Any ideas or suggestions?

Thank you

grailsfan

Upvotes: 0

Views: 1529

Answers (0)

Related Questions