[Geoserver-devel] [jira] (GEOS-5234) Method "GridCoverage2D read(GeneralParameterValue[] params)" is called with incorrect parameters.

Brittany Allesandro created BugGEOS-5234
Method “GridCoverage2D read(GeneralParameterValue[] params)” is called with incorrect parameters.

Issue Type:

BugBug

Affects Versions:

2.2-RC1, 2.2-beta2

Assignee:

Andrea Aime

Attachments:

geonetcdf-1.0-zip-with-dependencies.zip

Created:

24/Jul/12 2:51 PM

Description:

When previewing a layer published with NetCDF reader as raster data source, the user-selected parameter is not being passed to the the overridden AbstractGridCoverage2DReader method “GridCoverage2D read(GeneralParameterValue params)” in newer GeoServer releases.

When editting the layer, the user is able to give a value for the variable NETCDFPARAMETER. The default value, defined in the NetCDFFormat class, should display (currently, “water_temp”) initially. In all GeoServer releases, the user-supplied value is saved correctly to the layer’s coverage.xml file. However, when the read() method is called with GeoServer versions 2.2-beta2 and 2.2-RC1, the default value is passed as a parameter regardless of what value the user has actually given.

For example, if the user supplies the value “salinity” for NETCDFPARAMETER, and the user is running GeoServer version 2.1.4, then the read() method’s parameter will contain the value “salinity.” However, if the user is running either 2.2-beta2 or 2.2-RC1, then the parameter will contain the default value “water_temp.”

Steps to reproduce:

  1. Go to http://edac-dap3.northerngulfinstitute.org/thredds/ncss/grid/ncom_fukushima_agg/Fukushima_best.ncd/dataset.html to create a NetCDF file with at least variables “salinity” and “water_temp.” I would strongly recommend defining a minimal bounding box and time range to reduce the size of this test file.
  2. Add geonetcdf-1.0.jar, joda-time-1.5.2.jar, and netcdf-4.2-min.jar to your web container
  3. Add new store to GeoServer, with NetCDF Reader as a raster data source
  • Use the file that you created in Step 1 as URL connection parameter, including path to file
    3. Publish layer and set NETCDFPARAMETER to the value “salinity”
    4. With debugger active, preview this new layer with OpenLayers
  • If using GeoServer version 2.1.4, then the read() method parameter “params” will contain “salinity” at the first index
  • If using GeoServer version 2.2-beta2 or 2.2-RC1, then the read() method parameter “params” will contain “water_temp” at the first index, when it should contain “salinity”

Note
With version 2.2-beta2 and 2.2-RC1, the only exception I have found is when the NETCDFPARAMETER field is left completely blank; in this case, the NETCDFPARAMETER index of “params” will contain a NULL value rather than the default value.

Stacktraces:
Using the eclipse debugger and setting a breakpoint at the read() method results in the following stacktrace for GeoServer version 2.1.4 when previewing the layer:

