jinjingwisc

Error in Running ArcObjects 10 Application

Discussion created by jinjingwisc on Jan 10, 2011
Latest reply on Dec 11, 2016 by digz6666
We installed the ArcGIS 10 development kit for Java and installed the Eclipse ArcObjects plug-in using the update_site folder in %AGSDEVKITJAVA%\java\tools\eclipse_plugin\arcgis_update_site.

The installation is successful. Although, on the edn site, since everything in the Eclipse plugin doc for ArcObjects 10 are in fact for 9.3 plug-ins (http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/index.html#/Installing_ESRI_Plug_ins/0001000003v8000000/) and most of them do not make any sense for the new 10 plugins, we may have missed certain steps.

When we create an ArcObject project using the default ArcObject project wizard and run the automatically generated "Console.java" program. The following error messages are returned.

We did some google of this error and found the following links (some links are not listed since they are pointing to the same URL.).
http://forums.esri.com/Thread.asp?c=159&f=2267&t=257457#789809
http://resources.arcgis.com/content/kbase?fa=articleShow&d=29348

But they are all about this error in the old versions (9.3 and prior) and none of them really works.


====================================================================
Could not load native libraries.
java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.esri.arcgis.interop.NativeLoader.loadLibrary(Unknown Source)
at com.esri.arcgis.system.EngineInitializer.initializeEngine(Unknown Source)
at Console.main(Console.java:45)
java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
Could not load native libraries.
java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.esri.arcgis.interop.NativeLoader.loadLibrary(Unknown Source)
at com.esri.arcgis.interop.NativeObjRef.p(Unknown Source)
at com.esri.arcgis.interop.Dispatch.a(Unknown Source)
at com.esri.arcgis.interop.Dispatch.isNativeMode(Unknown Source)
at com.esri.arcgis.interop.Dispatch.createDispatch(Unknown Source)
at com.esri.arcgis.interop.Dispatch.<init>(Unknown Source)
at com.esri.arcgis.version.IArcGISVersionProxy.<init>(Unknown Source)
at com.esri.arcgis.version.VersionManager.<init>(Unknown Source)
at com.esri.arcgis.version.VersionManager.<init>(Unknown Source)
at com.esri.arcgis.system.EngineInitializer.c(Unknown Source)
at com.esri.arcgis.system.EngineInitializer.initializeEngine(Unknown Source)
at Console.main(Console.java:45)
java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
java.lang.RuntimeException: Failed to initialize native code invocation: null
at com.esri.arcgis.interop.NativeObjRef.p(Unknown Source)
at com.esri.arcgis.interop.Dispatch.a(Unknown Source)
at com.esri.arcgis.interop.Dispatch.isNativeMode(Unknown Source)
at com.esri.arcgis.interop.Dispatch.createDispatch(Unknown Source)
at com.esri.arcgis.interop.Dispatch.<init>(Unknown Source)
at com.esri.arcgis.version.IArcGISVersionProxy.<init>(Unknown Source)
at com.esri.arcgis.version.VersionManager.<init>(Unknown Source)
at com.esri.arcgis.version.VersionManager.<init>(Unknown Source)
at com.esri.arcgis.system.EngineInitializer.c(Unknown Source)
at com.esri.arcgis.system.EngineInitializer.initializeEngine(Unknown Source)
at Console.main(Console.java:45)
Exception in thread "main" java.lang.RuntimeException: Can not use native code: Initialisation failed
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.version.IArcGISVersionProxy.<init>(Unknown Source)
at com.esri.arcgis.version.VersionManager.<init>(Unknown Source)
at com.esri.arcgis.version.VersionManager.<init>(Unknown Source)
at com.esri.arcgis.system.EngineInitializer.c(Unknown Source)
at com.esri.arcgis.system.EngineInitializer.initializeEngine(Unknown Source)
at Console.main(Console.java:45)

Console.java:
public class Console {

public static void main(String[] args) {
  EngineInitializer.initializeEngine();
  initializeArcGISLicenses();
}

static void initializeArcGISLicenses() {
  try {
   com.esri.arcgis.system.AoInitialize ao = new com.esri.arcgis.system.AoInitialize();
   if (ao.isProductCodeAvailable(com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeEngine) == com.esri.arcgis.system.esriLicenseStatus.esriLicenseAvailable)
    ao.initialize(com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeEngine);
  } catch (Exception e) {
   e.printStackTrace();
  }
}
}

Outcomes