[Geoserver-devel] ClassCastException with ArcSde Data Store

When attempting a GetFeature request against an ArcSde server, I get the following exception:

java.lang.ClassCastException
  at com.esri.sde.sdk.client.SeRow.getInteger([DashoPro-V2.1-070100])
  at org.geotools.data.arcsde.ArcSDEQuery.calculateResultCount(ArcSDEQuery.java:157)
  at org.geotools.data.arcsde.ArcSDEDataStore.getCount(ArcSDEDataStore.java:264)
  at org.geotools.data.AbstractFeatureSource.getCount(AbstractFeatureSource.java:221)
  at org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.java:195)
  at org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.java:285)
  at org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.java:142)
  at org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:365)
  at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:233)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  ...

Have you seen this error before? It looks like it is a problem in the ESRI library. Any work
arounds for this?

Thanks.
Steve

__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

mmm.... it seems like a (native?) sde error. Look:

                LOGGER.fine(
                    "Using the count(*) optimized result count calculation");

                String columns = { "count(*)" };
                SeQuery countQuery = null;
                countQuery = new SeQuery(connection, columns, sqlConstruct);
                countQuery.prepareQuery();
                countQuery.execute();
                count = countQuery.fetch().getInteger(0).intValue();

this last line is ArcSDEQuery.java:157. the code above means that since your query has no spatial filters, it can use a simple "select count(*)" sql query to
calculate the number of features to be returned.

Can you send me some more information about your OS platform, ArcSDE version, backend RDBMS, etc?

Is that error allways occuring? or can you isolate it for a given case? if so, please add a Jira task and assign it to me, so I will not forget to try catching it.

regards,

Gabriel.

Steve Schnick wrote:

When attempting a GetFeature request against an ArcSde server, I get the following exception:

java.lang.ClassCastException
at com.esri.sde.sdk.client.SeRow.getInteger([DashoPro-V2.1-070100])
at org.geotools.data.arcsde.ArcSDEQuery.calculateResultCount(ArcSDEQuery.java:157)
at org.geotools.data.arcsde.ArcSDEDataStore.getCount(ArcSDEDataStore.java:264)
at org.geotools.data.AbstractFeatureSource.getCount(AbstractFeatureSource.java:221)
at org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.java:195)
at org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.java:285)
at org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.java:142)
at org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:365)
at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:233)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...

Have you seen this error before? It looks like it is a problem in the ESRI library. Any work
arounds for this?

Thanks.
Steve

__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Ok, I've got the fix for this, a big thanks to Bruce McGregor for
helping to diagnose and fix the problem. For some reason some versions
of arcsde return doubles for this query (which is just asking for a
count, and I personally don't see how it could count like .34 of a row,
but anyways...). So I fixed the code to just read the object as a
number and get the intValue. Bruce tested and it seemed to work on
his. This fix is on the 2.0.x branch of geotools, and I'll commit to
geoserver cvs shortly, so it will be in the next release. And if
anyone wants it early let me know and I can email the new jar to you.

best regards,

Chris

Quoting Gabriel Roldán <gabriel.roldan@anonymised.com>:

mmm.... it seems like a (native?) sde error. Look:

                LOGGER.fine(
                    "Using the count(*) optimized result count
calculation");

                String columns = { "count(*)" };
                SeQuery countQuery = null;
                countQuery = new SeQuery(connection, columns,
sqlConstruct);
                countQuery.prepareQuery();
                countQuery.execute();
                count = countQuery.fetch().getInteger(0).intValue();

this last line is ArcSDEQuery.java:157. the code above means that
since
your query has no spatial filters, it can use a simple "select
count(*)"
sql query to
calculate the number of features to be returned.

Can you send me some more information about your OS platform, ArcSDE
version, backend RDBMS, etc?

Is that error allways occuring? or can you isolate it for a given
case?
if so, please add a Jira task and assign it to me, so I will not
forget
to try catching it.

regards,

Gabriel.

Steve Schnick wrote:

>When attempting a GetFeature request against an ArcSde server, I get
the following exception:
>
>java.lang.ClassCastException
> at com.esri.sde.sdk.client.SeRow.getInteger([DashoPro-V2.1-070100])
> at

org.geotools.data.arcsde.ArcSDEQuery.calculateResultCount(ArcSDEQuery.java:157)

> at

org.geotools.data.arcsde.ArcSDEDataStore.getCount(ArcSDEDataStore.java:264)

> at

org.geotools.data.AbstractFeatureSource.getCount(AbstractFeatureSource.java:221)

> at

org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.java:195)

> at

org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.java:285)

> at

org.vfny.geoserver.responses.wfs.FeatureResponse.execute(FeatureResponse.java:142)

> at

org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:365)

> at

org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:233)

> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> ...
>
>Have you seen this error before? It looks like it is a problem in
the ESRI library. Any work
>arounds for this?
>
>Thanks.
>Steve
>
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Win a $20,000 Career Makeover at Yahoo! HotJobs
>http://hotjobs.sweepstakes.yahoo.com/careermakeover
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by: Oracle 10g
>Get certified on the hottest thing ever to hit the market... Oracle
10g.
>Take an Oracle 10g class now, and we'll give you the exam FREE.
>http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
>_______________________________________________
>Geoserver-devel mailing list
>Geoserver-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>
>

-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle
10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/