[Geoserver-users] mapPreview error [GeoServer V1.6.4b]

Dear all

I am a new user of GeoServer. here is a problem I could not find any solutions for this version. The problem is that I could not open MapPreview.
if I open the page, there is java error :
The following exception was thrown:
java.lang.NullPointerException
I had this problem twice already. Last time, my solution is that reinstall Geoserver. then there is no problem any more.
**How does this problem happens?
My environment setting are : WinXP + JDK update 6 + Apache Tomcat 6.0.16 + PostGIS 1.3.3 + Geoserver 1.6.4 + QGIS + OpenLayers
I used QGIS import a 1GB shp file into POSTGIS, then I connect PostGIS with Geoserver.
When I configure the feature type with default ‘polygon’ type. then the problem happens.
I dont know anything about Java. Is there anybody faced the same problem before?
Thanks in advance

All the best


Xiaoyu Guan (Sam)
Geo-information Science
Wageningen UR

Xiaoyu Guan ha scritto:

Dear all

I am a new user of GeoServer. here is a problem I could not find any solutions for this version. The problem is that I could not open MapPreview.
if I open the page, there is java error :
The following exception was thrown:
/|java.lang.NullPointerException|/
I had this problem twice already. Last time, my solution is that reinstall Geoserver. then there is no problem any more.
**How does this problem happens?
My environment setting are : WinXP + JDK update 6 + Apache Tomcat 6.0.16 + PostGIS 1.3.3 + Geoserver 1.6.4 + QGIS + OpenLayers
I used QGIS import a 1GB shp file into POSTGIS, then I connect PostGIS with Geoserver.
When I configure the feature type with default 'polygon' type. then the problem happens.
I dont know anything about Java. Is there anybody faced the same problem before?

I've seen this problem only in GeoServer instances that do not have any
layer configured... not sure about your case.
Are you using an empty data directory or the one we ship along with the
release (the one with archsites, bugsites, states and whatnot?)

Oh btw, do you have any more detailed message in the geoserver logs
you can find in the data directory, logs/geoserver.log file?

Cheers
Andrea

Dear Andrea:
I think my problem is quite similar to your case. the reason could be I configured the polygon layer with wrong feature type.
if in that case, How can fix the problem?

The Geoserver which I used is not empty data directory. It is with sample datasets, and you can view the dataset with OpenLayers.
I did not see any bug sites…

Yes, there are a lot of information in the log file. it is difficult for me to find out what is the important information in the log file?
I think here is the start point of the problem.

2008-06-11 16:35:42,213 INFO [geoserver.filters] - Compressing output for mimetype: text/html;charset=UTF-8
2008-06-11 16:36:13,507 INFO [geoserver.global] - Loading feature type ‘atrium:::Vlakken_bodemvervuiling’ (layer 1/18)
2008-06-11 16:36:13,773 INFO [geoserver.global] - Loading feature type ‘DS_giant_polygon:::giant_polygon’ (layer 2/18)
2008-06-11 16:36:13,804 INFO [geoserver.global] - Loading feature type ‘DS_poi:::poi’ (layer 3/18)
2008-06-11 16:36:13,804 INFO [geoserver.global] - Loading feature type ‘DS_poly_landmarks:::poly_landmarks’ (layer 4/18)
2008-06-11 16:36:13,835 INFO [geoserver.global] - Loading feature type ‘DS_tiger_roads:::tiger_roads’ (layer 5/18)
2008-06-11 16:36:13,835 INFO [geoserver.global] - Loading feature type ‘qwer:::test’ (layer 6/18)
2008-06-11 16:36:14,288 INFO [geoserver.global] - Loading feature type ‘qwer:::test2’ (layer 7/18)
2008-06-11 16:36:14,460 INFO [geoserver.global] - Loading feature type ‘qwer:::test3’ (layer 8/18)
2008-06-11 16:36:14,507 INFO [geoserver.global] - Loading feature type ‘sfArchsites:::archsites’ (layer 9/18)
2008-06-11 16:36:14,553 INFO [geoserver.global] - Loading feature type ‘sfBugsites:::bugsites’ (layer 10/18)
2008-06-11 16:36:14,553 INFO [geoserver.global] - Loading feature type ‘sfRestricted:::restricted’ (layer 11/18)
2008-06-11 16:36:14,553 INFO [geoserver.global] - Loading feature type ‘sfRoads:::roads’ (layer 12/18)
2008-06-11 16:36:14,569 INFO [geoserver.global] - Loading feature type ‘sfStreams:::streams’ (layer 13/18)
2008-06-11 16:36:14,569 INFO [geoserver.global] - Loading feature type ‘states_shapefile:::states’ (layer 14/18)
2008-06-11 16:36:14,569 INFO [geoserver.global] - Loading feature type ‘tasmania_cities:::tasmania_cities’ (layer 15/18)
2008-06-11 16:36:14,600 INFO [geoserver.global] - Loading feature type ‘tasmania_roads:::tasmania_roads’ (layer 16/18)
2008-06-11 16:36:14,600 INFO [geoserver.global] - Loading feature type ‘tasmania_state_boundaries:::tasmania_state_boundaries’ (layer 17/18)
2008-06-11 16:36:14,600 INFO [geoserver.global] - Loading feature type ‘tasmania_water_bodies:::tasmania_water_bodies’ (layer 18/18)
2008-06-11 16:36:14,600 INFO [geoserver.filters] - Compressing output for mimetype: text/html;charset=UTF-8
2008-06-11 16:36:14,600 WARN [geoserver.filters] - Setting mimetype after acquiring stream! was:text/html;charset=UTF-8; set to: text/html; url was: http://127.0.0.1:2008/geoserver/admin/saveToGeoServer.do
2008-06-11 16:36:14,616 WARN [geoserver.filters] - Setting mimetype after acquiring stream! was:text/html;charset=UTF-8; set to: text/html; url was: http://127.0.0.1:2008/geoserver/admin/saveToGeoServer.do

