java.lang.Exception - Could not service request error obtained on using arcpy.mp.LayerFile in geoprocessing Tool on ArcGIS Server

1842
1
07-11-2021 01:55 PM
SarthakBhatia1
New Contributor II

I'm using arcpy.mp.LayerFile() to read a .lyrx file to further obtain the symbology object of an active layer in the template lyrx file. This symbology is then used to generate a new lyrx for another file.

Now this script works perfectly fine when used as a geoprocessing Tool in ArcGIS Pro or as a stand-alone script working on Windows Task scheduler but it fails to work as a hosted geoprocessing tool on ArcGIS Server 10.7.

1 Reply
DamianoMontrasio
New Contributor III

I've same issue with :

# Apply the symbology from the symbology layer to the input layer
arcpy.ApplySymbologyFromLayer_management (output, os.path.join(path,mylyr))

I received java.lang.Exception error only in geoprocessing service execution.

DamianoMontrasio_0-1684509473322.png

Work fine in ArcGIS Pro.

Thanks in advance...

0 Kudos