From: Trung D. <mas...@ya...> - 2006-09-18 20:36:08
|
Hi, We are writing an application that uses Geotools 2.1M2 with ArcSDE 9.1, using lib jars from the 2.1M3 distribution. We got an Exception "Error building SeFilter" when trying to get the FeatureReader from a FeatureResults. We have no idea if we did anything wrong, or the ArcSDE that we used was wrong, or this is some problem in Geotools API. Can anybody please give us some pointer? This is our analysis of the exception: ------------------------ 1) This is the code that we ran and got the exception: 001 public void addFeatures(FeatureResults results) throws GisException { 002 String typeName = null; 003 try { 004 typeName = results.getSchema().getTypeName(); 005 /*This is where we get the exception/* 006 FeatureReader featureReader = results.reader(); 007 008/*--------------------------------------------*/ 009 addFeatures(featureReader); 010 011 012 } catch (IOException e) { 013 throw new GisException("Could not add results for " + typeName, e); 014 } 015 } (We created the featureResults using this Filter: GeometryFilterImpl = [ SHAPE bbox POLYGON ((2979588.3297516783 1211687.799, 2979588.3297516783 1329517.1429999997, 3138737.024248322 1329517.1429999997, 3138737.024248322 1211687.799, 2979588.3297516783 1211687.799)) ] We had that same problem, though, when we use the Filter.NONE to create The featureResults.) 2) When we used a debug tool to examine the method call in line 006, we realized that this method call will result in line 408 of the file "ArcSDEAdapter.java" being executed. In line 408, a FilterSet was created like this: 408 FilterSet filters = computeFilters(store, typeName, filter); When we jumped into the method computeFilters(ArcSDEDataStore store, String typeName, Filter filter), we saw that a SeLayer was created like this: 466 public static FilterSet computeFilters(ArcSDEDataStore store, 467 String typeName, Filter filter) 468 throws NoSuchElementException, IOException { 469 SeLayer sdeLayer = store.getConnectionPool().getSdeLayer(typeName); 470 FilterSet filters = new FilterSet(sdeLayer, filter); 471 472 return filters; 473 } (Probably due to our ArcSDE data), the sdeLayer in line 469 has sdeLayer.SeExtent = (9.999E35,9.999E35,-9.999E35,-9.999E35) 2) When the system reached line 424 of the file "ArcSDEAdapter.java", 424 SeFilter[] sdeSpatialFilters = filters.createSpatialFilters(); the exception would be thrown. When we continue to go deeper into this method call, eventually we discovered that the exception was thrown in line 252 of the file GeometryEncoderSDE.java: ... 250 SeExtent seExtent = sdeLayer.getExtent(); 251 SeShape extent = new SeShape(sdeLayer.getCoordRef()); 252 extent.generateRectangle(seExtent); ... At this point we were not able to debug any further, since we do not have the source code of the class com.esri.sde.sdk.client.SeShape. Anyway, we realized that we got this exception whenever the sdeLayer (that we got from the ArcSDE data) has this SeExtent value: sdeLayer.SeExtent = (9.999E35,9.999E35,-9.999E35,-9.999E35). This is the Exception trace: org.geotools.data.DataSourceException: Encoder error Error building SeFilter at org.geotools.data.arcsde.ArcSDEAdapter.createSeQuery(ArcSDEAdapter.java:446) at org.geotools.data.arcsde.ArcSDEDataStore.getFeatureReader(ArcSDEDataStore.java:227) at org.geotools.data.arcsde.ArcSDEDataStore.getFeatureReader(ArcSDEDataStore.java:270) at org.geotools.data.DefaultFeatureResults.reader(DefaultFeatureResults.java:130) at tyler.gis.GisSerialization$FeatureCollectionTransporter.addFeatures(GisSerialization.java:82) at tyler.gis.GisManagerService.getFeatureCollection(GisManagerService.java:218) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at tyler.empire.service.ServiceLocalProxy.invoke(ServiceLocalProxy.java:79) at $Proxy57.getFeatureCollection(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at tyler.empire.service.ServiceRemoteSkeleton.invoke(ServiceRemoteSkeleton.java:76) at tyler.empire.service.ServiceManagerServlet.doPost(ServiceManagerServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.RuntimeException: Error building SeFilter at org.geotools.filter.GeometryEncoderSDE.visit(GeometryEncoderSDE.java:210) at org.geotools.filter.GeometryFilterImpl.accept(GeometryFilterImpl.java:353) at org.geotools.filter.GeometryEncoderSDE.encode(GeometryEncoderSDE.java:144) at org.geotools.data.arcsde.FilterSet.createSpatialFilters(ArcSDEAdapter.java:630) at org.geotools.data.arcsde.ArcSDEAdapter.createSeQuery(ArcSDEAdapter.java:424) ... 43 more ------------------------------------------------ --------------------------------- How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates. |