Select to view content in your preferred language

Need some help on evaluating the Automation Exception in Network Analysis

1918
15
03-24-2013 11:42 PM
pavan_kumarmuttigi
Emerging Contributor
Hi,

Can any one please help me evaluating the following Automation Exception I am getting while I am trying to get the state of Network Dataset through the INALocator reference in arcobjects Java.

The following is the Exception I am getting.


AutomationException: 0x80004001 - Not implemented
at com.esri.arcgis.interop.Dispatch.vtblInvoke(Unknown Source)
at com.esri.arcgis.geodatabase.INetworkDatasetProxy.getState(Unknown Source).


Thanks in Advance.
0 Kudos
15 Replies
LeoDonahue
Deactivated User
Can you post the source code that is throwing that exception?
0 Kudos
pavan_kumarmuttigi
Emerging Contributor
Hi Leo Donahue,

I am using the FileGDB.The following is the code which is failing for me with the case in getting the state of the NetworkDataset as such which gives the information of it.Like whether it is built(or)unbuilt(or)unknown.

INetworkDataset nds = naContext.getNALocator.getNetworkDataset();
int state = nds.getState();

However I will try with code post like instead of getting the state of the NetworkDataset through naLocator reference I will make like to get the state of it from directly getting the NetworkDataset through the naContext.

Thanks in Advance
0 Kudos
JasonPike
Frequent Contributor
Hi Leo Donahue,

I am using the FileGDB.The following is the code which is failing for me with the case in getting the state of the NetworkDataset as such which gives the information of it.Like whether it is built(or)unbuilt(or)unknown.

INetworkDataset nds = naContext.getNALocator.getNetworkDataset();
int state = nds.getState();

However I will try with code post like instead of getting the state of the NetworkDataset through naLocator reference I will make like to get the state of it from directly getting the NetworkDataset through the naContext.

Thanks in Advance


Apparently, not all INetworkDatasets support the State property. It doesn't seem to be documented for FileGDB, though.

From the documentation:
For network datasets in an ArcSDE geodatabase, the State property will return the error "Object does not support this action."
http://resources.esri.com/help/9.3/arcgisengine/java/api/arcobjects/com/esri/arcgis/geodatabase/Netw...
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/State_Property/002500000...

This seems to be common throughout the ArcGIS API. I think it is a violation of the interface segregation principle.
http://en.wikipedia.org/wiki/Interface_segregation_principle
0 Kudos
LeoDonahue
Deactivated User
Pavan,

Can you show us how you are creating your NAContext? 
Are you setting the LocatorByRef to a INALocator? 
And you have added a LocatorAgent? 
How did you bind the NetWorkDataset to your INALocatorAgent?

correction:  it goes all the way back to how you instantiated your NetworkDataset.  Did you use NetworkDatasetFDExtension and IDatasetContainer ?

This is probably where it starts since your error indicates an unknown source.
0 Kudos
JasonPike
Frequent Contributor
Pavan,

Can you show us how you are creating your NAContext? 
Are you setting the LocatorByRef to a INALocator? 
And you have added a LocatorAgent? 
How did you bind the NetWorkDataset to your INALocatorAgent?

correction:  it goes all the way back to how you instantiated your NetworkDataset.  Did you use NetworkDatasetFDExtension and IDatasetContainer ?

This is probably where it starts since your error indicates an unknown source.


Leo,

Can you explain how you got from a "Not Implemented" exception to "unknown source"? I didn't see anything in the documentation that explains that. I know I'm missing something...

Thanks!
0 Kudos
LeoDonahue
Deactivated User
Pavan's original post:



The following is the Exception I am getting.

AutomationException: 0x80004001 - Not implemented
at com.esri.arcgis.interop.Dispatch.vtblInvoke(Unknown Source)
at com.esri.arcgis.geodatabase.INetworkDatasetProxy.getState(Unknown Source).
0 Kudos
JasonPike
Frequent Contributor
Pavan's original post:


Oh. I thought "Unknown source" indicated that debug symbols were missing, so it couldn't give the line numbers:
http://stackoverflow.com/questions/3132302/unknown-source-in-exception-stack-trace

I agree that we need to see the code the creates the context though.
0 Kudos
LeoDonahue
Deactivated User
In the Java API, there is only one concrete class that implements INetworkDataset, and it supports getState().

[ATTACH=CONFIG]22988[/ATTACH]
0 Kudos
LeoDonahue
Deactivated User
Oh. I thought that was because of missing debug symbols:


We can only go by what he posted.  There might be more he didn't post.
0 Kudos