NoSuchElementException while Running yFiles AJAX 1.0 with Java 1.4.2

Troubleshooting

Summary

If you are running yFiles AJAX 1.0 with Java 1.4.2 you may get a NoSuchElementException at startup caused by the LoaderServlet. This article describes a solution to this problem.

Description

If you are running the server side of yFiles AJAX 1.0 in a servlet container based on Java 1.4.2 you may get an exception at startup of the yFiles AJAX server side with a root cause similar to the following.

----- Root Cause -----
java.util.NoSuchElementException
      at javax.imageio.spi.FilterIterator.next(ServiceRegistry.java:833)
      at javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:843)
      at com.yworks.yfiles.server.tiles.servlet.LoaderServlet.initialize(Unknown Source)

In this case a Java Image I/O plugin is missing. The LoaderServlet uses the plugins to enable the download of the graph in PNG and BMP format. While the plugin for the PNG format is built-in in the Java 1.4.2 JDK, the plugin for BMP is optional. It became a built-in plugin with Java 1.5. The LoaderServlet is not robust, if the BMP plugin is missing, which will be fixed in the next release.

To solve the problem you can add the missing plugin which is freely available from SUN at https://jai-imageio.dev.java.net/. At this site you can download a bundle containing the supported Image I/O plugins. There are different possibilities for adding the plugins. You can either add them to the JDK 1.4.2 used for running your servlet container. In this case the Image I/O plugins are available for every Java application running with the extended JDK. Another possibility is to use the so-called CLASSPATH installation. This installation just copies some libraries to your file system and does not change your JDK or JRE. You can then add the jai_imageio.jar to the files to deployed to the WEB-INF/lib directory of your web application. In this case the additional Image I/O plugins are only available to your web application.

Categories this article belongs to:
yFiles AJAX > Deployment
Applies to:
yFiles AJAX: 1.0
Keywords:
NoSuchElementException LoaderServlet AJAX