[Geoserver-devel] JDBCFeatureStore Exception in geoserver snapshot 1.7 using MySQL

We've had success using geoserver war file release 1.6, creating
a MySQL datastore and several FeatureTypes using tables that leverage
MySQL spatial extensions.

When we build and deploy 1.7 snapshot and attempt to create the same
FeatureTypes using the same tables, we always get this exception from
JDBCFeatureStore:

Platform:

Debian Etch 4.0
Tomcat 6.x
Java 1.6
MySQL 5.x

ava.lang.RuntimeException: java.io.IOException: Error occured calculating
bounds
  at
org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:386)
  at
org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:351)
  at
org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:323)
  at
org.geoserver.feature.FeatureSourceUtils.getBoundingBoxEnvelope(FeatureSourceUtils.java:44)
  at
org.vfny.geoserver.util.DataStoreUtils.getBoundingBoxEnvelope(DataStoreUtils.java:318)
  at
org.vfny.geoserver.action.data.TypesEditorAction.executeBBox(TypesEditorAction.java:231)
  at
org.vfny.geoserver.action.data.TypesEditorAction.execute(TypesEditorAction.java:133)
  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.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.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.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.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.GZIPFilter.doFilter(GZIPFilter.java:41)
  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(Thread.java:613)
Caused by: java.io.IOException: Error occured calculating bounds
  at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:783)
  at
org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:383)
  ... 59 more
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an
error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'FROM PirepsSpatial WHERE
TRUE' at line 1
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1027)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
  at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2537)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2466)
  at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1383)
  at
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
  at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:754)
  ... 60 more

-----------------------------------------------------------

Tomcat log:

18 Jul 11:23:50 WARN [geotools.jdbc] - Could not find mapping for:pt
rest based on schemaBase: gml:AbstractFeatureType
18 Jul 11:23:51 WARN [action.RequestProcessor] - Unhandled Exception thrown:
class java.lang.RuntimeException

----------------------------------------------------------------

MySQL DDL example

CREATE TABLE IF NOT EXISTS $pirepTable (
              fid BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
              pt GEOMETRY NOT NULL,
              receiptTime TIMESTAMP(14),
              blah,blah,blah

Data population script

INSERT INTO $table( fid, pt, blah, blash
VALUES( $fid, GeomFromText('POINT($lon $lat)'), blah, blah

-------------------------------------------------------------

schema.xml for this FeatureType created by the successful war file release
1.6

<xs:complexType name = "PirepsSpatial_Type" >
  <xs:complexContent >
    <xs:extension base = "gml:AbstractFeatureType" >
      <xs:sequence >
      <xs:element nillable = "true" name = "pt" maxOccurs = "1" type =
"gml:PointPropert
yType" minOccurs = "0" />
       ................more string and int types

----------------------------------------------------

Any ideas why the 1.7 version doesn't recognize the Geometry type as a valid
gml:PointPropertyType.

Thanks,
Todd

--
View this message in context: http://www.nabble.com/JDBCFeatureStore-Exception-in-geoserver-snapshot-1.7-using-MySQL-tp18535066p18535066.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.