Dicom イメージを読み取ろうとする次のコードがあります。
public BufferedImage readDicomFile(File dicomFile) {
ImageReader reader = (ImageReader) ImageIO.getImageReadersByFormatName("DICOM").next();
BufferedImage tempImage = null;
try {
if (!dicomFile.exists()) {
return null;
}
ImageIO.scanForPlugins();
tempImage = ImageIO.read(dicomFile);
DicomObject obj = new DicomInputStream(dicomFile).readDicomObject();
String overlayData = obj.getString(1610625024);
if ((overlayData != null) && (overlayData.length() > 0)) {
tempImage = combineImages(tempImage,
OverlayUtils.extractOverlay(obj, 1610625024, reader,
"FFFFFF"));
}
} catch (IOException ex) {
ex.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return tempImage;
}
しかし、これは私が得ているものです:
SEVERE: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.dcm4che.data.DcmParserFactory], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1401)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at org.dcm4cheri.imageio.plugins.DcmImageReaderSpi.canDecodeInput(DcmImageReaderSpi.java:113)
at javax.imageio.ImageIO$CanDecodeInputFilter.filter(ImageIO.java:567)
at javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:810)
at javax.imageio.spi.FilterIterator.<init>(ServiceRegistry.java:804)
at javax.imageio.spi.ServiceRegistry.getServiceProviders(ServiceRegistry.java:508)
at javax.imageio.ImageIO.getImageReaders(ImageIO.java:646)
at javax.imageio.ImageIO.read(ImageIO.java:1438)
at javax.imageio.ImageIO.read(ImageIO.java:1308)
at edu.kfshrc.dm.services.DicomViewerService.readDicomFile(DicomViewerService.java:565)
at edu.kfshrc.dm.services.DicomViewerService.extractImageFromDicom(DicomViewerService.java:414)
at edu.kfshrc.dm.servlet.DicomViewerServlet.doGet(DicomViewerServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
SEVERE: at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1401)
SEVERE: at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
SEVERE: at org.dcm4cheri.imageio.plugins.DcmImageReaderSpi.canDecodeInput(DcmImageReaderSpi.java:113)
SEVERE: at javax.imageio.ImageIO$CanDecodeInputFilter.filter(ImageIO.java:567)
SEVERE: at javax.imageio.spi.FilterIterator.advance(ServiceRegistry.java:810)
SEVERE: at javax.imageio.spi.FilterIterator.<init>(ServiceRegistry.java:804)
SEVERE: at javax.imageio.spi.ServiceRegistry.getServiceProviders(ServiceRegistry.java:508)
SEVERE: at javax.imageio.ImageIO.getImageReaders(ImageIO.java:646)
SEVERE: at javax.imageio.ImageIO.read(ImageIO.java:1438)
SEVERE: at javax.imageio.ImageIO.read(ImageIO.java:1308)
SEVERE: at edu.kfshrc.dm.services.DicomViewerService.readDicomFile(DicomViewerService.java:565)
SEVERE: at edu.kfshrc.dm.services.DicomViewerService.extractImageFromDicom(DicomViewerService.java:414)
SEVERE: at edu.kfshrc.dm.servlet.DicomViewerServlet.doGet(DicomViewerServlet.java:131)
SEVERE: at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
SEVERE: at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
SEVERE: at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
SEVERE: at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
SEVERE: at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
SEVERE: at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
SEVERE: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
SEVERE: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
SEVERE: at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
SEVERE: at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
SEVERE: at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
SEVERE: at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
SEVERE: at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
SEVERE: at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
SEVERE: at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
SEVERE: at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
SEVERE: at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
SEVERE: at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
SEVERE: at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
SEVERE: at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
SEVERE: at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
SEVERE: at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
SEVERE: at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
SEVERE: at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
SEVERE: at java.lang.Thread.run(Thread.java:722)
特定のパス「c:\temp2\testing.dcm」を指すファイル オブジェクトを渡しています。Dicom ファイルを読み取ろうとする行になると、上記のエラーが発生します。
助けていただけますか?