In the ArcObjects 10.8.1 (Java) code, initialized ArcGIS Server license.
_aoInitialize.initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer);
Trying to open a Personal Geodatabase using the below Esri provided code snippet.
[Java]
//For example, pathToFile= "C:\\myData\\mypGDB.mdb".
static IWorkspace openFromFile_pGDB_Workspace(String pathToFile)throws Exception{
IWorkspaceFactory workspaceFactory = new AccessWorkspaceFactory();
return workspaceFactory.openFromFile(pathToFile, 0);
}
Getting an exception as below.
AutomationException: 0x80040154 - Class not registered
at com.esri.arcgis.interop.NativeObjRef.init(Unknown Source)
at com.esri.arcgis.interop.NativeObjRef.<init>(Unknown Source)
at com.esri.arcgis.interop.Dispatch.createDispatch(Unknown Source)
at com.esri.arcgis.interop.Dispatch.<init>(Unknown Source)
at com.esri.arcgis.geodatabase.IWorkspaceFactoryProxy.<init>(Unknown Source)
at com.esri.arcgis.datasourcesGDB.AccessWorkspaceFactory.<init>(Unknown Source)
at com.esri.arcgis.datasourcesGDB.AccessWorkspaceFactory.<init>(Unknown Source)
Where as, the below code for File Geodatabase was WORKING FINE with out any issue.
[Java]
//For example, pathToFile= "C:\\myData\\myfGDB.gdb".
static IWorkspace openFromFile_fGDB_Workspace(String pathToFile)throws Exception{
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactory();
return workspaceFactory.openFromFile(pathToFile, 0);
}
As per the API documentation, AccessWorkspaceFactory is available with ArcGIS Server too. Then what could be the reason for exception?
![Ranga_Tolapi_0-1660125008607.png Ranga_Tolapi_0-1660125008607.png](https://community.esri.com/t5/image/serverpage/image-id/48225i32B6DF16844C5E7E/image-size/medium?v=v2&px=400)
Can someone throw some light here.