Thanks in advance

Xiaoyu

On Thu, Jun 12, 2008 at 9:45 AM, Andrea Aime <aaime@anonymised.com> wrote:

Xiaoyu Guan ha scritto:

Dear all

I am a new user of GeoServer. here is a problem I could not find any solutions for this version. The problem is that I could not open MapPreview.
if I open the page, there is java error :
The following exception was thrown:
/|java.lang.NullPointerException|/
I had this problem twice already. Last time, my solution is that reinstall Geoserver. then there is no problem any more.
**How does this problem happens?
My environment setting are : WinXP + JDK update 6 + Apache Tomcat 6.0.16 + PostGIS 1.3.3 + Geoserver 1.6.4 + QGIS + OpenLayers
I used QGIS import a 1GB shp file into POSTGIS, then I connect PostGIS with Geoserver.
When I configure the feature type with default ‘polygon’ type. then the problem happens.
I dont know anything about Java. Is there anybody faced the same problem before?

I’ve seen this problem only in GeoServer instances that do not have any
layer configured… not sure about your case.
Are you using an empty data directory or the one we ship along with the
release (the one with archsites, bugsites, states and whatnot?)

Oh btw, do you have any more detailed message in the geoserver logs
you can find in the data directory, logs/geoserver.log file?

Cheers
Andrea


Xiaoyu Guan (Sam)
Geo-information Science
Wageningen UR

Xiaoyu Guan ha scritto:

Dear Andrea:
I think my problem is quite similar to your case. the reason could be I configured the polygon layer with wrong feature type.
if in that case, How can fix the problem?

The Geoserver which I used is not empty data directory. It is with sample datasets, and you can view the dataset with OpenLayers.
I did not see any bug sites...

BugSites is a layer, it's there, see in your logs:
> 2008-06-11 16:36:14,553 INFO [geoserver.global] - Loading feature type
> 'sfBugsites:::bugsites' (layer 10/18)

Yes, there are a lot of information in the log file. it is difficult for me to find out what is the important information in the log file?
I think here is the start point of the problem.

Nope, this is just the startup. Do you have anything that reports
the same NullPointerException you saw in the UI? If so, can you paste
a bit of the logs around it?

Cheers
Andrea

Hi Andrea:
Thanks for your mail and patient.
Here I attched some information, which could be useful. The log file over 6MB now.

