Error 500 from geometry service

4638
4
07-31-2013 02:44 PM
JayDub
by
New Contributor
Hi all,
I'm getting a 500 from the ESRI server's Geometry Service when I try to send a request to calculate the area. When I use Python code (requests library) to send the data, I get a 500 "Error computing areas and lengths". When I try to do a manual POST it works. I'm not sure how to reproduce this problem though. So my question essentially is, how do you get a 500 from the Geometry Service? I'm using 10.1.
0 Kudos
4 Replies
JayDub
by
New Contributor
The logs also gave me this error:
Internal Server Error. Error handling service request: Could not find a service with JNDI name 'esri/services/GeometryServer/Geometry' in the configured clusters. Service may be stopped or ArcGIS Server may not be running.

I also tried it with ESRI's sampleserver1 and got the same 500 so I don't think my server is the problem.
0 Kudos
AnnetteLocke
Esri Contributor
Can you post the full request that you are sending to the server?
0 Kudos
JayDub
by
New Contributor
I made a  POST request to http://server/arcgis/rest/services/Geometry/GeometryServer/areasAndLengths? with params (printed JSON style):
{'unitArea': 'esriSquareKilometers', 'inSR': 4326, 'sr': 4326, 'polygons': [{'rings': [[[624737.102378421, 674507.7128967925], [624703.1198332242, 674516.8809703351], [624678.3579736749, 674517.3108766628], [624628.0791328182, 674515.7126848222], [624577.8062321072, 674511.9558324739], [624553.0249462423, 674508.4671935294], [624528.6658106777, 674503.4727325841], [624504.8096018442, 674496.8065548505], [624481.2399919124, 674489.0636258594], [624434.7010280173, 674471.2469288022], [624296.6095075295, 674411.0486390791], [624249.8429077414, 674392.9975878554], [624174.8606508622, 674360.5509152239], [624149.8483882523, 674351.0162198526], [624125.7201276066, 674344.2252632563], [624103.0174248881, 674341.44737241], [624082.2761587613, 674343.9460022575], [624064.7174595818, 674354.6575938597], [624050.1560315224, 674373.2909675441], [624037.260138437, 674396.8217875691], [624024.7008604492, 674422.2257040791], [624011.1435935851, 674446.472500553], [623995.2594895436, 674466.5496456951], [623976.3535060093, 674482.7746448402], [623955.1449854912, 674496.8557094015], [623932.487549421, 674508.5599670123], [623909.2377319265, 674517.6692887793], [623885.3433296183, 674524.4054985167], [623860.5141640035, 674529.2872659322], [623835.2566122548, 674532.5032915722], [623810.0912001948, 674534.2480887137], [623785.5431102891, 674534.5625742475], [623763.0311536252, 674523.6863148771], [623740.7403635175, 674511.6598825476], [623627.4795980266, 674458.0662032078], [623583.9825736773, 674433.7586169936], [623563.1685434177, 674420.1311205938], [623543.0501935505, 674405.4153550249], [623445.994321507, 674326.1676019053], [623425.8807265006, 674311.3426603249], [623363.8456992453, 674268.5031316064], [623321.5504220851, 674241.1732057488], [623299.9380392397, 674228.5315922629], [623277.9283450139, 674216.8641556079], [623255.4635090185, 674206.3927569323], [623232.4658135396, 674197.3187141769], [623208.9121703702, 674189.5624434436], [623160.5624805916, 674177.0170762428], [623061.9462739243, 674156.6700486378], [622915.9572576231, 674121.7377045469], [622842.7641096178, 674105.4411974332], [622793.6627189713, 674096.2947743903], [622694.2343320857, 674084.8645088528], [622669.5693866448, 674080.7425645113], [622591.3764758058, 674070.7785205183], [622567.0143672656, 674064.6229717535], [622545.463610509, 674054.6219027401], [622527.4826991849, 674039.801741851], [622511.2341682597, 674022.3065966967], [622496.1756665751, 674002.9314327925], [622482.1319139139, 673982.0642495903], [622468.9332560182, 673960.0900574647], [622456.398769853, 673937.3968937375], [622421.049981957, 673868.859815256], [622411.7258490853, 673846.4027230933], [622414.0959531623, 673820.7126426708], [622393.6814705118, 673800.2981155802], [622427.4238607121, 674430.7346667841], [623093.208691542, 674801.6406906551], [623716.3647894118, 674813.9181460697], [623716.2944953864, 674809.6631010418], [623716.9522747253, 674781.64823447], [623720.0458727636, 674755.4338718368], [623726.8831027871, 674732.9518129734], [623738.7744669191, 674716.1131717042], [623757.5337275441, 674704.3422295667], [623781.9901260049, 674696.3914522016], [623809.6448599496, 674692.0761249566], [623837.9878522314, 674691.2145475216], [623864.514649832, 674693.6220163811], [623887.033752626, 674699.5045713398], [623907.1719652176, 674712.1297351819], [623925.629780152, 674730.2762999242], [623942.3855223957, 674751.4519420058], [623970.8608605497, 674794.0334948432], [623983.317716217, 674815.5439275162], [623985.2541851108, 674819.2219406321], [624527.706811122, 674829.9329516165], [624825.5482438056, 674577.3451217368], [624819.8354885612, 674572.4137772946], [624756.5039245205, 674524.3599134908], [624737.102378421, 674507.7128967925]]], 'spatialReference': {'wkid': 4326}}, {'rings': [[[622386.9646295855, 673674.806227139], [622408.3993862743, 673674.7638415402], [622433.4885441746, 673676.3282275016], [622457.9672844755, 673679.9401924938], [622481.7551198243, 673685.8099309339], [622505.2825503829, 673693.3026684335], [622528.5873537716, 673702.1523753325], [622551.651191563, 673712.1435903443], [622597.0276620126, 673734.6706876365], [622663.0295802618, 673771.5816338747], [622684.2579235788, 673784.9190249491], [622725.4102074049, 673814.5732068948], [622825.7178164157, 673893.923265717], [622846.2010372757, 673908.5975341029], [622867.0784448811, 673922.2622455643], [622888.4556180175, 673934.6597932418], [622910.4437233815, 673945.5236750797], [622933.1455389655, 673954.5992565388], [622956.663939746, 673961.6466687092], [623004.4813970585, 673973.8346956962], [623076.6371075853, 673991.1278235413], [623173.5786480741, 674012.4927777632], [623246.7739102518, 674027.3611806264], [623344.9268216051, 674045.8221141144], [623443.6126661402, 674062.9275577199], [623542.717145672, 674078.8938362249], [623667.01622315, 674097.5864833111], [623791.5681757014, 674115.2653604096], [624214.0069974023, 674173.0377658441], [624238.8514068106, 674175.2911573999], [624288.7257359553, 674177.921597385], [624489.1040059677, 674179.712438125], [624503.5016099622, 674105.3988687046], [624506.9365803006, 674080.7476478058], [624507.9514772148, 674056.3156807466], [624500.0905132808, 674032.7821568081], [624490.434199264, 674009.1892506361], [624486.5571045027, 673984.5995909754], [624482.2254379163, 673934.8461339144], [624426.1019799834, 673922.5098293921], [624216.9999671963, 673892.5080524479], [623977.3973705921, 673816.0093251087], [623801.599741631, 673744.4155666642], [623502.3963860553, 673680.803946687], [623125.9962688986, 673640.9137515769], [623046.8008378568, 673622.8036922908], [622936.8949516687, 673578.0074531202], [622831.4950426596, 673522.2116770743], [622692.9945214688, 673479.5070118022], [622394.19886963, 673367.4130773579], [622369.9043650574, 673356.0728324337], [622386.9646295855, 673674.806227139]]], 'spatialReference': {'wkid': 4326}}], 'f': 'json'}
0 Kudos
JayDub
by
New Contributor
I found out part of my problem. Part of the problem was that Python was not encoding the URL parameter properly, so the resulting POST data had several "polygons" parameters. Note to Pythonistas, careful when encoding a list using urllib.urlencode. If you don't want Python to mess it up, convert the input to a string using json.dumps.

I was able to get around that, there's a follow up question though, was there a change to the REST services Geometry API? This works fine on 10.01.
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/areasAndLengths?s...[{%22rings%22%20:%20[[[-628833.344099998,206205.236200001],[-630269.659900002,192298.906100001],[-631848.233800001,173991.394400001],[-616471.690300003,341822.557500001],[-620213.661300004,301450.162799999],[-625923.431999996,237538.0579],[-628833.344099998,206205.236200001]]]}%20]&lengthUnit=9035&areaUnit={%22areaUnit%22%20:%20%22esriAcres%22}

But NOT on 10.1 (Java). I have a 10.1 Java server, when I try it I get...
Error computing areas and lengths
0 Kudos