2

I'm converting a WFS app from MapServer to GeoServer (2.1.4) and have hit a snag around PropertyIsLike. Whenever I include it in a getFeature's filter I get back a ServiceException as seen below.

This is the filter sent to getFeature:

<Filter xmlns='http://www.opengis.net/ogc' >
    <ogc:And>           
      <BBOX>
        <PropertyName>geom</PropertyName>
        <Box srsName="EPSG:4326">
          <coordinates>174.74029566015622,-37.005568168501505 175.0849917050781,-36.89582122701751</coordinates>
        </Box>
      </BBOX>
      <ogc:PropertyIsLike  wildcard="*" matchCase="false" singleChar="." escape="!">
        <ogc:PropertyName>locality</ogc:PropertyName>
        <ogc:Literal>*reek*</ogc:Literal>
      </ogc:PropertyIsLike>
  </ogc:And>
</Filter>

And this is the error

<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
  <ServiceException>
    error:Translator error
    Translator error
    java.io.IOException
    null
    null
  </ServiceException>
</ServiceExceptionReport>

It works fine if I remove the PropertyIsLike, and it works if I change it to PropertyIsEqual, but I need a wild-card search. I've looked over and over the filter and I can't see a problem with it. Can someone see an error, or suggest another way to achieve a wild-card search on GeoServer?

Update Here is the requested full stack trace.

2012-07-16 15:55:41,953 ERROR [geoserver.ows] - org.geoserver.platform.ServiceException: error:Translator error at org.geoserver.wfs.xml.GML2OutputFormat.encode(GML2OutputFormat.java:286) at org.geoserver.wfs.xml.GML2OutputFormat.write(GML2OutputFormat.java:295) at org.geoserver.wfs.WFSGetFeatureOutputFormat.write(WFSGetFeatureOutputFormat.java:141) 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.doPost(FrameworkServlet.java:511) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:23) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74) at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:71) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: javax.xml.transform.TransformerException: Translator error at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:136) at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:111) at org.geoserver.wfs.xml.GML2OutputFormat.encode(GML2OutputFormat.java:276) ... 73 more Caused by: java.lang.RuntimeException: java.io.IOException at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:258) at org.geoserver.feature.RetypingFeatureCollection.iterator(RetypingFeatureCollection.java:44) at org.geoserver.feature.RetypingFeatureCollection.features(RetypingFeatureCollection.java:53) at org.geotools.gml.producer.FeatureTransformer$FeatureTranslator.encode(FeatureTransformer.java:513) at org.geotools.xml.transform.TransformerBase$XMLReaderSupport.parse(TransformerBase.java:939) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484) at org.geotools.xml.transform.TransformerBase$Task.run(TransformerBase.java:299) at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:132) ... 75 more Caused by: java.io.IOException at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:576) at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:484) at org.geotools.data.store.ContentFeatureCollection.iterator(ContentFeatureCollection.java:255) ... 82 more Caused by: java.lang.NullPointerException at org.geotools.data.jdbc.FilterToSQL.visit(FilterToSQL.java:450) at org.geotools.filter.LikeFilterImpl.accept(LikeFilterImpl.java:614) at org.geotools.data.jdbc.FilterToSQL.visit(FilterToSQL.java:544) at org.geotools.data.jdbc.FilterToSQL.visit(FilterToSQL.java:496) at org.geotools.filter.AndImpl.accept(AndImpl.java:64) at org.geotools.data.jdbc.FilterToSQL.encode(FilterToSQL.java:205) at org.geotools.data.jdbc.FilterToSQL.encodeToString(FilterToSQL.java:234) at org.geotools.jdbc.JDBCDataStore.selectSQL(JDBCDataStore.java:2885) at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSource.java:564) ... 84 more

1

It seems the problem was incredibly minor and poorly reported. Geoserver insists on "wildCard" but the filter I had used previously on Mapserver accepted "wildcard". It's clearly my fault for not using the right case, but would it be that hard to report that the required attribute was missing?

(I found the solution here http://osdir.com/ml/gis.geoserver.user/2005-09/msg00023.html)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.