2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘qwer:::test2’ (layer 7/18)
2008-06-11 17:15:44,621 ERROR [geoserver.global] - FeatureTypeInfo qwer:::test2 ignored - as DataStore qwer is disabled!
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘qwer:::test3’ (layer 8/18)
2008-06-11 17:15:44,621 ERROR [geoserver.global] - FeatureTypeInfo qwer:::test3 ignored - as DataStore qwer is disabled!
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘sfArchsites:::archsites’ (layer 9/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘sfBugsites:::bugsites’ (layer 10/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘sfRestricted:::restricted’ (layer 11/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘sfRoads:::roads’ (layer 12/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘sfStreams:::streams’ (layer 13/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘states_shapefile:::states’ (layer 14/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘tasmania_cities:::tasmania_cities’ (layer 15/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘tasmania_roads:::tasmania_roads’ (layer 16/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘tasmania_state_boundaries:::tasmania_state_boundaries’ (layer 17/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Loading feature type ‘tasmania_water_bodies:::tasmania_water_bodies’ (layer 18/18)
2008-06-11 17:15:44,621 INFO [geoserver.global] - Disposing DataStores at GeoServer shutdown…
2008-06-11 17:15:44,621 INFO [geoserver.global] - Done disposing datastores.
2008-06-12 08:17:58,421 INFO [geoserver.global] - Loading feature type ‘asdf:::Vlakken_bodemvervuiling’ (layer 1/18)
2008-06-12 08:18:03,875 INFO [geoserver.global] - Loading feature type ‘DS_giant_polygon:::giant_polygon’ (layer 2/18)
2008-06-12 08:18:03,937 INFO [geoserver.global] - Loading feature type ‘DS_poi:::poi’ (layer 3/18)
2008-06-12 08:18:03,937 INFO [geoserver.global] - Loading feature type ‘DS_poly_landmarks:::poly_landmarks’ (layer 4/18)
2008-06-12 08:18:03,953 INFO [geoserver.global] - Loading feature type ‘DS_tiger_roads:::tiger_roads’ (layer 5/18)
2008-06-12 08:18:03,968 INFO [geoserver.global] - Loading feature type ‘qwer:::test’ (layer 6/18)
2008-06-12 08:18:04,734 INFO [geoserver.global] - Loading feature type ‘qwer:::test2’ (layer 7/18)
2008-06-12 08:18:05,234 INFO [geoserver.global] - Loading feature type ‘qwer:::test3’ (layer 8/18)
2008-06-12 08:18:05,328 INFO [geoserver.global] - Loading feature type ‘sfArchsites:::archsites’ (layer 9/18)
2008-06-12 08:18:05,359 INFO [geoserver.global] - Loading feature type ‘sfBugsites:::bugsites’ (layer 10/18)
2008-06-12 08:18:05,375 INFO [geoserver.global] - Loading feature type ‘sfRestricted:::restricted’ (layer 11/18)
2008-06-12 08:18:05,390 INFO [geoserver.global] - Loading feature type ‘sfRoads:::roads’ (layer 12/18)
2008-06-12 08:18:05,406 INFO [geoserver.global] - Loading feature type ‘sfStreams:::streams’ (layer 13/18)
2008-06-12 08:18:05,421 INFO [geoserver.global] - Loading feature type ‘states_shapefile:::states’ (layer 14/18)
2008-06-12 08:18:05,437 INFO [geoserver.global] - Loading feature type ‘tasmania_cities:::tasmania_cities’ (layer 15/18)
2008-06-12 08:18:05,453 INFO [geoserver.global] - Loading feature type ‘tasmania_roads:::tasmania_roads’ (layer 16/18)
2008-06-12 08:18:05,468 INFO [geoserver.global] - Loading feature type ‘tasmania_state_boundaries:::tasmania_state_boundaries’ (layer 17/18)
2008-06-12 08:18:05,484 INFO [geoserver.global] - Loading feature type ‘tasmania_water_bodies:::tasmania_water_bodies’ (layer 18/18)
2008-06-12 08:26:40,984 WARN [action.RequestProcessor] - Unhandled Exception thrown: class java.lang.NullPointerException
2008-06-12 09:33:40,661 INFO [responses.helpers] - Supported JAIMapResponse’s MIME Types: [image/jpeg]
2008-06-12 09:33:40,708 WARN [referencing.factory] - Axis elements found in a wkt definition, the force longitude first axis order hint might not be respected:
PROJCS[“WGS84 / Simple Mercator”, GEOGCS[“WGS 84”, DATUM[“WGS_1984”, SPHEROID[“WGS_1984”, 6378137.0, 298.257223563]], PRIMEM[“Greenwich”, 0.0], UNIT[“degree”, 0.017453292519943295], PROJECTION[“Mercator_1SP_Google”], PARAMETER[“latitude_of_origin”, 0.0], PARAMETER[“central_meridian”, 0.0], PARAMETER[“scale_factor”, 1.0], PARAMETER[“false_easting”, 0.0], PARAMETER[“false_northing”, 0.0], UNIT[“m”, 1.0], AXIS[“x”, EAST], AXIS[“y”, NORTH], AUTHORITY[“EPSG”,“54004”]]
2008-06-12 09:33:49,428 ERROR [geotools.rendering] - Could not create the next feature:IllegalAttribute: com.vividsolutions.jts.geom.MultiPolygon , but got com.vividsolutions.jts.geom.Polygon
java.util.NoSuchElementException: Could not create the next feature:IllegalAttribute: com.vividsolutions.jts.geom.MultiPolygon , but got com.vividsolutions.jts.geom.Polygon
at org.geotools.data.store.FeatureReaderIterator.next(FeatureReaderIterator.java:72)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1599)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:641)
at org.geotools.renderer.shape.ShapefileRenderer.renderWithStreamingRenderer(ShapefileRenderer.java:1461)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:1331)
at org.geotools.renderer.shape.ShapefileRenderer.paint(ShapefileRenderer.java:262)
at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:310)
at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:424)
at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:616)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:192)
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.doGet(FrameworkServlet.java:347)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:170)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: IllegalAttribute: com.vividsolutions.jts.geom.MultiPolygon , but got com.vividsolutions.jts.geom.Polygon
at org.geotools.feature.DefaultFeature.setAttribute(DefaultFeature.java:229)
at org.geotools.feature.DefaultFeature.setAttributes(DefaultFeature.java:270)
at org.geotools.feature.DefaultFeature.(DefaultFeature.java:98)
at org.geotools.feature.DefaultFeatureType.create(DefaultFeatureType.java:169)
at org.geotools.data.jdbc.JDBCFeatureReader.readFeature(JDBCFeatureReader.java:125)
at org.geotools.data.jdbc.JDBCFeatureReader.next(JDBCFeatureReader.java:88)
at org.geotools.data.store.FeatureReaderIterator.next(FeatureReaderIterator.java:64)
… 58 more
Caused by: java.lang.IllegalArgumentException: com.vividsolutions.jts.geom.Polygon is not an acceptable class for the_geom as it is not assignable from class com.vividsolutions.jts.geom.MultiPolygon
at org.geotools.feature.DefaultAttributeType.validate(DefaultAttributeType.java:405)
at org.geotools.feature.DefaultFeature.setAttribute(DefaultFeature.java:226)
… 64 more
2008-06-12 09:47:43,409 INFO [geoserver.filters] - Compressing output for mimetype: text/html
2008-06-12 09:47:50,097 INFO [geoserver.filters] - Not compressing output for mimetype: image/png
2008-06-12 09:58:37,827 WARN [action.RequestProcessor] - Unhandled Exception thrown: class java.lang.NullPointerException
2008-06-12 09:58:47,609 INFO [geoserver.filters] - Compressing output for mimetype: text/html
2008-06-12 09:58:47,968 INFO [geoserver.filters] - Compressing output for mimetype: text/html;charset=UTF-8
2008-06-12 09:58:47,984 WARN [geoserver.filters] - Setting mimetype after acquiring stream! was:text/html;charset=UTF-8; set to: text/html; url was: http://127.0.0.1:2008/geoserver/welcome.do
2008-06-12 09:58:48,093 WARN [geoserver.filters] - Setting mimetype after acquiring stream! was:text/html;charset=UTF-8; set to: text/html; url was: http://127.0.0.1:2008/geoserver/welcome.do

On Thu, Jun 12, 2008 at 10:26 AM, Andrea Aime <aaime@anonymised.com> wrote:

Xiaoyu Guan ha scritto:

Dear Andrea:

I think my problem is quite similar to your case. the reason could be I configured the polygon layer with wrong feature type.
if in that case, How can fix the problem?

The Geoserver which I used is not empty data directory. It is with sample datasets, and you can view the dataset with OpenLayers.
I did not see any bug sites…

BugSites is a layer, it’s there, see in your logs:

2008-06-11 16:36:14,553 INFO [geoserver.global] - Loading feature type
‘sfBugsites:::bugsites’ (layer 10/18)

Yes, there are a lot of information in the log file. it is difficult for me to find out what is the important information in the log file?
I think here is the start point of the problem.

Nope, this is just the startup. Do you have anything that reports
the same NullPointerException you saw in the UI? If so, can you paste
a bit of the logs around it?

Cheers
Andrea


Xiaoyu Guan (Sam)
Geo-information Science
Wageningen UR

Xiaoyu Guan ha scritto:

Hi Andrea:
Thanks for your mail and patient.
Here I attched some information, which could be useful. The log file over 6MB now.

...

2008-06-12 09:33:49,428 ERROR [geotools.rendering] - Could not create the next feature:IllegalAttribute: com.vividsolutions.jts.geom.MultiPolygon , but got com.vividsolutions.jts.geom.Polygon
java.util.NoSuchElementException: Could not create the next feature:IllegalAttribute: com.vividsolutions.jts.geom.MultiPolygon , but got com.vividsolutions.jts.geom.Polygon
    at org.geotools.data.store.FeatureReaderIterator.next(FeatureReaderIterator.java:72)
    at

Ok, this one is interesting, thought not the NullPointerException you
talked about before. It seems your metadata and table contents are inconsistent.
You're in either one of the two following situations:
* the data is your table is made only of polygons, but your
   geometry_columns table says multipolygon
* the data in your table is mixed, a bit of multi, a bit of poly.

For GeoServer to work fine the data must be all of the same type, and
consistent with the metadata, that is, for example:
* all your geometry are Polygon, and the geometry_columns table as
   to say the same or
* all your geometries are MultiPolyong, adn the geometry_columns table
   has to say the same

For the future, eh, we could also try to make data reading a bit more
lenient and turn a polygon into a multipolygon on the fly to
compensate for the discrepancy... Justin, Jody, any other developer,
opinions on this one?

Cheers
Andrea

Dear Andrea:
Thanks very much for information.
I did not pay attention to the situations which you mentioned. so, is there any solutions or suggestions for me to solve this situation ?

All the best

Xiaoyu

On Thu, Jun 12, 2008 at 11:02 AM, Andrea Aime <aaime@anonymised.com> wrote:

Xiaoyu Guan ha scritto:

Hi Andrea:
Thanks for your mail and patient.
Here I attched some information, which could be useful. The log file over 6MB now.

2008-06-12 09:33:49,428 ERROR [geotools.rendering] - Could not create the next feature:IllegalAttribute: com.vividsolutions.jts.geom.MultiPolygon , but got com.vividsolutions.jts.geom.Polygon
java.util.NoSuchElementException: Could not create the next feature:IllegalAttribute: com.vividsolutions.jts.geom.MultiPolygon , but got com.vividsolutions.jts.geom.Polygon
at org.geotools.data.store.FeatureReaderIterator.next(FeatureReaderIterator.java:72)
at

Ok, this one is interesting, thought not the NullPointerException you
talked about before. It seems your metadata and table contents are inconsistent.
You’re in either one of the two following situations:

  • the data is your table is made only of polygons, but your
    geometry_columns table says multipolygon
  • the data in your table is mixed, a bit of multi, a bit of poly.

For GeoServer to work fine the data must be all of the same type, and
consistent with the metadata, that is, for example:

  • all your geometry are Polygon, and the geometry_columns table as
    to say the same or
  • all your geometries are MultiPolyong, adn the geometry_columns table
    has to say the same

For the future, eh, we could also try to make data reading a bit more
lenient and turn a polygon into a multipolygon on the fly to
compensate for the discrepancy… Justin, Jody, any other developer,
opinions on this one?

Cheers
Andrea


Xiaoyu Guan (Sam)
Geo-information Science
Wageningen UR

Xiaoyu Guan ha scritto:

Dear Andrea:
Thanks very much for information.
I did not pay attention to the situations which you mentioned. so, is there any solutions or suggestions for me to solve this situation ?

Yes, you have to modify your data or metadata in postgis so that
they are consistent as I suggested in my previous mail... for the
how I don't have a direct suggestion, if it's just the metadata
some update statements on the geometry_columns table in postgis
will do, if it's the data, I don't know exactly, but I guess you
can figure out something using the postgis manual:
http://postgis.refractions.net/docs/

Cheers
Andrea

For the future, eh, we could also try to make data reading a bit more
lenient and turn a polygon into a multipolygon on the fly to
compensate for the discrepancy... Justin, Jody, any other developer,
opinions on this one?

I agree... it would be nice if the datastore was a bit nicer in this regard. The metadata from geometry_columns should not really be trusted imho as its not kept in sync with the table. It would be nice if it was more of a "hint" and in cases where the hint was off we could recover by converting.

I also think with the new feature model you can probably set geometry to Polygon even when its type days its a MultiPolygon. I cant remember if validation has been turned off yet on trunk. For sure not on 1.6.x.

Cheers
Andrea

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,4850e63f186087180515871!

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

check the following queries:

1. select distinct geometrytype(<geometryColumn>) from <table>
2. select type from geometry_columns where f_table_name = '<table>' and f_geometry_column='<geometryColumn>'

Andrea Aime wrote:

Xiaoyu Guan ha scritto:

Dear Andrea:
Thanks very much for information.
I did not pay attention to the situations which you mentioned. so, is there any solutions or suggestions for me to solve this situation ?

Yes, you have to modify your data or metadata in postgis so that
they are consistent as I suggested in my previous mail... for the
how I don't have a direct suggestion, if it's just the metadata
some update statements on the geometry_columns table in postgis
will do, if it's the data, I don't know exactly, but I guess you
can figure out something using the postgis manual:
http://postgis.refractions.net/docs/

Cheers
Andrea

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,4850f021199487082231907!

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