Hi everybody I found out that my geometry column had a not-null constraint in PostGIS. When I removed the not-null constraint I got rid of the GetLegendGraphic request ServiceException. Another solution was to change the geometrytype in PostGIS from GEOMETRY TO LINESTRING (change the type in the table geometry_columns), but that is a valid solution in my case.
But my question is now. How do I create a layer in GeoServer/PostGIS forfil the following?: The data must be stored in only one table in PostGIS The table must have a not-null constraint The table must contain POINT, LINESTRING, POLYGON The GetLegendGraphic request must work Regards Esben -----Oprindelig meddelelse----- Fra: Esben Taudorf [mailto:[email protected]] Sendt: 7. oktober 2010 13:43 Til: Andrea Aime Cc: [email protected] Emne: Re: [Geoserver-users] GeoServer GetLegendGraphic requestServiceException Hi Andrea Here is the serviceException with the stack trace: java.lang.IllegalArgumentException: class com.vividsolutions.jts.geom.Geometry is not supported by this method class com.vividsolutions.jts.geom.Geometry is not supported by this method Details: org.geoserver.platform.ServiceException: java.lang.IllegalArgumentException: class com.vividsolutions.jts.geom.Geometry is not supported by this method at org.geoserver.ows.Dispatcher.exception(Dispatcher.java:1298) at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:241) 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.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) 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:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) Caused by: java.lang.IllegalArgumentException: class com.vividsolutions.jts.geom.Geometry is not supported by this method at org.geotools.data.DataUtilities.defaultValue(DataUtilities.java:821) at org.geotools.feature.simple.SimpleFeatureBuilder.convert(SimpleFeatureBuilder.java:314) at org.geotools.feature.simple.SimpleFeatureBuilder.set(SimpleFeatureBuilder.java:295) at org.geotools.feature.simple.SimpleFeatureBuilder.add(SimpleFeatureBuilder.java:218) at org.geotools.feature.simple.SimpleFeatureBuilder.template(SimpleFeatureBuilder.java:486) at org.vfny.geoserver.wms.responses.DefaultRasterLegendProducer.createSampleFeature(DefaultRasterLegendProducer.java:489) at org.vfny.geoserver.wms.responses.DefaultRasterLegendProducer.produceLegendGraphic(DefaultRasterLegendProducer.java:165) at org.vfny.geoserver.wms.responses.GetLegendGraphicResponse.execute(GetLegendGraphicResponse.java:81) at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48) at org.geoserver.ows.Dispatcher.response(Dispatcher.java:712) at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:233) ... 49 more Below is the output from the Geoserver log if the "49 more" is important! java.lang.IllegalArgumentException: class com.vividsolutions.jts.geom.Geometry is not supported by this method at org.geotools.data.DataUtilities.defaultValue(DataUtilities.java:821) at org.geotools.feature.simple.SimpleFeatureBuilder.convert(SimpleFeatureBuilder.java:314) at org.geotools.feature.simple.SimpleFeatureBuilder.set(SimpleFeatureBuilder.java:295) at org.geotools.feature.simple.SimpleFeatureBuilder.add(SimpleFeatureBuilder.java:218) at org.geotools.feature.simple.SimpleFeatureBuilder.template(SimpleFeatureBuilder.java:486) at org.vfny.geoserver.wms.responses.DefaultRasterLegendProducer.createSampleFeature(DefaultRasterLegendProducer.java:489) at org.vfny.geoserver.wms.responses.DefaultRasterLegendProducer.produceLegendGraphic(DefaultRasterLegendProducer.java:165) at org.vfny.geoserver.wms.responses.GetLegendGraphicResponse.execute(GetLegendGraphicResponse.java:81) at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48) at org.geoserver.ows.Dispatcher.response(Dispatcher.java:712) at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:233) 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.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) 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:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) Regards Esben -----Oprindelig meddelelse----- Fra: [email protected] [mailto:[email protected]] På vegne af Andrea Aime Sendt: 7. oktober 2010 12:15 Til: Esben Taudorf Cc: [email protected] Emne: Re: [Geoserver-users] GeoServer GetLegendGraphic request ServiceException On Thu, Oct 7, 2010 at 10:49 AM, Esben Taudorf <[email protected]> wrote: > Hi everybody > > > > I have a layer in GeoServer which is stored in a PostGIS database. The > geometrytype of the layer is GEOMETRY and now the table only contains > LINESTRING. But I what to add points and polygons to the table, this is the > reason I choose GEOMETRY as the geometrytype. My layer is working fine in > the Layer Preview... > > > > But when I do a GetLegendGraphic request I get the following > ServiceException: > > java.lang.IllegalArgumentException: class > com.vividsolutions.jts.geom.Geometry is not supported by this method class > com.vividsolutions.jts.geom.Geometry is not supported by this method This unfortunately does not tell us much. Please enable "verbose exception reporting" in the server configuration and then send the resulting service exception (which should contain a stack trace with all the references into the code that broke, files and line numbers) Cheers Andrea ----------------------------------------------------- Ing. Andrea Aime Senior Software Engineer GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584962313 fax: +39 0584962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ----------------------------------------------------- ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
