[GeoNetwork-devel] GAST failed to start

Using the nightly build for the 2.8 branch I cannot start GAST

I get the following error

./gast.sh
INFO: Selected transformerFactory
'de.fzi.dbs.xml.transform.CachingTransformerFactory' from
'sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@anonymised.com'
INFO: GAST will use XSLT factory : net.sf.saxon.IdentityTransformer
Loading Jetty with ../web/geonetwork
Jetty on Host: null
Jetty on Port: 8080
Reading image (needs jai_imageio): images/22x22/stop.png
java.util.ServiceConfigurationError: javax.imageio.spi.ImageInputStreamSpi:
Provider com.sun.media.imageioimpl.stream.ChannelImageInputStreamSpi could
not be instantiated: java.lang.IllegalArgumentException: vendorName == null!
  at java.util.ServiceLoader.fail(ServiceLoader.java:224)
  at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
  at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:370)
  at java.util.ServiceLoader$1.next(ServiceLoader.java:438)
  at
javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:210)
  at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:138)
  at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:159)
  at javax.imageio.ImageIO.<clinit>(ImageIO.java:64)
  at org.fao.gast.gui.GuiBuilder.retrieveImage(GuiBuilder.java:305)
  at org.fao.gast.gui.GuiBuilder.addPrecon(GuiBuilder.java:195)
  at org.fao.gast.gui.GuiBuilder.build(GuiBuilder.java:93)
  at org.fao.gast.gui.MainFrame.start(MainFrame.java:87)
  at org.fao.gast.boot.Util.boot(Util.java:166)
  at org.fao.gast.Gast.main(Gast.java:56)
Caused by: java.lang.IllegalArgumentException: vendorName == null!
  at javax.imageio.spi.IIOServiceProvider.<init>(IIOServiceProvider.java:76)
  at
javax.imageio.spi.ImageInputStreamSpi.<init>(ImageInputStreamSpi.java:90)
  at
com.sun.media.imageioimpl.stream.ChannelImageInputStreamSpi.<init>(ChannelImageInputStreamSpi.java:63)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
  at java.lang.Class.newInstance0(Class.java:372)
  at java.lang.Class.newInstance(Class.java:325)
  at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:362)
  ... 11 more

Seems like a bug - Hopefully it will be fixed by the final release.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/GAST-failed-to-start-tp4978424.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

I looked like it may be easier to fix than I thought.

I found the following article related to the error.

http://thierrywasyl.wordpress.com/2009/07/24/jai-how-to-solve-vendorname-null-exception/
http://thierrywasyl.wordpress.com/2009/07/24/jai-how-to-solve-vendorname-null-exception/

I then modified the META-INF/MANIFEST.MF within the gast.jar file and added
the following to the end of the file.

Implementation-Title: GAST
Implementation-Version: 2.8
Implementation-Vendor: Geonetwork

And then all worked fine.

Of course, I'm not sure if that is the correct information to be added to
the jar or not. But it seems to have solved the problem.

I'm not sure if this information is missing in any other JAR files, but if
is is, it should probably be added. Especially if using the imageio.

Thanks.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/GAST-failed-to-start-tp4978424p4978425.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

I created Ticket #926 and uploaded a patch for this issue.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/GAST-failed-to-start-tp4978424p4978582.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.