Hi Trung, nice debugging! :)

 > 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 strange, since the SeExtent is meant to be minx,miny,maxx,maxy but 
yours seems to be maxx,maxy,minx,miny.
Does the range you're using actually belong to a real crs? it seems to be too 
wide. How was the arcsde layer created, and how did you set the bounds, crs 
and index grid sizes?


Gabriel

On Monday 18 September 2006 22:35, Trung Dinh wrote:
>   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.j
>ava:227) at
> org.geotools.data.arcsde.ArcSDEDataStore.getFeatureReader(ArcSDEDataStore.j
>ava:270) at
> org.geotools.data.DefaultFeatureResults.reader(DefaultFeatureResults.java:1
>30) at
> tyler.gis.GisSerialization$FeatureCollectionTransporter.addFeatures(GisSeri
>alization.java:82) at
> tyler.gis.GisManagerService.getFeatureCollection(GisManagerService.java:218
>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.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:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> tyler.empire.service.ServiceRemoteSkeleton.invoke(ServiceRemoteSkeleton.jav
>a:76) at
> tyler.empire.service.ServiceManagerServlet.doPost(ServiceManagerServlet.jav
>a: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(Applicatio
>nFilterChain.java:237) at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC
>hain.java:157) at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j
>ava:214) at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveConte
>xt.java:104) at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContex
>tValve.java:198) at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j
>ava:152) at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveConte
>xt.java:104) at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:13
>7) at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveConte
>xt.java:104) at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:11
>8) at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveConte
>xt.java:102) at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav
>a:109) at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveConte
>xt.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.processConn
>ection(Http11Protocol.java:705) at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja
>va: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! Messenger’s low  PC-to-Phone call
> rates.

-- 
Gabriel Roldán ([EMAIL PROTECTED])
Axios Engineering (http://www.axios.es)
Tel. +34 944 41 63 84
Fax. +34 944 41 64 90

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to