<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: linux  arcengine for java   openFeatureClass(Unknown Source) in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/linux-nbsp-arcengine-for-java-nbsp-nbsp/m-p/404547#M10808</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you call EngineInitializer.initializeEngine() anywhere? You need to call this before you do AoInitialize.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 Mar 2011 05:10:43 GMT</pubDate>
    <dc:creator>EricBader</dc:creator>
    <dc:date>2011-03-26T05:10:43Z</dc:date>
    <item>
      <title>linux  arcengine for java   openFeatureClass(Unknown Source)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/linux-nbsp-arcengine-for-java-nbsp-nbsp/m-p/404546#M10807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I use arcengine for java in linux operation. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The exception I got was "AutomationException: 0x80004005 - Unspecified error".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My product version is arcengine 9.3 java for linux.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;error in &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;at com.esri.arcgis.geodatabase.Workspace.openFeatureClass(Unknown Source)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; String workspacePath = arcGISHome + "/java/samples/data/usa";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; String featureClassName = "states.shp";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File shapefileFile = new File(workspacePath, featureClassName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if (!shapefileFile.exists()) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; System.out.println("Shapefile " + shapefileFile.getAbsolutePath() + " doesn't exist. Exiting.");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; System.exit(-1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; System.out.println("Shapefile: " + shapefileFile.getAbsolutePath());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; AoInitialize aoInitializer = new AoInitialize();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; aoInitializer.initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ShapefileWorkspaceFactory shapefileWorkspaceFactory = new ShapefileWorkspaceFactory();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Workspace workspace = new Workspace(shapefileWorkspaceFactory.openFromFile(workspacePath, 0));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FeatureClass featureClass = new FeatureClass(workspace.openFeatureClass(featureClassName)); int numFeatures = featureClass.featureCount(null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; System.out.println("There are " + numFeatures + " features:");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; for (int i = 0; i &amp;lt; numFeatures; i++){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IFeature feature = featureClass.getFeature(i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; IGeometry geometry = feature.getShapeCopy();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; System.out.println("Feature " + i + ": ");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; System.out.println(getStringFromShape(geometry));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if (i &amp;gt;= 9) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break; // 10 is enough&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; aoInitializer.shutdown();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; System.out.println("Sample finished.");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } catch (Exception e) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; e.printStackTrace();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;why use workspace.openFeatureClass in some errors,the shapefile's path and name is correct .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any solution or workaround this? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much in advance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Mar 2011 02:51:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/linux-nbsp-arcengine-for-java-nbsp-nbsp/m-p/404546#M10807</guid>
      <dc:creator>zhuxiaochen</dc:creator>
      <dc:date>2011-03-26T02:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: linux  arcengine for java   openFeatureClass(Unknown Source)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/linux-nbsp-arcengine-for-java-nbsp-nbsp/m-p/404547#M10808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you call EngineInitializer.initializeEngine() anywhere? You need to call this before you do AoInitialize.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Mar 2011 05:10:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/linux-nbsp-arcengine-for-java-nbsp-nbsp/m-p/404547#M10808</guid>
      <dc:creator>EricBader</dc:creator>
      <dc:date>2011-03-26T05:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: linux  arcengine for java   openFeatureClass(Unknown Source)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/linux-nbsp-arcengine-for-java-nbsp-nbsp/m-p/404548#M10809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Hello!&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;Do you call EngineInitializer.initializeEngine() anywhere? You need to call this before you do AoInitialize.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks very much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I add EngineInitializer.initializeEngine() into the front of AoInitialize ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but the same error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;String workspacePath = arcGISHome + "/java/samples/data/usa";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String featureClassName = "states.shp";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File shapefileFile = new File(workspacePath, featureClassName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!shapefileFile.exists()) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.out.println("Shapefile " + shapefileFile.getAbsolutePath() + " doesn't exist. Exiting.");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.exit(-1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.out.println("Shapefile: " + shapefileFile.getAbsolutePath());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;EngineInitializer.initializeEngine() ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AoInitialize aoInitializer = new AoInitialize();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aoInitializer.initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ShapefileWorkspaceFactory shapefileWorkspaceFactory = new ShapefileWorkspaceFactory();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Workspace workspace = new Workspace(shapefileWorkspaceFactory.openFromFile(workspacePath, 0));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FeatureClass featureClass = &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;new FeatureClass(workspace.openFeatureClass(featureClassName)); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;int numFeatures = featureClass.featureCount(null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.out.println("There are " + numFeatures + " features:");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for (int i = 0; i &amp;lt; numFeatures; i++){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeature feature = featureClass.getFeature(i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IGeometry geometry = feature.getShapeCopy();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.out.println("Feature " + i + ": ");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.out.println(getStringFromShape(geometry));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (i &amp;gt;= 9) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;break; // 10 is enough&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aoInitializer.shutdown();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.out.println("Sample finished.");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} catch (Exception e) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;e.printStackTrace();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"AutomationException: 0x80004005 - Unspecified error".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;at com.esri.arcgis.geodatabase.Workspace.openFeatureClass(Unknown Source)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Mar 2011 07:42:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/linux-nbsp-arcengine-for-java-nbsp-nbsp/m-p/404548#M10809</guid>
      <dc:creator>zhuxiaochen</dc:creator>
      <dc:date>2011-03-26T07:42:05Z</dc:date>
    </item>
  </channel>
</rss>

