Geoserver发布WMS服务出错分析
使用Geoserver发布一个空间表,在图层预览的过程中没有任何问题,但是当我根据这个空间表传创建视图再发布wms服务,访问时就会报错,错误信息如下:
Caused by: java.sql.SQLException: ORA-29902: 执行 ODCIIndexStart() 例行程序中出 错 ORA-13208: 对运算符 [window SRID does not match layer SRID] 求值时出现内部错误 ORA-06512: 在 "MDSYS.SDO_INDEX_METHOD_10I", line 333 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement. java:216) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedSta tement.java:955) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStateme nt.java:1060) at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPrepa redStatement.java:839) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme nt.java:1132) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep aredStatement.java:3316) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare dStatement.java:3361) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(Dele gatingPreparedStatement.java:96) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(Dele gatingPreparedStatement.java:96) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(Dele gatingPreparedStatement.java:96) at org.geotools.jdbc.JDBCFeatureReader.<init>(JDBCFeatureReader.java:167 ) at org.geotools.jdbc.JDBCFeatureSource.getReaderInternal(JDBCFeatureSour ce.java:599) ... 117 more 05 十二月 08:55:39 ERROR [geoserver.ows] -
根据错误信息,是服务访问的srid和数据索引的srid不匹配导致,可以猜想,在某一环节出现问题,明明是同一份数据。经过多方面的验证发现,在oracle spatial空间元表里没有这个视图的记录,难道是这个问题?也就是说在元表中创建一条记录,就会成功?ok,尝试一下:
insert into user_sdo_geom_metadata values ('V_REGION_MAPNO_R', 'SHAPE',sdo_dim_array(sdo_dim_element('X', -180, 180, 0.5), sdo_dim_element('Y', -90, 90, 0.5) ),4326)
更新了以后,再次预览wms图层,发现还是上面的错误,难道不是这样的,但是想想不可能有其他原因,于是将geoserver重启一下,一切OK!如图:
有时重启就是那么任性!【把电脑重启能解决百分之九十的问题】