I got ArrayIndexOutOfBoundsException when I tried to generate the gif image

I just upgrade JDK from 1.5 to 1.6. Then I want to save my image as a gif file. ( I used to save it as png file which was working perfect. ). I got ArrayIndexOutOfBoundsException at the time I am trying to save the image file:
java.lang.ArrayIndexOutOfBoundsException: 0
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:267)
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:274)
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:274)
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:274)
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:274)
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:274)
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:274)
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:274)
at com.sun.imageio.plugins.common.PaletteBuilder.insertNode(PaletteBuilder.java:274)
at com.sun.imageio.plugins.common.PaletteBuilder.buildPalette(PaletteBuilder.java:237)
at com.sun.imageio.plugins.common.PaletteBuilder.createIndexedImage(PaletteBuilder.java:76)
at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:564)
at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:492)
at javax.imageio.ImageWriter.write(ImageWriter.java:598)
at javax.imageio.ImageIO.write(ImageIO.java:1479)
at javax.imageio.ImageIO.write(ImageIO.java:1521)
at xxx.xxx.xxx.clusterImage.ClusterImageMaker.saveImage(ClusterImageMaker.java:863)
The code that caused exception in ClusterImageMaker.java is as following:
try {
857 //if (!imageExist(atrgtr, list)) {
858 //return;
859 //}
860 String gifname = findImageFileName( atrgtr, somNum,list);
861 String fullname = gifpath + gifname;
862 log.info("file name = " + fullname);
863 ImageIO.write(im_out, "GIF", new File( fullname ));
864 } catch (Exception ex) {
865 log.error("error" + ex.getMessage());
866 ex.printStackTrace();
867 throw new SMDException( "fail to save image file ", ex );
868 }
It took me quite a time trying to figure it out. Now I am desperate. Please help.

Post a SSCCE .

Similar Messages

Maybe you are looking for

  • How to Use a report as a filter in another report

    Hi We are presently migrating from microstategy to OBIEE. There is a report with 3 attributes and a single metric(the metric is the count of remedy ticket). The 2nd report has just the 3 attributes(the person who doesn't have a ticket for the given t

  • Create a new page that will open in a separate window

    Hi, I would like to add a new page to my website but have it open into a new window when linked to instead of replacing the page that was open thereby having both pages open side by side. The example would be having my bio open up along side my about

  • Errors when importing a project in NWDS

    Hi All, I imported the SAP delivered project Webdynpro_OVS_Valuehelp into NWDS. I get the following errors: Missing required library: 'C:Program Files/NWDS716/IDE70/eclipse/plugins/com.sap.tc.ap_2.0.0/comp/SAP_JTECHS/DCs/sap.com/webservices/_comp/gen

  • Spry Master Data Region - Horizontal

    I'm using the following tutorial to create navigation for my site: Spry framework for Ajax http://www.adobe.com/designcenter/video_workshop/index.html?id=vid0166 In this example the XML data is listed vertically. Is there a way for the data to be dis

  • Photo stream gone

    WWhere has photo stream gone, done iOS 8 update and it's screwed everything up