Write in front:
A period of time testing the common Java Engineering call Arcobject 10.5 (hereinafter referred to as AO) function, mainly in the program calls the custom Arctoolbox model, complete some functions, when the function is converted to Web engineering, there are some problems, now the solution is recorded, for future inspection.
1. Development environment:
ArcGIS 10.5,myeclipse, JDK 1.8 32-bit, Tomcat 8.5 32-bit, spring, spring mvc 4.3, etc.
Environment installation and configuration, in some not to repeat.
The knowledge of AO development is not in the details.
2, problem description
Before the problem is resolved, the Web request calls the AO feature, which appears as shown in the exception.
The reason for this exception is that the code that involves AO in the program cannot find the ArcGIS environment.
3, the way to solve
There are 2 scenarios in this section, one for the Tomcat configuration in the IDE environment when code is developed, and one to deploy the developed program to the runtime configuration in Tomcat.
In this article, it is assumed that the ArcGIS Desktop installation path is: C:\Program Files (x86) \arcgis
First of all, configure the Arcobject environment in the IDE:
Select MyEclipse Menu Windows-Preferences, choose Tomcat on the left servers, configure the appropriate Tomcat paths environment, as follows:
In the second case, configure the Tomcat runtime environment:
Follow Tomcat's Java environment Configuration instructions, create a new SetEnv.bat script file, place it in the Tomcat Bin directory, and configure the path in the file as follows:
Set java_opts= "-djava.library.path=c:/program Files (x86)/arcgis/desktop10.5/java/lib; C:/Program Files (x86)/arcgis/desktop10.5/bin; "
4. End
After configuring the IDE and Tomcat ArcGIS environment as described above, in general, as long as you develop the AO program is not a problem, after changing it to Web engineering background, there will be no problem, I wish the parents test success.
Java background invoke custom Arctoolbox (the developed program is put into the Tomcat container to run)