error loading a BufferedImage from dicom

47 views
Skip to first unread message

Ronny Falk

unread,
Mar 17, 2014, 9:01:01 AM3/17/14
to dcm...@googlegroups.com
Hello,

I have a use case where I show a preview of a dicom file.

Iterator<ImageReader> readers = ImageIO.getImageReadersByMIMEType("application/dicom");
//exception here - sometimes

if (readers.hasNext()) {
 
//dicom supported
 
try {
   
BufferedImage image = ImageIO.read(inputFile);
 
} catch (IOException ex) {
   ex
.printStackTrace();
 
}
}

Now the weird thing is, this works - most of the time. When it does not work, I get the following exception:

Error handling a request: 96bb43363de0b44e
! java.lang.NoClassDefFoundError: Could not initialize class javax.imageio.ImageIO
! at com.rfx.cmr.support.ImageConverter.convert(ImageConverter.java:36) ~[cmrapi-1.0.0.jar:na]
...

Did anyone ever experience such an issue. I'm running the converter in a jetty container. My pom.xml has:

<dependency>
 
<groupId>org.dcm4che</groupId>
 
<artifactId>dcm4che-imageio</artifactId>
 
<version>3.3.0</version>
 
<exclusions>
       
<exclusion>
         
<groupId>org.slf4j</groupId>
         
<artifactId>slf4j-log4j12</artifactId>
       
</exclusion>
 
</exclusions>
</dependency>


thanks for your help,

best,
Ronny

Reply all
Reply to author
Forward
0 new messages