javax.imageio.spi.ImageWriterSpi: Illegal configuration-file syntax

November 4, 2004

Recently a client who ordered a customized version of Rad Upload
had a problem with the applet when it was deployed on his server. It worked fine when it was run off our own servers. The error was something like this:

http://sitenamedeleted.com/META-INF/services/javax.imageio.spi.ImageWriterSpi:1: Illegal configuration-file syntax at sun.misc.Service.fail(Unknown Source)

at sun.misc.Service.fail(Unknown Source)
at sun.misc.Service.parseLine(Unknown Source)
at sun.misc.Service.parse(Unknown Source)
at sun.misc.Service.access$100(Unknown Source)
at sun.misc.Service$LazyIterator.hasNext(Unknown Source)
at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown Source)

at javax.imageio.spi.IIORegistry.(Unknown Source)
at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)

The stacktrace is longer than that but the rest of it is not relevent. Suprisingly there was nothing on this error in google. The closest match was this link http://forum.java.sun.com/thread.jsp?thread=448584&forum=31&message=2149852 which discussed a similar problem with javax.print.PrintServiceLookup. This link did point me in the right direction, the issue here is that the server is not returining 404 http status code (as it should) for a file that is missing.

Interestingly the ImageIO developer guide says that the plugin will look for a META-INF/services/javax.imageio.spi.ImageWriterSpi file in the applet jar file but does not mention what it does when the file is missing, which apparently is to look for that file on the webserver. Obviously when the server does not return a 404 error, the plugin thinks it should attempt provider classes and ties itselfs up in
knots.

So what's the solution?
create an empty file named META-INF/services/javax.imageio.spi.ImageWriterSpi in your jar file. Similiary if your problem wes with PrintServiceLookup you would have to add the file META-INF/services/java.print.PrintServiceLookup

Posted by raditha at November 4, 2004 11:03 AM
Your Ad Here

 

Jabber  |  Linux  |  mySQL  |  PHP  |  Java  |  Site Map  |  Wiki

Downloads  |  About  |  Links  |  Contact  |  Home

 

Copyright © Raditha Dissanayake 2003 - 2007

Terms of Use  |  Privacy

 

 

November 2004
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30