AutomationException:Item Not Found in 'Esri.GeoDatabase'.

1264
10
Jump to solution
05-09-2013 04:29 AM
pavan_kumarmuttigi
New Contributor
Hi,

Can any one help me in solving this exception with ArcObjects java.

The following is the Automation Exception I am getting when I am trying to open the feature dataset through the IFeatureWorkSpace reference.

AutomationException:Item Not Found in 'Esri.GeoDatabase'.

at IFeatureWorkSpaceproxy.openFeatureDataset(unknownsource).




This is what I am getting when trying to get the feature dataset reference. BTW, I am trying to work all this through accessing the file geodatabase.

I checked with the feature dataset name present in the file geo database through the ArcCatalog. The same name is the one I am passing to the openFeatureDataSet() method. But I am getting the above mentioned exception.

Can any one please help me in resolving this issue?

Thanks in Advance.
0 Kudos
1 Solution

Accepted Solutions
LeoDonahue
Occasional Contributor III
\ = backslash
/ = forward slash

And if you are using Java, you have to use double backslashes, like the example I gave you.

View solution in original post

0 Kudos
10 Replies
LeoDonahue
Occasional Contributor III
Good morning Pavan, (it's morning here..)

Are you using the Fully Qualified Table Name of the feature dataset? 

Such as: databasename.owner.tablename ?  or owner.tablename?
0 Kudos
pavan_kumarmuttigi
New Contributor
Hi Leo Donahue,

Yes, Actually what I am trying to do is accessing the file geo database file present locally in my machine through the IFeeatureWorkSpace reference of the Java API for arcobjects. And through this IFeatureWorkSpace reference I am trying to open IFeatureDataSet present in that file geo database.

IFeatureWorkspace featureWorkspace = new IFeatureWorkspaceProxy(
    workspaceFactory.openFromFile(geoDbFilePath, 0));

FeatureDataset featureDataset = featureWorkspace
    .openFeatureDataset(featuredataset name);

Here is the place where I am getting the above mentioned exception. Actually I am passing the feature dataset name as it is in the file geo database(with fully qualified name). I also once again cross-checked the name of that feature dataset manually through the ArcCatalog. I didn't any mismatch with name I am passing for the method and  present in the file geo database.But still I am getting the exception that "Item not found".

Can you please let me know some suggestion to solve this issue?


Thanks in Advance.
0 Kudos
LeoDonahue
Occasional Contributor III
Assuming the following:

A file geodatabase such as:  c:\leo.gdb
A FeatureDataset in that file geodatabase named: myfeaturedataset
A FeatureClass in that FeatureDataset named: myfeatureclass

            // Create a file geodatabase workspacefactory and open the c:\leo.gdb FGDB
            FileGDBWorkspaceFactory factory = new FileGDBWorkspaceFactory();
            Workspace workspace = new Workspace(factory.openFromFile("c:\\leo.gdb", 0));
            
            // Get all dataset names in the FGDB workspace
            IEnumDatasetName enumDatasetName = workspace.getDatasetNames(esriDatasetType.esriDTAny);
            
            // Open the "myfeaturedataset" and print its browsename
            IFeatureDataset featDataset = workspace.openFeatureDataset("myfeaturedataset");
            System.out.println("The browse name of this FeatureDataset is: " + featDataset.getBrowseName());
            
            // Get all datasets within the "myfeaturedataset"
            IEnumDataset enumDatasetName2 = featDataset.getSubsets();
            
            // Print all the dataset names in the c:\leo.gdb FGDB
            IDatasetName dsName = enumDatasetName.next();
            while(dsName != null){
                System.out.println("Dataset Name: " + dsName.getName());
                dsName = enumDatasetName.next();
            }
            
            // Print the featureclass name residing in the "myfeaturedataset" FeatureDataset
            IDataset dsName2 = enumDatasetName2.next();
            while(dsName2 != null){
                System.out.println("FeatureClass Name: " + dsName2.getName());
                dsName2 = enumDatasetName2.next();
            }


This should print:

The browse name of this FeatureDataset is: myfeaturedataset
Dataset Name: myfeaturedataset
FeatureClass Name: myfeatureclass
0 Kudos
pavan_kumarmuttigi
New Contributor
Hi Leo Donahue,

Some how I am doing the same way as you mentioned with the feature dataset. But  at this line

IFeatureDataset featDataset = workspace.openFeatureDataset("myfeaturedataset");

I am getting the Automation Exception as "Item not found DAO.Fields". Actually I am giving the same name for feature dataset as in the geodb. I cross-checked the name I am passing to the openFeatureDataset() , using the ArcCatalog. I didn't find any mismatch between the names I am passing and the one in geo database. But still I am getting that exception.
0 Kudos
LeoDonahue
Occasional Contributor III
Some how I am doing the same way as you mentioned with the feature dataset.

But  at this line

IFeatureDataset featDataset = workspace.openFeatureDataset("myfeaturedataset");

I am getting the Automation Exception as "Item not found DAO.Fields".


Can you show us how you declared your "workspace"  or "workspaceFactory" variables?  You haven't shown that, and I suspect that is the cause of your problem.
0 Kudos
pavan_kumarmuttigi
New Contributor
Hi Leo Donahue,

This is the way I am initiating the workspace.

IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactory();
IFeatureWorkspace featureWorkspace = new IFeatureWorkspaceProxy(
    workspaceFactory.openFromFile(geoDbFilePath, 0));
  IFeatureDataset featureDataset = featureWorkspace
    .openFeatureDataset(feature dataset name);

Please let me know if this is the one cause for the exception

Thanks in advance
0 Kudos
LeoDonahue
Occasional Contributor III
Remember, the geoDbFilePath needs to be escaped for the backslash character.
0 Kudos
pavan_kumarmuttigi
New Contributor
Hi Leo Donahue,

I am giving the complete path of the geodb file which is escaped for the backslash character.
like for example the file geodb path as :  ../data/geocities.gdb.
0 Kudos
LeoDonahue
Occasional Contributor III
\ = backslash
/ = forward slash

And if you are using Java, you have to use double backslashes, like the example I gave you.
0 Kudos