[Geoserver-users] Error using function Interpolate in COLOR mode from SLD

Hi there,

I’ve updated one of our GeoServes from version 2.22.2 to latest stable 2.25.1. When requesting SLD-styled maps via WMS I’m getting this OWS exception:

Error rendering layer mga.bl: Trying to evaluate the function as Object but the method parameter is set as COLOR

I guess, it’s about the Interpolate function, which we use to vary line colors depending on wms_scale_denominator:

wms_scale_denominator 2132 #202020 17471320 #404040 color

There’s no longer any error after removing that function from SLDs.

The styles have not been changed. These used to work well with the 2.22.2 version.

I haven’t found any breaking changes in the documentation for filter function Interpolate. Actually, my SLD seems quite identical to what the documentation shows:

https://docs.geoserver.org/main/en/user/styling/sld/tipstricks/transformation-func.html#id2

Any help and ideas are very appreciated.

Cheers
Carsten

H there x 2,

That is quite a puzzle.

It may be a case of:

  1. Trying to reproduce the error with the standard data directory and making a bug report
  2. Trying the different version between 2.22.2 and 2.25.1 to see when it breaks (and then we could learn more)
    If doing this approach it is best to bisect debugging approach: take a version in the middle, and then you know to test higher or lower. Take in the middle of the new range etc…
···


Jody Garnett

Hi Jody,

why a puzzle? I’ve just checked this: The error is reproducible with the latest GeoServer main branch, by simply adding an Interpolate filter function in color mode to one of the standard SLD styles (e.g. simple_roads) in standard data directory.

Making CSSParameter stroke depend on wms_scale_denominator:

#AA3333 wms_scale_denominator 2132 #AA3333 17471320 #AA9999 color 2

leads to exception:

[…]
Caused by: java.lang.IllegalArgumentException: Trying to evaluate the function as Object but the method parameter is set as COLOR
at org.geotools.filter.function.InterpolateFunction.evaluate(InterpolateFunction.java:323)
at org.geotools.filter.function.InterpolateFunction.evaluate(InterpolateFunction.java:301)
at org.geotools.filter.visitor.SimplifyingFilterVisitor.visit(SimplifyingFilterVisitor.java:484)
at org.geotools.filter.function.InterpolateFunction.accept(InterpolateFunction.java:296)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:379)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:655)
at org.geotools.styling.StrokeImpl.accept(StrokeImpl.java:420)
[…]

thrown here:

https://github.com/geotools/geotools/blob/f0c9961dc4d40c5acfce2169fab92805738de5ea/modules/library/main/src/main/java/org/geotools/filter/function/InterpolateFunction.java#L320

Seems like Class context does not implement Color It works fine if method is “numeric” (in contrast to “color”).

Carsten

···

Am 10.06.2024 um 20:55 schrieb Jody Garnett:

H there x 2,

That is quite a puzzle.

It may be a case of:

  1. Trying to reproduce the error with the standard data directory and making a bug report
  2. Trying the different version between 2.22.2 and 2.25.1 to see when it breaks (and then we could learn more)
    If doing this approach it is best to bisect debugging approach: take a version in the middle, and then you know to test higher or lower. Take in the middle of the new range etc…


Jody Garnett

On Jun 9, 2024 at 11:59:07 PM, Carsten Klein <c.klein@anonymised.com> wrote:

Hi there,

I’ve updated one of our GeoServes from version 2.22.2 to latest stable 2.25.1. When requesting SLD-styled maps via WMS I’m getting this OWS exception:

Error rendering layer mga.bl: Trying to evaluate the function as Object but the method parameter is set as COLOR

I guess, it’s about the Interpolate function, which we use to vary line colors depending on wms_scale_denominator:

wms_scale_denominator 2132 #202020 17471320 #404040 color

There’s no longer any error after removing that function from SLDs.

The styles have not been changed. These used to work well with the 2.22.2 version.

I haven’t found any breaking changes in the documentation for filter function Interpolate. Actually, my SLD seems quite identical to what the documentation shows:

https://docs.geoserver.org/main/en/user/styling/sld/tipstricks/transformation-func.html#id2

Any help and ideas are very appreciated.

Cheers
Carsten


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

It is more that I am not aware of any change that could cause this regression.

Were you able to determine when the problem was introduced and report the issue to the issue tracker?

