[Geoserver-devel] Filter resquest goes wrong

Hi folks,

I have tried some requests to test my wfs server based on geoserver 1.1 and
running on tomcat 4.1.30:

Test 1 - Filter (Area Of Interest)
Query all properties of all feature instances of the feature type LOCATORS
that lie within the specified box
http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators
&filter=<Filter%20xmlns="http://www.opengis.net/ogc&quot;%20xmlns:gml=&quot;http://www
.opengis.net/gml"><Within><PropertyName>locators/the_geom</PropertyName><gml
:Box><gml:coordinates>-120,30%200,80</gml:coordinates></gml:Box></Within></F
ilter>

Works fine! So, a filter with the Within operator seems to work properly...

Test 2 - Filter (location name)
Query all properties of all feature instances of the feature type LOCATORS
where the location name is 'Toronto'
http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators
&filter=<Filter><PropertyIsEqualTo><PropertyName>loc_name</PropertyName><Lit
eral>Toronto</Literal></PropertyIsEqualTo></Filter>

Works fine!!

Test 3 - Filter (country code)
Query all properties of all feature instances of the feature type LOCATORS
where the code name is 'CA'
http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators
&filter=<Filter><PropertyIsEqualTo><PropertyName>country_code</PropertyName>
<Literal>CA</Literal></PropertyIsEqualTo></Filter>

Works fine!!!

Test 4 - Filter(location name + country code)
Query all properties of all feature instances of the feature type LOCATORS
where the location name is 'Toronto' and the country code is 'CA'
http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators
&filter=<Filter%20xmlns="http://www.opengis.net/wfs&quot;%20xmlns:ogc=&quot;http://www
.opengis.net/ogc"%20xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;And&gt;&lt;PropertyIsE
qualTo><PropertyName>country_code</PropertyName><Literal>CA</Literal></Prope
rtyIsEqualTo><PropertyIsEqualTo><PropertyName>loc_name</PropertyName><Litera
l>Toronto</Literal></PropertyIsEqualTo></And></Filter>

Works fine!!!! So, a filter with the And operator seems to work properly...

Test 5 - Filter(AOI + loc_name)
Query all properties of all feature instances of the feature type LOCATORS
that lie within the specified box and where the location name is 'Toronto'
http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators
&filter=<Filter%20xmlns="http://www.opengis.net/wfs&quot;%20xmlns:ogc=&quot;http://www
.opengis.net/ogc"%20xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;And&gt;&lt;Within&gt;&lt;Pro
pertyName>locators/the_geom</PropertyName><gml:Box><gml:coordinates>-74,44%-
68,47</gml:coordinates></gml:Box></Within><PropertyIsEqualTo><PropertyName>l
oc_name</PropertyName><Literal>Toronto</Literal></PropertyIsEqualTo></And></
Filter>

Error returned by the server:

java.lang.IllegalStateException: getOutputStream() has already been called
for this response
  at
org.apache.coyote.tomcat4.CoyoteResponse.getWriter(CoyoteResponse.java:600)
  at
org.apache.coyote.tomcat4.CoyoteResponseFacade.getWriter(CoyoteResponseFacad
e.java:171)
  at
org.vfny.geoserver.servlets.AbstractService.send(AbstractService.java:446)
  at
org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java:4
87)
  at
org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:3
63)
  at
org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:195)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
org.vfny.geoserver.servlets.wfs.WfsDispatcher.doResponse(WfsDispatcher.java:
159)
  at
org.vfny.geoserver.servlets.wfs.WfsDispatcher.doGet(WfsDispatcher.java:112)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
  at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
  at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
  at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163
)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
  at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
  at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:700)
  at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
  at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
  at java.lang.Thread.run(Thread.java:534)

What is wrong with this request???

Please help!

Thanks in advance,

Marc

Hmmm... Do you have the logs? This is hard to diagnose because the
problem is likely when executing the database query (what backend are you
using? That would be helpful as well), so it sends a very unhelpful
error. The logs should probably shed more information, or alternatively
you can set the serviceStrategy param in WEB-INF/web.xml to FILE instead
of SPEED (in 1.2.3 this can be accomplished with the web admin interface,
setting config -> server -> verboseExceptions to true). You also may try
doing the property name as just 'the_geom' instead of 'locaters/the_geom',
as that's how I usually do requests. You also may try upgrading to 1.2,
though I don't remember any fixes of this nature there has been a lot of
work done since 1.1. But if you get the logs I can probably diagnose, see
if it's a problem with the request or a bug in the code).

best regards,

Chris

