using arcgis engine runtime 10 to run program causes errors

05-31-2011 07:49 AM
New Contributor

i am hoping that someone can give some insight as to why runtime is giving me errors when i run my own java written program with arcObjects.

the program is bundled in a executable jar file..i go to my terminal in linux(Centos 5) i source the file and then i run the jar file ("java -jar MainWindow.jar")

i get alot of errors including...

Caused by: java.lang.RuntimeException: Can not use native code: Initialisation failed
at com.esri.arcgis.interop.NativeObjRef.<init>(Unknown Source)
at com.esri.arcgis.interop.Ocx.<init>(Unknown Source)
at com.esri.arcgis.controls.ToolbarControl.<init>(Unknown Source)
at com.esri.arcgis.beans.toolbar.ToolbarBean.a(Unknown Source)
at com.esri.arcgis.beans.toolbar.ToolbarBean.<init>(Unknown Source)
at com.aor.mapping.Map.<init>(
at com.aor.seasimgui.MainWindow.<init>(
at com.aor.seasimgui.MainWindow.main(
at com.aor.testing.nhieu.Bootstrapper.main(

or these errors as well

java.lang.IllegalArgumentException: URI is not hierarchical
at com.esri.arcgis.interop.NativeLoader.getArcGISHome(Unknown Source)
at com.esri.arcgis.interop.NativeLoader.loadLibrary(Unknown Source)
at com.esri.arcgis.system.EngineInitializer.initializeVisualBeans(Unknown Source)
at com.aor.math.Compute.initializeArcGISLicenses(
at com.aor.seasimgui.MainWindow.main(
at com.aor.testing.nhieu.Bootstrapper.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(

i wasnt able to find much on the internet as to how to fix this problem, im hoping some one out there has encountered this problem before and would like to help another person out. Thanks in advanced for any help or comments that people took time to write. any info will help
0 Kudos
1 Reply
Regular Contributor II
Sounds like the license was not properly initialized or a problem with binding to the product.  ArcGIS 10 has new binding to the product requirements as well as initializing a license.  If you don't do both those things before calls to ArcObjects components you will get initialization errors.
0 Kudos