cast from IFeatureClass to ISchemaLock  (ARCGIS)

471
1
04-23-2013 06:17 AM
EricPlante
New Contributor
Hi

I'm programming with the ARCGIS Java SDK, in Eclipse.

I need to cast an IFeatureClass to an ISchemalock. This cast is supposed to be allowed. There is an example of this cast in: http://resources.esri.com/help/9.3/arcgisengine/java/doc/b22267cb-642c-11dc-9ca3-0b35f906bb2e.htm

However, when I try to perform this cast in my code, an exception appears:

Exception in thread "main" java.lang.ClassCastException: com.esri.arcgis.geodatabase.IFeatureClassProxy cannot be cast to com.esri.arcgis.geodatabase.ISchemaLock

Are you able to make this cast on an IFeatureClass ? Here is the code to perform this:
//Attempt to acquire an exclusive schema lock on the feature class.
ISchemaLock schemaLock = (ISchemaLock)featureClass;


I would appreciate if you could try this simple line of code in one of your programs, and let me know if you get an exception.

Keep me posted...
0 Kudos
1 Reply
MarkBaird
Esri Regular Contributor
Hi again Eric,

Moving you post to the ArcObjects forum so you geta better reply.

However if you need any Runtime Java API info, we can help you loads 🙂

Mark
0 Kudos