[Geoserver-devel] [jira] Created: (GEOS-1295) NPE when adding a new feature type on a PostGIS table without a geometry field

NPE when adding a new feature type on a PostGIS table without a geometry field
------------------------------------------------------------------------------

                 Key: GEOS-1295
                 URL: http://jira.codehaus.org/browse/GEOS-1295
             Project: GeoServer
          Issue Type: Bug
    Affects Versions: 1.6.0-beta2
         Environment: MacOS
            Reporter: Jean-Pierre Fiset
            Assignee: Andrea Aime

When adding a new feature type against a PostGIS/PostgreSQL table that does not contain a geometry attribute, geoserver returns a Null Pointer Exception when applying the configuration change.

The steps to reproduce:
1. Create a new table on a PostgreSQL database loaded with PostGIS. This new table should not have a geometry column
2. Add database to data stores
3. Add a new feature type based on the created table. SRS: -1 BBOX: 0 0 0 0
4. Press submit
5. Press apply
6. Witness crash

Things are going wrong before the apply button, ccording to the logs. After pressing the new button, the logs report (note, table name is 'jp_comments'):
New 17 Aug 13:34:31 DEBUG [data.postgis] - PostGIS version is 1.2 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
17 Aug 13:34:31 DEBUG [data.postgis] - Postgres version is 8.2.3
java.lang.NullPointerException
        at org.vfny.geoserver.action.data.DataFeatureTypesNewAction.execute(DataFeatureTypesNewAction.java:103)
        at org.vfny.geoserver.action.ConfigAction.execute(ConfigAction.java:101)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        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.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.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
        at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
        at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
        at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
        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.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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        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:104)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:613)
17 Aug 13:34:31 DEBUG [data.postgis] - get Feature source called on jp_comments
17 Aug 13:34:31 DEBUG [data.postgis] - returning pg feature locking
rest based on schemaBase: gml:AbstractFeatureType
17 Aug 13:34:31 DEBUG [data.postgis] - PostGIS version is 1.2 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
17 Aug 13:34:31 DEBUG [data.postgis] - Postgres version is 8.2.3

Then, after the submit button:

rest based on schemaBase: gml:AbstractFeatureType
17 Aug 13:34:50 DEBUG [data.postgis] - PostGIS version is 1.2 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
17 Aug 13:34:50 DEBUG [data.postgis] - Postgres version is 8.2.3
17 Aug 13:34:50 DEBUG [geoserver.action] - form bean:org.vfny.geoserver.form.data.TypesEditorForm
17 Aug 13:34:50 DEBUG [geoserver.action] - TypesEditorAction is Submit
17 Aug 13:34:50 DEBUG [geoserver.action] - BBOX: Generate
17 Aug 13:34:50 DEBUG [geoserver.action] - config schema atts is null

And finally, after the apply button:

17 Aug 13:35:05 WARN [action.RequestProcessor] - Unhandled Exception thrown: class java.lang.NullPointerException

A number of issues have been reported previously relating to types without geometries. However, all issues appear fixed for 1.6-beta2, so I am wondering why I am experiencing this problem.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira