1

I was having an issue of reading CMYK JPEG images , and have used below url as reference for solving the issue.

http://www.randelshofer.ch/blog/2011/08/reading-cmyk-jpeg-images-with-java-imageio/

I have given the configuration org.monte.media.jpeg.CMYKJPEGImageReaderSpi in the file javax.imageio.spi.ImageReaderSpi under path /META-INF/services/javax.imageio.spi.ImageReaderSpi.

This works perfectly inside eclipse and the image reader is loaded successfully.

This file is not loading when deployed , i can find the folder and the file in the generated war file in my desired jar file inside lib folder, i guess i need to add it to java classpath.

Please help me to add to classpath or if there is any other issue with it.

Sanket
  • 612
  • 5
  • 23

1 Answers1

0

You need to add this file as a static resource to your build lifecycle.

For Ant or Gradle you just need to write a simple copy task (Ant task, Gradle task), for Maven you can use Maven Resources Plugin.

After that your file should appears in your app package.

Maxim Kolesnikov
  • 5,075
  • 6
  • 38
  • 68
  • I added entry in pom.xml true src/main/resources META- INF/services/javax.imageio.spi.ImageReaderSpi Same error i got , the reader is not loading. Am i doing something wrong here ? – Sanket Jun 12 '13 at 05:14
  • First of all remove extra space from `META- INF/services...` After that check if resource appears in app package. If it's not then recheck your pom configuration for *Maven Resources plugin*. In addition to your extra resource you need to specify phase and goal when resources will be processed (see link above). – Maxim Kolesnikov Jun 12 '13 at 07:51