PROBLEM

A java.lang.string class error is returned when editing a service's item information in the ArcGIS Server Administrator Directory

Last Published: April 27, 2023

Description

In the ArcGIS Server Administrator Directory, users with sufficient privileges can edit the service's item information when required. However, in some cases, when attempting to update a service's item information, the following error message is returned:

Error:   
class java.lang.String cannot be cast to class com.esri.arcgis.discovery.json.JSONArray (java.lang.String is in module java.base of loader ’bootstrap'; com.esri.arcgis.discovery.json.JSONArray is in unnamed module of loader java.net.URLClassLoader @ <location>)

The error message when the JSON output format is selected.

The error message after attempting to update a service's item information.

The error message when the HTML output format is selected.

The error message after attempting to update a service's item information.

While the changes are updated to the service's item information despite the error message, it is possible for this error to affect other operations performed on the service, such as running the exportSite operation and creating backups of an ArcGIS Enterprise deployment through the webgisdr utility.

Cause

The "tags" property values are not stored in an array in the service's item information JSON. For example, an error message is returned when the "tags" property values are identified as a single long string value surrounded by double quotation marks, as shown below.

"tags": "Test123, Test, March",
The Edit Service Item Info section and the tags property in the incorrect JSON format.

Solution or Workaround

Format the "tags" property values in the correct JSON structure to resolve the issue.

  1. In the ArcGIS Server Administrator Directory, browse to the Edit Item Information page following the URL format provided.
https://<root>/services/<serviceName.serviceType>/iteminfo/edit
  1. On the Edit Item Information page, in the Item Information (in JSON format):* section, edit the values in the "tags" property to the correct JSON structure as stated below. The correct structure includes the comma-separated list of string values in an array surrounded by square brackets, [ and ].
"tags": [
    "<tag1>",
    "<tag2>",
    "<tag3>"
],

In this example, the "tags" property is edited to the correct JSON structure where the array stores three string values.

"tags": [
    "Test123",
    "Test",
    "March"
],
The Edit Service Item Info section and the tags property in the correct JSON format.
  1. Click Update to save the edits.

Article ID: 000026607

Software:
  • ArcGIS Server

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options