Daemon Thread [http-8080-3] (Suspended (entry into method read in NetCDFReader))
NetCDFReader.read(GeneralParameterValue) line: 104
RenderedImageMapOutputFormat.readBestCoverage(AbstractGridCoverage2DReader, Object, ReferencedEnvelope, Rectangle, Interpolation, Color) line: 1307
RenderedImageMapOutputFormat.directRasterRender(WMSMapContext, int, List<GridCoverage2D>) line: 849
RenderedImageMapOutputFormat.produceMap(WMSMapContext, boolean) line: 329
RenderedImageMapOutputFormat.produceMap(WMSMapContext) line: 250
RenderedImageMapOutputFormat.produceMap(WMSMapContext) line: 125
GetMap.run(GetMapRequest, WMSMapContext) line: 374
GetMap.run(GetMapRequest) line: 107
DefaultWebMapService.getMap(GetMapRequest) line: 353
NativeMethodAccessorImpl.invoke0(Method, Object, Object) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object) line: 25
Method.invoke(Object, Object…) line: 597
AopUtils.invokeJoinpointUsingReflection(Object, Method, Object) line: 310
ReflectiveMethodInvocation.invokeJoinpoint() line: 182
ReflectiveMethodInvocation.proceed() line: 149
CacheSeedingWebMapService.invoke(MethodInvocation) line: 60
CacheSeedingWebMapService.invoke(MethodInvocation) line: 34
ReflectiveMethodInvocation.proceed() line: 171
CachingWebMapService.invoke(MethodInvocation) line: 58
CachingWebMapService.invoke(MethodInvocation) line: 40
ReflectiveMethodInvocation.proceed() line: 171
RequestObjectLogger.invoke(MethodInvocation) line: 51
ReflectiveMethodInvocation.proceed() line: 171
JdkDynamicAopProxy.invoke(Object, Method, Object) line: 204
$Proxy35.getMap(GetMapRequest) line: not available
NativeMethodAccessorImpl.invoke0(Method, Object, Object) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object) line: 25
Method.invoke(Object, Object…) line: 597
Dispatcher.execute(Request, Operation) line: 630
Dispatcher.handleRequestInternal(HttpServletRequest, HttpServletResponse) line: 234
Dispatcher(AbstractController).handleRequest(HttpServletRequest, HttpServletResponse) line: 153
SimpleControllerHandlerAdapter.handle(HttpServletRequest, HttpServletResponse, Object) line: 48
DispatcherServlet.doDispatch(HttpServletRequest, HttpServletResponse) line: 875
DispatcherServlet.doService(HttpServletRequest, HttpServletResponse) line: 809
DispatcherServlet(FrameworkServlet).processRequest(HttpServletRequest, HttpServletResponse) line: 571
DispatcherServlet(FrameworkServlet).doGet(HttpServletRequest, HttpServletResponse) line: 501
DispatcherServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 617
DispatcherServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 717
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 290
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
ThreadLocalsCleanupFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 23
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
SpringDelegatingFilter$Chain.doFilter(ServletRequest, ServletResponse) line: 74
SpringDelegatingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 45
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
AdvancedDispatchFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 49
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
SetCharacterEncodingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 109
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 394
FilterSecurityInterceptor.invoke(FilterInvocation) line: 109
FilterSecurityInterceptor.doFilter(ServletRequest, ServletResponse, FilterChain) line: 83
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 406
ExceptionTranslationFilter.doFilterHttp(HttpServletRequest, HttpServletResponse, FilterChain) line: 101
ExceptionTranslationFilter(SpringSecurityFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 53
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 406
AnonymousProcessingFilter.doFilterHttp(HttpServletRequest, HttpServletResponse, FilterChain) line: 105
AnonymousProcessingFilter(SpringSecurityFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 53
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 406
BasicProcessingFilter.doFilterHttp(HttpServletRequest, HttpServletResponse, FilterChain) line: 174
BasicProcessingFilter(SpringSecurityFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 53
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 406
HttpSessionContextIntegrationFilter.doFilterHttp(HttpServletRequest, HttpServletResponse, FilterChain) line: 235
HttpSessionContextIntegrationFilter(SpringSecurityFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 53
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 406
FilterChainProxy.doFilter(ServletRequest, ServletResponse, FilterChain) line: 185
FilterToBeanProxy.doFilter(ServletRequest, ServletResponse, FilterChain) line: 99
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
LoggingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 71
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
ReverseProxyFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 183
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
GZIPFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 41
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
SessionDebugFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 46
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
StandardWrapperValve.invoke(Request, Response) line: 233
StandardContextValve.invoke(Request, Response) line: 191
StandardHostValve.invoke(Request, Response) line: 127
ErrorReportValve.invoke(Request, Response) line: 102
StandardEngineValve.invoke(Request, Response) line: 109
CoyoteAdapter.service(Request, Response) line: 298
Http11Processor.process(Socket) line: 859
Http11Protocol$Http11ConnectionHandler.process(Socket) line: 588
JIoEndpoint$Worker.run() line: 489
Thread.run() line: 662

Using the eclipse debugger and setting a breakpoint at the read() method results in the following stacktrace for GeoServer version 2.2-RC1 when previewing the layer:

Daemon Thread [http-8080-4] (Suspended (entry into method read in NetCDFReader))
NetCDFReader.read(GeneralParameterValue) line: 104
RenderedImageMapOutputFormat.readBestCoverage(AbstractGridCoverage2DReader, Object, ReferencedEnvelope, Rectangle, Interpolation, Color) line: 1314
RenderedImageMapOutputFormat.directRasterRender(WMSMapContent, int, List<GridCoverage2D>) line: 855
RenderedImageMapOutputFormat.produceMap(WMSMapContent, boolean) line: 332
RenderedImageMapOutputFormat.produceMap(WMSMapContent) line: 254
RenderedImageMapOutputFormat.produceMap(WMSMapContent) line: 126
GetMap.executeInternal(WMSMapContent, GetMapRequest, GetMapOutputFormat, List<Object>, List<Object>) line: 471
GetMap.run(GetMapRequest, WMSMapContent) line: 208
GetMap.run(GetMapRequest) line: 112
DefaultWebMapService.getMap(GetMapRequest) line: 353
NativeMethodAccessorImpl.invoke0(Method, Object, Object) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object) line: 25
Method.invoke(Object, Object…) line: 597
AopUtils.invokeJoinpointUsingReflection(Object, Method, Object) line: 318
ReflectiveMethodInvocation.invokeJoinpoint() line: 183
ReflectiveMethodInvocation.proceed() line: 150
CacheSeedingWebMapService.invoke(MethodInvocation) line: 61
CacheSeedingWebMapService.invoke(MethodInvocation) line: 35
ReflectiveMethodInvocation.proceed() line: 172
CachingWebMapService.invoke(MethodInvocation) line: 60
CachingWebMapService.invoke(MethodInvocation) line: 42
ReflectiveMethodInvocation.proceed() line: 172
RequestObjectLogger.invoke(MethodInvocation) line: 54
ReflectiveMethodInvocation.proceed() line: 172
JdkDynamicAopProxy.invoke(Object, Method, Object) line: 202
$Proxy36.getMap(GetMapRequest) line: not available
NativeMethodAccessorImpl.invoke0(Method, Object, Object) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object) line: 25
Method.invoke(Object, Object…) line: 597
Dispatcher.execute(Request, Operation) line: 772
Dispatcher.handleRequestInternal(HttpServletRequest, HttpServletResponse) line: 272
Dispatcher(AbstractController).handleRequest(HttpServletRequest, HttpServletResponse) line: 153
SimpleControllerHandlerAdapter.handle(HttpServletRequest, HttpServletResponse, Object) line: 48
DispatcherServlet.doDispatch(HttpServletRequest, HttpServletResponse) line: 923
DispatcherServlet.doService(HttpServletRequest, HttpServletResponse) line: 852
DispatcherServlet(FrameworkServlet).processRequest(HttpServletRequest, HttpServletResponse) line: 882
DispatcherServlet(FrameworkServlet).doGet(HttpServletRequest, HttpServletResponse) line: 778
DispatcherServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 617
DispatcherServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 717
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 290
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
ThreadLocalsCleanupFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 23
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
SpringDelegatingFilter$Chain.doFilter(ServletRequest, ServletResponse) line: 74
SpringDelegatingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 45
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
AdvancedDispatchFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 49
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
SetCharacterEncodingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 109
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 311
GeoServerCompositeFilter$NestedFilterChain.doFilter(ServletRequest, ServletResponse) line: 68
FilterSecurityInterceptor.invoke(FilterInvocation) line: 116
FilterSecurityInterceptor.doFilter(ServletRequest, ServletResponse, FilterChain) line: 83
GeoServerCompositeFilter$NestedFilterChain.doFilter(ServletRequest, ServletResponse) line: 72
GeoServerSecurityInterceptorFilter(GeoServerCompositeFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 91
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 323
GeoServerCompositeFilter$NestedFilterChain.doFilter(ServletRequest, ServletResponse) line: 68
ExceptionTranslationFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 113
GeoServerCompositeFilter$NestedFilterChain.doFilter(ServletRequest, ServletResponse) line: 72
GeoServerExceptionTranslationFilter(GeoServerCompositeFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 91
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 323
GeoServerAnonymousAuthenticationFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 53
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 323
GeoServerCompositeFilter$NestedFilterChain.doFilter(ServletRequest, ServletResponse) line: 68
BasicAuthenticationFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 150
GeoServerCompositeFilter$NestedFilterChain.doFilter(ServletRequest, ServletResponse) line: 72
GeoServerBasicAuthenticationFilter(GeoServerCompositeFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 91
GeoServerBasicAuthenticationFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 82
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 323
GeoServerCompositeFilter$NestedFilterChain.doFilter(ServletRequest, ServletResponse) line: 68
SecurityContextPersistenceFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 87
GeoServerCompositeFilter$NestedFilterChain.doFilter(ServletRequest, ServletResponse) line: 72
GeoServerSecurityContextPersistenceFilter(GeoServerCompositeFilter).doFilter(ServletRequest, ServletResponse, FilterChain) line: 91
FilterChainProxy$VirtualFilterChain.doFilter(ServletRequest, ServletResponse) line: 323
GeoServerSecurityFilterChainProxy(FilterChainProxy).doFilter(ServletRequest, ServletResponse, FilterChain) line: 173
GeoServerSecurityFilterChainProxy.doFilter(ServletRequest, ServletResponse, FilterChain) line: 97
DelegatingFilterProxy.invokeDelegate(Filter, ServletRequest, ServletResponse, FilterChain) line: 346
DelegatingFilterProxy.doFilter(ServletRequest, ServletResponse, FilterChain) line: 259
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
LoggingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 71
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
GZIPFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 41
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
SessionDebugFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 46
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206
StandardWrapperValve.invoke(Request, Response) line: 233
StandardContextValve.invoke(Request, Response) line: 191
StandardHostValve.invoke(Request, Response) line: 127
ErrorReportValve.invoke(Request, Response) line: 102
StandardEngineValve.invoke(Request, Response) line: 109
CoyoteAdapter.service(Request, Response) line: 298
Http11Processor.process(Socket) line: 859
Http11Protocol$Http11ConnectionHandler.process(Socket) line: 588
JIoEndpoint$Worker.run() line: 489
Thread.run() line: 662

Environment:

Operating system: Windows 7 (64 bit) host, running Ubuntu 10.04.3 VirtualBox guest
Java version: 1.6.0_26-b03, Sun Microsystems Inc.
Eclipse version: Helios Release 2
Dependencies: joda-time 1.5.2, netCDF-Java 4.2-min
Web container: Apache Tomcat 6.0.24
GeoServer versions: 2.1.4 (works as expected), 2.2-beta2 (issue present), 2.2-RC1(issue present)

Project:

GeoServer

Priority:

MinorMinor

Reporter:

Brittany Allesandro

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)