Original User: gtaylor
It looks like the SeQuery calculateLayerExtent method is broken in the ArcSDE 10.1 Java API.
The same code using the 10.0 or 9.3.x versions of the Java .jar files opperated correctly, but when switching to the 10.1 libraries the following exception is thrown when calling the calculateLayerExtent method:
java.lang.ClassCastException: com.esri.sde.sdk.client.SeEnvelope cannot be cast to com.esri.sde.sdk.client.SeExtent
at com.esri.sde.sdk.client.SeQuery.calculateLayerExtent(Unknown Source)
at test.arcsde.QueryThread.performTest(QueryThread.java:35)
at test.arcsde.TestThread.run(TestThread.java:52)
Some code that produces the error is:
SeSqlConstruct sqlCons = new SeSqlConstruct();
sqlCons.setTables(new String[] { layer });
SeQueryInfo queryInfo = new SeQueryInfo();
queryInfo.setColumns(new String[] { column });
queryInfo.setConstruct(sqlCons);
SeQuery query = new SeQuery(connection);
Object extent = query.calculateLayerExtent(queryInfo); // throws exception
Has the way the API is supposed to be used changed in a way that I'm unaware of or has this been broken?
Thanks.