----- Original Message -----
From: "Morin, Marc-André" <Marc-Andre.Morin@anonymised.com>
To: <geoserver-devel@lists.sourceforge.net>
Sent: Wednesday, November 17, 2004 1:58 PM
Subject: [Geoserver-devel] Filter resquest goes wrong

Hi folks,

I have tried some requests to test my wfs server based on geoserver 1.1

and

running on tomcat 4.1.30:

Test 1 - Filter (Area Of Interest)
Query all properties of all feature instances of the feature type

LOCATORS

that lie within the specified box

http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators

&filter=<Filter%20xmlns="http://www.opengis.net/ogc&quot;%20xmlns:gml=&quot;http://www

.opengis.net/gml"><Within><PropertyName>locators/the_geom</PropertyName><gml

:Box><gml:coordinates>-120,30%200,80</gml:coordinates></gml:Box></Within></F

ilter>

Works fine! So, a filter with the Within operator seems to work

properly...

Test 2 - Filter (location name)
Query all properties of all feature instances of the feature type

LOCATORS

where the location name is 'Toronto'

http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators

&filter=<Filter><PropertyIsEqualTo><PropertyName>loc_name</PropertyName><Lit

eral>Toronto</Literal></PropertyIsEqualTo></Filter>

Works fine!!

Test 3 - Filter (country code)
Query all properties of all feature instances of the feature type

LOCATORS

where the code name is 'CA'

http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators

&filter=<Filter><PropertyIsEqualTo><PropertyName>country_code</PropertyName>

<Literal>CA</Literal></PropertyIsEqualTo></Filter>

Works fine!!!

Test 4 - Filter(location name + country code)
Query all properties of all feature instances of the feature type

LOCATORS

where the location name is 'Toronto' and the country code is 'CA'

http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators

&filter=<Filter%20xmlns="http://www.opengis.net/wfs&quot;%20xmlns:ogc=&quot;http://www

.opengis.net/ogc"%20xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;And&gt;&lt;PropertyIsE

qualTo><PropertyName>country_code</PropertyName><Literal>CA</Literal></Prope

rtyIsEqualTo><PropertyIsEqualTo><PropertyName>loc_name</PropertyName><Litera

l>Toronto</Literal></PropertyIsEqualTo></And></Filter>

Works fine!!!! So, a filter with the And operator seems to work

properly...

Test 5 - Filter(AOI + loc_name)
Query all properties of all feature instances of the feature type

LOCATORS

that lie within the specified box and where the location name is

'Toronto'

http://localhost:8080/GridRetriever/wfs?request=GetFeature&typename=locators

&filter=<Filter%20xmlns="http://www.opengis.net/wfs&quot;%20xmlns:ogc=&quot;http://www

.opengis.net/ogc"%20xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;And&gt;&lt;Within&gt;&lt;Pro

pertyName>locators/the_geom</PropertyName><gml:Box><gml:coordinates>-74,44%-

68,47</gml:coordinates></gml:Box></Within><PropertyIsEqualTo><PropertyName>l

oc_name</PropertyName><Literal>Toronto</Literal></PropertyIsEqualTo></And></

Filter>

Error returned by the server:

java.lang.IllegalStateException: getOutputStream() has already been

called

for this response
at

org.apache.coyote.tomcat4.CoyoteResponse.getWriter(CoyoteResponse.java:600)

at

org.apache.coyote.tomcat4.CoyoteResponseFacade.getWriter(CoyoteResponseFacad

e.java:171)
at

org.vfny.geoserver.servlets.AbstractService.send(AbstractService.java:446)

at

org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java:4

87)
at

org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:3

63)
at

org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:195)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at

org.vfny.geoserver.servlets.wfs.WfsDispatcher.doResponse(WfsDispatcher.java:

159)
at

org.vfny.geoserver.servlets.wfs.WfsDispatcher.doGet(WfsDispatcher.java:112)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application

FilterChain.java:247)
at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh

ain.java:193)
at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja

va:256)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok

eNext(StandardPipeline.java:643)
at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja

va:191)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok

eNext(StandardPipeline.java:643)
at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at

org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)

at

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180

)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok

eNext(StandardPipeline.java:643)
at

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.

java:171)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok

eNext(StandardPipeline.java:641)
at

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163

)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok

eNext(StandardPipeline.java:641)
at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java

:174)
at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok

eNext(StandardPipeline.java:643)
at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)

at

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne

ction(Http11Protocol.java:700)
at

org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)

at

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav

a:683)
at java.lang.Thread.run(Thread.java:534)

What is wrong with this request???

Please help!

Thanks in advance,

Marc

--