LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 10-23-2012, 04:40 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
dcm4che: No Image Reader of class com.sun.media.imageioimpl.plugins.jpeg2000.J2KIm...


Hi!

I'm trying to get a servlet to parse a DICOM image. On the console I'm able to do it without a problem but when I try to do it on apache it's failed miserably for other things.

I'm asking ImageIO to search for plugins:

Code:
1427 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  - Supported Formats:
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       raw
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       jpeg
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       tif
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       WBMP
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       PNM
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       JPG
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       wbmp
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       DICOM
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       JPEG
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       PNG
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       dicom
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       jpeg 2000
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       tiff
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       BMP
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       JPEG2000
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       RAW
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       jpeg2000
1428 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       GIF
1429 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       TIF
1429 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       TIFF
1429 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       jpg
1429 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       bmp
1429 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       pnm
1429 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       png
1429 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       JPEG 2000
1429 [localhost-startStop-1] INFO la.cps.shl7.server.servlet.HL7StartupServlet  -       gif
Great.... now I ask for a Reader that can take care of the DicomImage, no problem, just like in the terminal but when I ask the reader to read the first (and only image):

Code:
org.dcm4che2.data.ConfigurationError: No Image Reader of class com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib available for format:jpeg2000
That class is included in a jar that is in tomcat's lib dir:

Code:
$ unzip -l /home/antoranz/Descargas/java/apache-tomcat-7.0.28/lib/jai_imageio.jar | grep J2KImageReaderCodecLib.class
     8468  2004-11-22 14:48   com/sun/media/imageioimpl/plugins/jpeg2000/J2KImageReaderCodecLib.class
Why the hell can't it decode it?
 
Old 10-23-2012, 04:43 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
Well... I think it's a tomcat problem (somewhere) because wee what happens when I ask the class to be loaded manually with Class.forName():

Code:
java.lang.ClassNotFoundException: class com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib
How about that? Let's see what's going on. I'll tell you what's going on later on.

Last edited by eantoranz; 10-23-2012 at 04:48 PM. Reason: not apache but TOMCAT problem
 
Old 10-23-2012, 04:51 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
Ok.... so instead of ln the jar I physically copied it into lib (as if that was going to change something... I knew it would make no difference but). I still can't load the class (I placed the forName() before the ImageIO stuff and it still fails to see the class).

Is there a simple explanation for this behavior? Cause I don't have one.
 
Old 10-23-2012, 05:02 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
Ok.... about the forClass(), I had misnamed the class. Now I'm able to load the class with a Class.forName() (I do it after ImageIO.getPlugin()) but then we're back into problems decoding the image because of the missing codec class:

Code:
java.io.IOException: Error processing DICOM Object
        at la.cps.shl7.entities.PACS.getImages(PACS.java:140)
        at la.cps.shl7.server.servlet.test.GetImages.doPost(GetImages.java:64)
        at la.cps.shl7.server.servlet.HL7Servlet.doPost(HL7Servlet.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: org.dcm4che2.data.ConfigurationError: No Image Reader of class com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderCodecLib available for format:jpeg2000
        at org.dcm4che2.imageio.ImageReaderFactory.getReaderForTransferSyntax(ImageReaderFactory.java:99)
        at org.dcm4che2.imageioimpl.plugins.dcm.DicomImageReader.initCompressedImageReader(DicomImageReader.java:351)
        at org.dcm4che2.imageioimpl.plugins.dcm.DicomImageReader.initImageReader(DicomImageReader.java:336)
        at org.dcm4che2.imageioimpl.plugins.dcm.DicomImageReader.read(DicomImageReader.java:576)
        at javax.imageio.ImageReader.read(ImageReader.java:940)
        at la.cps.shl7.entities.PACS.getImages(PACS.java:126)
So... what am I missing about dcm4che/jai/imageio?
 
Old 10-23-2012, 05:21 PM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
Ok.... got it. There's a shared object in jai_image (libclib_jiio.so) that has to be accessible as well. I put it in JDK's jre/lib/i386/ directory.
 
  


Reply

Tags
dcm4che, dicom, imageio, jpeg, tomcat


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using dcm4che with drbd?? pyruby Linux - Newbie 4 11-24-2009 07:56 PM
no servlet class on sun-java6 ? abd_bela Programming 1 10-19-2008 07:07 AM
vbulletin reader/plugins/hacks ror LQ Suggestions & Feedback 3 12-04-2004 08:10 AM
Media plugins Frankj51 Suse/Novell 7 11-27-2004 05:59 PM
Media plugins just not working!!!! Help please. deleshai Slackware 1 07-08-2004 03:33 AM


All times are GMT -5. The time now is 01:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration