Select to view content in your preferred language

Runtime deployment help needed

3866
3
03-27-2014 12:53 PM
JayPhiloon1
Occasional Contributor
I have an app built with the eclipse 10.1.1 java runtime sdk.  The sdk client components are used to access an arcgis server.  I use the Geoprocessor and GPTaskInfo objects, etc.  I need to generate a stand-alone war file.  To this end, I have generated a deployment folder with "Client Core" and "Local Server" capabilities (no selected deployment options) and have added it to the application, in the Libraries section.  I have an ArcGISRuntime.setLicense() call in my code with a test license.

To test, I renamed the ARCGISRUNTIMEJAVASDK10_1_1 environment variable and ran the war on the development box (I need to, for other reasons).  The first call through the Geoprocessor object to the server results in this:

C:\apache-tomcat-7.0.26\bin
Failed to read environment variable ARCGISRUNTIMESDKJAVA_10_1_1
        at com.esri.runtime.ArcGISRuntime.getInstallDirectory(Unknown Source)
        at com.esri.runtime.ArcGISRuntime.a(Unknown Source)
        at com.esri.runtime.ArcGISRuntime.getClientLibPath(Unknown Source)
        at com.esri.runtime.ArcGISRuntime.initialize(Unknown Source)
        at com.esri.core.tasks.ags.geoprocessing.Geoprocessor.<clinit>(Unknown Source)

Apparently the app is still looking for an installed runtime sdk.  Does this mean
- I am not picking up the deployment folder dlls, etc?
- I need to remove some runtime sdk artifact from the build?
- Or what?

If the eclipse project/build needs to be modified, please provide details.  Thanks.
0 Kudos
3 Replies
MarkBaird
Esri Regular Contributor
When you run your executable jar is will be looking for an runtime deployment.  It will expect to find this in a ArcGISRuntime10.x. directory which is in the same place as the jar file.  Failing that it will use the environment variable to seek out the install location (this is usally what happens on the development platform).  If it can't find either then it gives up and throws an error.  This what you are seeing.

There is an application in the SDK which helps you to create deployments.

Does this help?

Mark
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
C:\apache-tomcat-7.0.26\bin
Failed to read environment variable ARCGISRUNTIMESDKJAVA_10_1_1
        at com.esri.runtime.ArcGISRuntime.getInstallDirectory(Unknown Source)
        at com.esri.runtime.ArcGISRuntime.a(Unknown Source)
        at com.esri.runtime.ArcGISRuntime.getClientLibPath(Unknown Source)
        at com.esri.runtime.ArcGISRuntime.initialize(Unknown Source)
        at com.esri.core.tasks.ags.geoprocessing.Geoprocessor.<clinit>(Unknown Source)

Apparently the app is still looking for an installed runtime sdk.  Does this mean
- I am not picking up the deployment folder dlls, etc?
- I need to remove some runtime sdk artifact from the build?


Your observations are correct. ArcGISRuntime is going to look for its installed directory in two places: where it has been installed, or when it has been told to look, where its default is the former if its not told. To tell it to look at your deployment folder, you must set its installed directory before it, or any other component like your Geoprocessor, inquire if it has been initialized. I've found that it's best to tell it which deployment folder to use and have it initialize itself afterwards to ensure there wouldn't be future problems (the folder is OK, licensed valid, etc). However, you won't find out if you have enough components in your deployment folder until your app asks for such functionality. For this reason, I have always enable the full set of packages and not guess at what might eventually be missing later, such as in production. It supports long-term future developments.

Hope this helps.
0 Kudos
CarlosColón-Maldonado
Frequent Contributor
I might add that, in the case you installed ArcGIS RT without administrative privileges, the environment variable may not have been set. You can alternatively set it manually. In Windows, this can be done via system properties (see pic). In Linux, follow the instructions to "Set ArcGIS Runtime SDK for Java environment variables" here.
0 Kudos