AnsweredAssumed Answered

geoprocessor.execute() AutomationException, Java Arcobjects

Question asked by melegy on Jul 6, 2013
Latest reply on Jul 9, 2013 by melegy
Hello everyone, I'm trying to use the "Near" analysis tool and "Map to KML" conversion tools in java but both bring out the same error
AutomationException: 0x80004005 - Unspecified error
at com.esri.arcgis.geoprocessing.GeoProcessor.execute(Unknown Source)

here's the method for the Near analysis tool:-

public void executeNearTool()
   {
    
     try {
      System.out.print("\n**Creating GeoProcessor object...");
     
    GP = new GeoProcessor();
    gpu=new GPUtilities();
    GP.setOverwriteOutput(true);
    System.out.println("done.");
     
  

      System.out.print("\n**Executing GP tool...");
      IFeatureClass infeature=gpu.openFeatureClassFromString("D:/#GP/Construct Shapefile/Construct.shp");
   IFeatureClass innearfeature=gpu.openFeatureClassFromString("D:/#GP/Egypt Power Plant/carma_egypt_power_plant_emissions_egypt_20002007future.shp");
   nearanalysis=new Near(infeature,innearfeature);
  
   GP.execute(nearanalysis,null);    
   System.out.println("done.");
  
  } catch (AutomationException e) {
  
   e.printStackTrace();
  } catch (IOException e) {
  
   e.printStackTrace();
  }

   }

the exception interrputs at the GP.execute() line, can anyone please help me with this?

Outcomes