[Geoserver-devel] [jira] Created: (GEOS-4844) JAI causes ArrayIndexOutOfBoundsException

JAI causes ArrayIndexOutOfBoundsException
-----------------------------------------

                 Key: GEOS-4844
                 URL: https://jira.codehaus.org/browse/GEOS-4844
             Project: GeoServer
          Issue Type: Bug
          Components: WMS
    Affects Versions: 2.2.x
         Environment: Ubuntu 11.04
Sun Java SDK 1.6.0_26
64-bit
            Reporter: Michael Romero
            Assignee: Andrea Aime
             Fix For: 2.2.x
         Attachments: WW3_SOUTHWEST_ASIA.sig_wav_ht.tif

I receive an ArrayIndexOutOfBoundsException when I make a WMS request for some GeoTiff layers that I created. I did not install the native Sun JAI libraries. I have many images and some work and some don't. Attached is an image that is not working. OpenEV and GDAL have to problem reading the image file. I tried the same GeoTiff in the 2.2-SNAPSHOT from 29-AUG-2011 and it worked fine.

Sometimes I get a stack trace in the GeoServer logs but other times only the ArrayIndexOutOfBoundsException. When I do get a stack trace it looks something like this:

java.lang.ArrayIndexOutOfBoundsException: 20
  at javax.media.jai.LookupTableJAI.lookup(LookupTableJAI.java:1244)
  at javax.media.jai.LookupTableJAI.lookup(LookupTableJAI.java:1016)
  at com.sun.media.jai.opimage.LookupOpImage.computeRect(LookupOpImage.java:173)
  at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:969)
  at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
  at javax.media.jai.OpImage.getTile(OpImage.java:1129)
  at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2343)
  at javax.media.jai.PlanarImage.copyExtendedData(PlanarImage.java:2398)
  at javax.media.jai.PlanarImage.getExtendedData(PlanarImage.java:2459)
  at com.sun.media.jai.opimage.MosaicOpImage.computeTile(MosaicOpImage.java:432)
  at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
  at javax.media.jai.OpImage.getTile(OpImage.java:1129)
  at com.sun.media.jai.opimage.BandSelectOpImage.computeTile(BandSelectOpImage.java:120)
  at com.sun.media.jai.opimage.BandSelectOpImage.getTile(BandSelectOpImage.java:144)
  at javax.media.jai.RenderedOp.getTile(RenderedOp.java:2257)
  at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:377)
  at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:339)
  at org.geotools.image.ImageWorker.writeJPEG(ImageWorker.java:2673)
  at org.geoserver.wms.map.JPEGMapResponse.formatImageOutputStream(JPEGMapResponse.java:69)
  at org.geoserver.wms.map.RenderedImageMapResponse.write(RenderedImageMapResponse.java:115)
  at org.geoserver.ows.Dispatcher.response(Dispatcher.java:901)
  at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:277)
  at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
  at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
  at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:23)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74)
  at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:71)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:46)
  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
  at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
  at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
  at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
  at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  at org.mortbay.jetty.Server.handle(Server.java:324)
  at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
  at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
  at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
  at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira