Has anyone come across this Error: "com.esri.arcgisruntime.io.JsonEmbeddedException: Failed to execute query."

651
1
07-01-2022 03:11 AM
VijayJain
New Contributor

I am trying to ServiceFeatureTables with QueryParameters, that contains a whereClause, but the Query execution fails every time with this error. 

com.esri.arcgisruntime.io.JsonEmbeddedException: Failed to execute query.

I Have tried executing the query in arcs web client and iOS, it seems to be working fine but whenever I try to execute the same in android it fails and throws the exception. 

Can anyone tell me what am I doing wrong?

Code snippet: 

table.loadAsync()
val queryParameters = QueryParameters()
queryParameters.whereClause = whereClause
table.addDoneLoadingListener {
if (table.loadStatus == LOADED){
val queryResult: ListenableFuture<FeatureQueryResult> =
table.queryFeaturesAsync(queryParameters, LOAD_ALL)
queryResult.addDoneListener{
try{
val result = queryResult.get()
val resultIterator = result.iterator()
if (resultIterator.hasNext()) {
resultIterator.next().run {
featuresList.add(this)
}
}
}catch (e: Exception){
e.printStackTrace()
}
}
}
}
Tags (1)
0 Kudos
1 Reply
RamaChintapalli
Esri Contributor

Hi,
The exception seems to suggest the service failed to execute the query. So do you see the query working at the REST end point of the service?. You can also compare the network requests and check if the request params from the web app or iOS app match the android app using Charles or Fiddler. Runtime iOS and Android use the same underlying cpp code that trigger the query requests, so ideally we expect them to match.

Otherwise, you can also try replicating the where clause with a sample service as this one and provide the details.
https://sampleserver6.arcgisonline.com/arcgis/rest/services/Sync/WildfireSync/FeatureServer/0/query

Thanks
Rama

0 Kudos