I am curious to what you will find. Determing which release the problem started in will help a great deal.

···


Jody Garnett


Jody Garnett

There isn’t enough of the stack trace provided but this commit is a possible source of the regression (GeoServer 2.23.3+): https://github.com/geotools/geotools/commit/d7991fdcd1630ea1c18b5dfad91d4e291b8bb95b

Steve Ikeoka

···

From: Jody Garnett <jody.garnett@…84…>
Sent: Monday, June 17, 2024 10:17 AM
To: Carsten Klein <c.klein@…5805…>
Cc: GeoServer Mailing List List geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Error using function Interpolate in COLOR mode from SLD

It is more that I am not aware of any change that could cause this regression. Were you able to determine when the problem was introduced and report the issue to the issue tracker? I am curious to what you will find. Determing which release
ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

Please use caution with links, attachments, and any requests for credentials.

ZjQcmQRYFpfptBannerEnd
It is more that I am not aware of any change that could cause this regression.

Were you able to determine when the problem was introduced and report the issue to the issue tracker?

I am curious to what you will find. Determing which release the problem started in will help a great deal.


Jody Garnett

On Jun 13, 2024 at 8:07:09 AM, Carsten Klein <c.klein@…5805…> wrote:

Hi Jody,

why a puzzle? I’ve just checked this: The error is reproducible with the latest GeoServer main branch, by simply adding an Interpolate filter function in color mode to one of the standard SLD styles (e.g. simple_roads) in standard data directory.

Making CSSParameter stroke depend on wms_scale_denominator:

#AA3333 wms_scale_denominator 2132 #AA3333 17471320 #AA9999 color 2

leads to exception:

[…]
Caused by: java.lang.IllegalArgumentException: Trying to evaluate the function as Object but the method parameter is set as COLOR
at org.geotools.filter.function.InterpolateFunction.evaluate(InterpolateFunction.java:323)
at org.geotools.filter.function.InterpolateFunction.evaluate(InterpolateFunction.java:301)
at org.geotools.filter.visitor.SimplifyingFilterVisitor.visit(SimplifyingFilterVisitor.java:484)
at org.geotools.filter.function.InterpolateFunction.accept(InterpolateFunction.java:296)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:379)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:655)
at org.geotools.styling.StrokeImpl.accept(StrokeImpl.java:420)
[…]

thrown here:

https://github.com/geotools/geotools/blob/f0c9961dc4d40c5acfce2169fab92805738de5ea/modules/library/main/src/main/java/org/geotools/filter/function/InterpolateFunction.java#L320

Seems like Class context does not implement Color It works fine if method is “numeric” (in contrast to “color”).

Carsten

Am 10.06.2024 um 20:55 schrieb Jody Garnett:

H there x 2,

That is quite a puzzle.

It may be a case of:

  1. Trying to reproduce the error with the standard data directory and making a bug report
  2. Trying the different version between 2.22.2 and 2.25.1 to see when it breaks (and then we could learn more)
    If doing this approach it is best to bisect debugging approach: take a version in the middle, and then you know to test higher or lower. Take in the middle of the new range etc…


Jody Garnett

On Jun 9, 2024 at 11:59:07 PM, Carsten Klein <c.klein@…5805…> wrote:

Hi there,

I’ve updated one of our GeoServes from version 2.22.2 to latest stable 2.25.1. When requesting SLD-styled maps via WMS I’m getting this OWS exception:

Error rendering layer mga.bl: Trying to evaluate the function as Object but the method parameter is set as COLOR

I guess, it’s about the Interpolate function, which we use to vary line colors depending on wms_scale_denominator:

wms_scale_denominator 2132 #202020 17471320 #404040 color

There’s no longer any error after removing that function from SLDs.

The styles have not been changed. These used to work well with the 2.22.2 version.

I haven’t found any breaking changes in the documentation for filter function Interpolate. Actually, my SLD seems quite identical to what the documentation shows:

https://docs.geoserver.org/main/en/user/styling/sld/tipstricks/transformation-func.html#id2

Any help and ideas are very appreciated.

Cheers
Carsten


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

I had a look at this error and can confirm that it’s a legit error with the main branch. So an Issue in Jira would be welcomed.

Carsten provided two different sld. Here is the one I’ve been using:

