[Geoserver-users] Exception: The typename element is mandatory if no FEATUREID is present

Hi,

I'm getting this exception when posting a WFS query from a MapBuilder
JavaScript. I checked the list's history and found out that I should
change the request's Content-Type to application/xml. I made the
change and I still get the exception. I'm trying with GeoServer 1.4
and 1.5 (1.3 doesn't go along with my postgis database).

I cannot provide the code of the request (I'm not familiar with
MapBuilder yet), but I'm sending the request readers, post contents
(whose query is working fine when sent through the request demo
interface) and exception report.

Thanks and cheers,
Luiz Celso

****Request Headers****
Host localhost:8180
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2)
Gecko/20070220 Firefox/2.0.0.2
Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Content-Type application/xml
serverUrl http://japore:8180/geoserver/wfs/GetFeature
Referer http://localhost:8180/qbiosweb/map2/
Content-Length 294
Cookie JSESSIONID=439925B17EC4A3230361DF4F1CD038FC
Pragma no-cache
Cache-Control no-cache

**** Post Contents ****

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs&quot;
     xmlns:ogc="http://www.opengis.net/ogc&quot;
     xmlns:webios="http://www.lis.ic.unicamp.br/webios&quot;
    version="1.0.0" service="WFS" maxFeatures="100">
  <wfs:Query typeName="webios:plant">
    <ogc:Filter/>
    </wfs:Query>
</wfs:GetFeature>

****Exception Report ****

<?xml version="1.0" ?>

<ServiceExceptionReport

   version="1.2.0"

   xmlns="http://www.opengis.net/ogc&quot;

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

   xsi:schemaLocation="http://www.opengis.net/ogc
http://localhost:8180/geoserver14/schemas//wfs/1.0

.0/OGC-exception.xsd">

   <ServiceException>

      org.vfny.geoserver.wfs.WfsException: The typename element is
mandatory if no FEATUREID is pres

ent

  at org.vfny.geoserver.wfs.requests.readers.GetFeatureKvpReader.getRequest(GetFeatureKvpReader.java:139

)

  at org.vfny.geoserver.wfs.requests.readers.GetFeatureKvpReader.getRequest(GetFeatureKvpReader.java:53

)

  at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:314)

  at org.geoserver.request.Dispatcher.dispatch(Dispatcher.java:181)

  at org.geoserver.request.Dispatcher.handleRequestInternal(Dispatcher.java:56)

  at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139

)

  at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter

.java:44)

  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)

  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)

  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)

  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

  at java.lang.reflect.Method.invoke(Method.java:585)

  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

  at java.security.AccessController.doPrivileged(Native Method)

  at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

  at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

  at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245

)

  at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)

  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)

  at java.security.AccessController.doPrivileged(Native Method)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)

  at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108

)

  at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

  at java.lang.reflect.Method.invoke(Method.java:585)

  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

  at java.security.AccessController.doPrivileged(Native Method)

  at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

  at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

  at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197

)

  at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)

  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)

  at java.security.AccessController.doPrivileged(Native Method)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)

  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

  at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol

.java:664)

  at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

  at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

  at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

  at java.lang.Thread.run(Thread.java:595)

   </ServiceException>

</ServiceExceptionReport>

Hi Luiz,

The exception indicates that the server is processing your request as a
GET request, and not a POST, even though there is content. Can you
include the snippet of code you are using to make the request. Thanks.

-Justin

Luiz Celso Gomes Jr. wrote:

Hi,

I'm getting this exception when posting a WFS query from a MapBuilder
JavaScript. I checked the list's history and found out that I should
change the request's Content-Type to application/xml. I made the
change and I still get the exception. I'm trying with GeoServer 1.4
and 1.5 (1.3 doesn't go along with my postgis database).

I cannot provide the code of the request (I'm not familiar with
MapBuilder yet), but I'm sending the request readers, post contents
(whose query is working fine when sent through the request demo
interface) and exception report.

Thanks and cheers,
Luiz Celso

****Request Headers****
Host localhost:8180
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2)
Gecko/20070220 Firefox/2.0.0.2
Accept text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Content-Type application/xml
serverUrl http://japore:8180/geoserver/wfs/GetFeature
Referer http://localhost:8180/qbiosweb/map2/
Content-Length 294
Cookie JSESSIONID=439925B17EC4A3230361DF4F1CD038FC
Pragma no-cache
Cache-Control no-cache

**** Post Contents ****

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs&quot;
     xmlns:ogc="http://www.opengis.net/ogc&quot;
     xmlns:webios="http://www.lis.ic.unicamp.br/webios&quot;
    version="1.0.0" service="WFS" maxFeatures="100">
  <wfs:Query typeName="webios:plant">
    <ogc:Filter/>
    </wfs:Query>
</wfs:GetFeature>

****Exception Report ****

<?xml version="1.0" ?>

<ServiceExceptionReport

   version="1.2.0"

   xmlns="http://www.opengis.net/ogc&quot;

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

   xsi:schemaLocation="http://www.opengis.net/ogc
http://localhost:8180/geoserver14/schemas//wfs/1.0

.0/OGC-exception.xsd">

   <ServiceException>

      org.vfny.geoserver.wfs.WfsException: The typename element is
mandatory if no FEATUREID is pres

ent

  at org.vfny.geoserver.wfs.requests.readers.GetFeatureKvpReader.getRequest(GetFeatureKvpReader.java:139

)

  at org.vfny.geoserver.wfs.requests.readers.GetFeatureKvpReader.getRequest(GetFeatureKvpReader.java:53

)

  at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:314)

  at org.geoserver.request.Dispatcher.dispatch(Dispatcher.java:181)

  at org.geoserver.request.Dispatcher.handleRequestInternal(Dispatcher.java:56)

  at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139

)

  at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter

.java:44)

  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)

  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)

  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)

  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:357)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

  at java.lang.reflect.Method.invoke(Method.java:585)

  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

  at java.security.AccessController.doPrivileged(Native Method)

  at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

  at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

  at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245

)

  at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)

  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)

  at java.security.AccessController.doPrivileged(Native Method)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)

  at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108

)

  at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

  at java.lang.reflect.Method.invoke(Method.java:585)

  at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)

  at java.security.AccessController.doPrivileged(Native Method)

  at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

  at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)

  at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197

)

  at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:177)

  at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)

  at java.security.AccessController.doPrivileged(Native Method)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)

  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

  at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol

.java:664)

  at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

  at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

  at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

  at java.lang.Thread.run(Thread.java:595)

   </ServiceException>

</ServiceExceptionReport>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,46447d80310965210051143!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com