The deployment and code of the Java EE background call to ArcGIS Engine (AE)

Source: Internet
Author: User

The BS development solution for ArcGIS has always been a pit, and the main push map service query is slow, needs to be asynchronous, and less functional. In contrast, the AE function, mainly for CS, is more powerful and comprehensive, but the deployment is somewhat complex

The software environment of this article:

Win7 SP1 64-bit

MyEclipse 10,JDK 1.6.45 32-bit, Tomcat 6.0.41 32-bit, ArcGIS Desktop 10.0 (or ArcGIS Engine)

1.1.1. Installing the Software

ArcGIS Desktop or ArcGIS Engine Runtime

Recommended to install desktop, because the AE runtime installation files are not easy to find, in addition to desktop function is also powerful, this article also take desktop as an example

1.1.2. Arcobjects.jar

Arcobjects.jar is the jar package of AO, to put this file in the Lib folder of our code

1.1.2.1. Arcobjects.jar Extraction Instructions:

Arcobjects.jar is an AO jar package that is available in both the desktop and engine runtime (but not the AO SDK)

In our system, with desktop, this jar is java\lib under the desktop installation directory, for example my D:\Program Files (x86) \arcgis\desktop10.0\java\lib

1.1.3. VM arguments configuration 1.1.3.1. Development environment Eclipse Configuration

This configuration is valid when developing debugging

Open Window>preferences

In the input bin path for ArcGIS Desktop:

-djava.library.path= "D:\Program Files (x86) \arcgis\desktop10.0\bin"

This path may be different for each machine

1.1.3.2. Running Environment Tomcat Configuration

This configuration is valid when you double-click Run Startup.bat to start Tomcat

Open Tomcat\bin's Catalina.bat, in

Set "current_dir=%cd%"

Insert a row below

Bin path for ArcGIS Desktop:

-djava.library.path= "D:\Program Files (x86) \arcgis\desktop10.0\bin"

This path may be different for each machine

Hello World

Here is a simple code, connected to the SDE and the layer query, and C # tuning AE is not very different, here is the key class Aoinitutil

The following is the Initializeengine function of the class Aoinitutil

The two parameters of the function in line 11th are the environment in which the current program is configured, that is, you can install different versions of ArcGIS in the team (but believe that it is limited to 10.x)

1      Publicaoinitialize initializeengine (aoinitialize aoinit) {2         Try {3 engineinitializer.initializeengine ();4 5             //set up ArcGIS products and versions to use to enable AO to run in different ArcGIS environments6             //the following line of code will be an error, but VersionManager again before the Aoinitialize instantiation run, and this error does not affect the code to run, so temporarily regardless of7VersionManager VersionManager =NewVersionManager ();8             //The first parameter is ArcGIS Product code: 1=desktop,2=engine,5=server9             //This parameter can be viewed by enumerating the EsriproductcodeTen             //versionmanager.loadversion (1, "10.0"); One versionmanager.loadversion (Integer.parseint (configproperties A. Getbykey ("Aoruntimeproduct")), Configproperties -. Getbykey ("Aoruntimeversion")); -  theAoinit =Newaoinitialize (); -             //Although there are engine and arcinfo two kinds of products, but only the engine in this system can be used, ArcInfo will be wrong -             if(Aoinit -. isproductcodeavailable (esrilicenseproductcode.esrilicenseproductcodeengine) = =esrilicensestatus.esrilicenseavailable) + aoinit.initialize (esrilicenseproductcode.esrilicenseproductcodeengine); -             Else if(Aoinit +. isproductcodeavailable (com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeArcInfo) = =com.esri.arcgis.system.esriLicenseStatus.esriLicenseAvailable) A aoinit.initialize (com.esri.arcgis.system.esriLicenseProductCode.esriLicenseProductCodeArcInfo); at  -             returnAoinit; -}Catch(Exception e) { - e.printstacktrace (); -             returnAoinit; -         } in}

Something:

PS: either Java or. NET version of AE, its jar or DLL is just an intermediary, AE's core ao is COM, out of the question can go to the COM side to think

PS2: Do not know the reason is Java or BS, than we c#+winform with AE or more stable

The deployment and code of the Java EE background call to ArcGIS Engine (AE)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.