[Geoserver-devel] [jira] (GEOS-5186) GeoTIFF WMS layer failed when SLD <ContrastEnhancement> used

Matt Shaw created BugGEOS-5186
GeoTIFF WMS layer failed when SLD <ContrastEnhancement> used

Issue Type:

BugBug

Affects Versions:

2.1.4

Assignee:

Andrea Aime

Components:

Chart symbolizer

Created:

21/Jun/12 4:28 AM

Description:

When creating a new layer based on a GeoTIFF and serving it as WMS with the following SLD.

<?xml version=“1.0” encoding=“ISO-8859-1”?>
<StyledLayerDescriptor version=“1.0.0”
xsi:schemaLocation=“http://www.opengis.net/sld StyledLayerDescriptor.xsd”
xmlns=“http://www.opengis.net/sld
xmlns:ogc=“http://www.opengis.net/ogc
xmlns:xlink=“http://www.w3.org/1999/xlink
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
<NamedLayer>
<Name>marble_sld</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<MinScaleDenominator>5000001</MinScaleDenominator>
<MaxScaleDenominator>2500000000</MaxScaleDenominator>
<RasterSymbolizer>
<ContrastEnhancement>
<GammaValue>0.6</GammaValue>
</ContrastEnhancement>
<Opacity>1.0</Opacity>
</RasterSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

I get the following exception in the server log:

2012-06-20 17:05:55,734 ERROR [geoserver.ows] -
java.lang.ArrayIndexOutOfBoundsException: 509952
at javax.media.jai.IHSColorSpace.toRGBByte(IHSColorSpace.java:1169)
at javax.media.jai.IHSColorSpace.toRGB(IHSColorSpace.java:1102)
at com.sun.media.jai.opimage.ColorConvertOpImage.computeRectColorSpaceJAIToRGB(ColorConvertOpImage.java:310)
at com.sun.media.jai.opimage.ColorConvertOpImage.computeRect(ColorConvertOpImage.java:272)
at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:857)
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 javax.media.jai.ScaleOpImage.computeTile(ScaleOpImage.java:1255)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at javax.media.jai.RenderedOp.getTile(RenderedOp.java:2257)
at com.sun.media.imageioimpl.plugins.clib.CLibImageWriter.getContiguousData(CLibImageWriter.java:272)
at com.sun.media.imageioimpl.plugins.clib.CLibImageWriter.getMediaLibImage(CLibImageWriter.java:712)
at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageWriter.write(CLibJPEGImageWriter.java:240)
at org.geotools.image.ImageWorker.writeJPEG(ImageWorker.java:2685)
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:751)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:238)
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:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
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.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:394)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:406)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:185)
at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
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)

If I remove the <ContrastEnhancement> section of the SLD it seems to work ok. It doesn’t always fail but fails more often than not.

Environment:

Windows Server 2008 Standard R2 64-bit, Java 1.6 with JAI installed.

Project:

GeoServer

Priority:

CriticalCritical

Reporter:

Matt Shaw

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your [JIRA administrators](https://jira.codehaus.org/secure/ContactAdministrators!default.jspa). For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)