Hi
I hope someone can help me out here. (sorry the long posting)
I have an postgisDB (postgis 0.7.3) running with an mapserver and ~10 layers
I wanted to try out to use geoserver (0.93) to retrive the data from the postgisDB, and
have made the info.xml & schema.xml files, but when trying to retrive data with
http://<hostname>:8080/geoserver/GetFeature?version=1.0.0&typeName=bjorneklo
I will get the attached http error:
it seems that the geoserv don't recive the selected data from postgis, when making the
sql "SELECT oid, gid, forekomst, comment, email, ip, dato, lokalitet, antal, areal, AsText(the_geom), objectid FROM
bjorneklo LIMIT 500;" mannualy the result for the testdata i 7 lines.
So what goes wrong ? did I do somthing wrong in the info/scema.xml file ?
regards
niels
-- (http error)
- <WFS_Exception>
- <Exception>
<Locator>Class FeatureResponse, in method getQuery</Locator>
- <Message>
While getting features from datasource: Error from the result set: null
</Message>
</Exception>
</WFS_Exception>
- the connection to the DB is ok, I can se several sql requests in the /usr/local/pgsql/data/serverlog like:
DEBUG: StartTransactionCommand
DEBUG: query: SELECT type FROM GEOMETRY_COLUMNS WHERE f_table_name='bjorneklo' AND f_geometry_column='the_geom';
DEBUG: ProcessQuery
DEBUG: CommitTransactionCommand
DEBUG: StartTransactionCommand
DEBUG: query: SELECT srid FROM GEOMETRY_COLUMNS WHERE f_table_name='bjorneklo';
DEBUG: ProcessQuery
DEBUG: CommitTransactionCommand
DEBUG: StartTransactionCommand
DEBUG: query: SELECT '' as TABLE_CAT,'' AS TABLE_SCHEM,bc.relname AS TABLE_NAME,a.attname AS COLUMN_NAME,a.attnum as KEY_SEQ,ic.relname as PK_NAME FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.relkind = 'r' and upper(bc.relname) = upper('bjorneklo') and i.indrelid = bc.oid and i.indexrelid = ic.oid and ic.oid = a.attrelid and i.indisprimary='t' ORDER BY table_name, pk_name, key_seq
DEBUG: ProcessQuery
DEBUG: CommitTransactionCommand
DEBUG: StartTransactionCommand
DEBUG: query: SELECT oid, gid, forekomst, comment, email, ip, dato, lokalitet, antal, areal, AsText(the_geom), objectid FROM
bjorneklo LIMIT 500;
DEBUG: ProcessQuery
DEBUG: CommitTransactionCommand
--
the log from /var/log/catalina.out says:
java.lang.NullPointerException
at org.geotools.feature.FeatureFlat.createNew(FeatureFlat.java:115)
at org.geotools.feature.FeatureFlat.<init>(FeatureFlat.java:70)
at org.geotools.feature.FeatureFactory.create(FeatureFactory.java:94)
at org.geotools.data.postgis.PostgisDataSource.getFeatures(PostgisDataSource.java:584)
at org.geotools.data.postgis.PostgisDataSource.getFeatures(PostgisDataSource.java:512)
at org.vfny.geoserver.responses.FeatureResponse.getQuery(Unknown Source)
at org.vfny.geoserver.responses.FeatureResponse.getXmlResponse(Unknown Source)
at org.vfny.geoserver.servlets.Feature.doGet(Unknown Source)
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(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:536)
--
the table bjorneklo is created as:
Table "bjorneklo"
Column | Type | Modifiers
-----------+-------------------+-----------
gid | integer |
forekomst | character varying |
comment | character varying |
email | character varying |
ip | character varying |
dato | character varying |
lokalitet | character varying |
antal | character varying |
areal | character varying |
the_geom | geometry |
objectid | integer |
Check constraints: "$1" (srid(the_geom) = -1)
"$2" ((geometrytype(the_geom) = 'POINT'::text) OR (the_geom IS NULL))
--
info.xml:
<?xml version="1.0" encoding="UTF-8"?>
<featureType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>bjorneklo</Name>
<Title>Forekomster af Bjorneklo</Title>
<Abstract>Forekomster af bjorneklo i Viborg Amt</Abstract>
<Keywords>Bjorneklo, Viborg Amt</Keywords>
<SRS>EPSG:23032</SRS>
<Operations/>
<LatLonBoundingBox minx="-174.561" miny="-8.20422e+12" maxx="154.107" maxy="8.20422e+12" />
<MetadataURL>
<url>none</url>
<format>XML</format>
<type>TC211</type>
</MetadataURL>
<Host>localhost</Host>
<Port>5432</Port>
<DatabaseName>vibamt</DatabaseName>
<User>gis</User>
<Password></Password>
</featureType>
--
scema.xml :
<xs:complexType name="bjorneklo_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="bjorneklo.gid" nillable="true" minOccurs="0" maxOccurs="1">
</xs:element>
<xs:element name="bjorneklo.forekomst" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bjorneklo.comment" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bjorneklo.email" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bjorneklo.ip" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bjorneklo.dato" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bjorneklo.lokalitet" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bjorneklo.antal" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bjorneklo.areal" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bjorneklo.the_geom" type="gml:PointPropertyType" nillable="false" minOccurs="1" maxOccurs="1"/>
<xs:element name="bjorneklo.objectid" nillable="true" minOccurs="0" maxOccurs="1">
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>