wms_scale_denominator 2132 #AA3333 17471320 #AA9999 color 2

And here is a full stack trace:

18 007 08:07:53 ERROR [geoserver.ows] -
org.geoserver.platform.ServiceException: Rendering process failed. Layers: tasmania_roads
at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:593)
at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:205)
at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:1)
at org.geoserver.wms.GetMap.executeInternal(GetMap.java:347)
at org.geoserver.wms.GetMap.run(GetMap.java:204)
at org.geoserver.wms.GetMap.run(GetMap.java:114)
at org.geoserver.wms.DefaultWebMapService.getMap(DefaultWebMapService.java:250)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.geoserver.kml.WebMapServiceKmlInterceptor.invoke(WebMapServiceKmlInterceptor.java:38)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:57)
at org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:1)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:74)
at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:1)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:29)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
at com.sun.proxy.$Proxy88.getMap(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:905)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:269)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656)
at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:73)
at org.geoserver.ows.HTTPHeadersCollector.doFilter(HTTPHeadersCollector.java:48)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
at org.geoserver.filters.HTTPMethodFilter.doFilter(HTTPMethodFilter.java:36)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:194)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:43)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:39)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:164)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilterInternal(GeoServerSecurityContextPersistenceFilter.java:72)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186)
at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:141)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:116)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:49)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:42)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalArgumentException: Trying to evaluate the function as Object but the method parameter is set as COLOR
at org.geotools.filter.function.InterpolateFunction.evaluate(InterpolateFunction.java:321)
at org.geotools.filter.function.InterpolateFunction.evaluate(InterpolateFunction.java:301)
at org.geotools.filter.visitor.SimplifyingFilterVisitor.visit(SimplifyingFilterVisitor.java:484)
at org.geotools.filter.function.InterpolateFunction.accept(InterpolateFunction.java:296)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:379)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:655)
at org.geotools.styling.StrokeImpl.accept(StrokeImpl.java:420)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:442)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:713)
at org.geotools.styling.LineSymbolizerImpl.accept(LineSymbolizerImpl.java:103)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:504)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.lambda$0(DuplicatingStyleVisitor.java:283)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:285)
at org.geotools.styling.RuleImpl.accept(RuleImpl.java:223)
at org.geotools.renderer.lite.SimplifyingStyleVisitor.lambda$1(SimplifyingStyleVisitor.java:72)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at org.geotools.renderer.lite.SimplifyingStyleVisitor.visit(SimplifyingStyleVisitor.java:76)
at org.geotools.styling.FeatureTypeStyleImpl.accept(FeatureTypeStyleImpl.java:142)
at org.geotools.renderer.lite.StreamingRenderer.createLiteFeatureTypeStyles(StreamingRenderer.java:2015)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:2251)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:918)
at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:546)
… 141 more

···

From: Jody Garnett <jody.garnett@anonymised.com>
Sent: Monday, June 17, 2024 10:17 AM
To: Carsten Klein <c.klein@anonymised.com>
Cc: GeoServer Mailing List List <geoserver-users@anonymised.comists.sourceforge.net>
Subject: Re: [Geoserver-users] Error using function Interpolate in COLOR mode from SLD

This Message Is From an External Sender

Please use caution with links, attachments, and any requests for credentials.

It is more that I am not aware of any change that could cause this regression.

Were you able to determine when the problem was introduced and report the issue to the issue tracker?

I am curious to what you will find. Determing which release the problem started in will help a great deal.


Jody Garnett

On Jun 13, 2024 at 8:07:09 AM, Carsten Klein <c.klein@anonymised.com> wrote:

Hi Jody,
why a puzzle? I’ve just checked this: The error is reproducible with the latest GeoServer main branch, by simply adding an Interpolate filter function in color mode to one of the standard SLD styles (e.g. simple_roads) in standard data directory.
Making CSSParameter stroke depend on wms_scale_denominator:

#AA3333 wms_scale_denominator 2132 #AA3333 17471320 #AA9999 color 2 leads to exception: [...] Caused by: java.lang.IllegalArgumentException: Trying to evaluate the function as Object but the method parameter is set as COLOR at org.geotools.filter.function.InterpolateFunction.evaluate(InterpolateFunction.java:323) at org.geotools.filter.function.InterpolateFunction.evaluate(InterpolateFunction.java:301) at org.geotools.filter.visitor.SimplifyingFilterVisitor.visit(SimplifyingFilterVisitor.java:484) at org.geotools.filter.function.InterpolateFunction.accept(InterpolateFunction.java:296) at org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:379) at org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:655) at org.geotools.styling.StrokeImpl.accept(StrokeImpl.java:420) [....] thrown here: [https://github.com/geotools/geotools/blob/f0c9961dc4d40c5acfce2169fab92805738de5ea/modules/library/main/src/main/java/org/geotools/filter/function/InterpolateFunction.java#L320](https://urldefense.us/v3/__https://github.com/geotools/geotools/blob/f0c9961dc4d40c5acfce2169fab92805738de5ea/modules/library/main/src/main/java/org/geotools/filter/function/InterpolateFunction.java*L320__;Iw!!JRQnnSFuzw7wjAKq6ti6!xut7MRht1ecLGteZ1aKGg5roShoUSjG5tqvW0u3NMBIcQXEZEhSwHmbskJ-MFnqjKx-G314NqB5naHhV1L1EZOg$) Seems like *Class context* does not implement *Color* It works fine if method is "numeric" (in contrast to "color"). Carsten

Am 10.06.2024 um 20:55 schrieb Jody Garnett:

H there x 2,

That is quite a puzzle.

It may be a case of:

  1. Trying to reproduce the error with the standard data directory and making a bug report
  2. Trying the different version between 2.22.2 and 2.25.1 to see when it breaks (and then we could learn more)
    If doing this approach it is best to bisect debugging approach: take a version in the middle, and then you know to test higher or lower. Take in the middle of the new range etc…


Jody Garnett

On Jun 9, 2024 at 11:59:07 PM, Carsten Klein <c.klein@anonymised.com> wrote:

Hi there,
I’ve updated one of our GeoServes from version 2.22.2 to latest stable 2.25.1. When requesting SLD-styled maps via WMS I’m getting this OWS exception:
Error rendering layer mga.bl: Trying to evaluate the function as Object but the method parameter is set as COLOR
I guess, it’s about the Interpolate function, which we use to vary line colors depending on wms_scale_denominator:

wms_scale_denominator 2132 #202020 17471320 #404040 color

There’s no longer any error after removing that function from SLDs.
The styles have not been changed. These used to work well with the 2.22.2 version.
I haven’t found any breaking changes in the documentation for filter function Interpolate. Actually, my SLD seems quite identical to what the documentation shows:
https://docs.geoserver.org/main/en/user/styling/sld/tipstricks/transformation-func.html#id2
Any help and ideas are very appreciated.

Cheers
Carsten


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer

Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hello there,

I exactly have the same issue: has someone already created a JIRA ticket? I haven’t found one so I would like to confirm the fact before creating one.

Regards
Alexandre

Hello Alexandre,

I haven’t yet created a JIRA ticket as I’m quite busy at the moment. Also, due to lack of time, I wasn’t able to track down the exact version which first introduced this issue.

Regards
Carsten

···

Am 21.06.2024 um 14:40 schrieb Alexandre Gacon:

Hello there,

I exactly have the same issue: has someone already created a JIRA ticket? I haven’t found one so I would like to confirm the fact before creating one.

Regards
Alexandre

Hi Steve,
yes, that commit is involved, as it triggers a bug in the function implementation.
A function must not rely on the context object being set, the context is provided only so that the function can try to covert

its result towards it. Passing in “null” or “object” means “do what you want, we’re not asking for a particular type of output”,
but the current implementation throws an exception instead. Looks like the error predates the git history (14+ years)
In any case, that needs to be fixed.

···

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail

I initiated the ticket https://osgeo-org.atlassian.net/browse/GEOT-7607.

Regards
Alexandre

···

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail

Alexandre Gacon

Gabriel Roldan is taking care of it.

Alexandre

···

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail

Alexandre Gacon
Alexandre Gacon

Hi, I’ll give it a shot.

···

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Gabriel Roldán
Geospatial Developer

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail

Alexandre Gacon

Moving the discussion to the devel list.

Please check the following pull request: https://github.com/geotools/geotools/pull/4819

···

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Gabriel Roldán
Geospatial Developer

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

https://www.geosolutionsgroup.com/

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail

Alexandre Gacon
Alexandre Gacon