Android SDK queryRelated objects fails with java.io.IOException

3068
4
11-20-2015 11:41 AM
Kevin_FernandoEscalera_Robles
New Contributor III

We have developed an Android App that connects to a Federated ArcGIS Server services using a Web Map., the app does a lot of things, besides charging the web map, and it works on an environment development environment where the web adaptors (of ArcGIS Server and Portal) are directly accesible through Internet.

Now, we have mudated to a production environment where whe have a reverse proxy on top of the servers where the Web Adaptors reside, and the applications fails in the query related data with a generic exception:

6804-6804/com.segip.verificadores E/com.segip.verificadores.view.OnlineEditionMapActivity﹕ Error al ejecutar related query : null

   java.io.IOException

           at java.io.InputStream.reset(InputStream.java:218)

           at com.esri.core.geodatabase.GeodatabaseFeatureServiceTable.a(SourceFile:946)

           at com.esri.core.geodatabase.GeodatabaseFeatureServiceTable.a(SourceFile:113)

           at com.esri.core.geodatabase.GeodatabaseFeatureServiceTable$2.a(SourceFile:2159)

           at com.esri.core.geodatabase.GeodatabaseFeatureServiceTable$2.call(SourceFile:2114)

           at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)

           at java.util.concurrent.FutureTask.run(FutureTask.java:137)

           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)

           at java.lang.Thread.run(Thread.java:856)

The rare part is the it doens't fail when the query ralated objects reieves only 7 or less objectIds, when we pass 8 or more it fails with this exception.

I have reviewed the ArcGIS Server Logs and it seems that the query has been processed just fine in the server, I also tested the related query from Services Directory, and it also Works, it is just when using the Android App, I don't know what else to do. I'm thinking that my Reverse Proxy could be the problem, but all of my services are being used by another web applications through the same Reverse Proxy and it works. My reverse Proxy is an IIS Web Site configured with URL Re Write with rules to my Server where the Web Adaptors are located.

final RelatedQueryParameters relatedQueryParameters = new RelatedQueryParameters();

relatedQueryParameters.setObjectIds(oids);

relatedQueryParameters.setRelationshipId(0);

relatedQueryParameters.setOutFields(new String[]{"estado_verificacion", "objectid"});

relatedQueryParameters.setReturnGeometry(false);

GlobalContext.featureServiceTableDomicilio = new GeodatabaseFeatureServiceTable(SettingContext.FEATURE_SERVER_DOMICILIO, GlobalContext.credentials, 0);

GlobalContext.featureServiceTableDomicilio.initialize(new CallbackListener<GeodatabaseFeatureServiceTable.Status>() {

    @Override

    public void onCallback(GeodatabaseFeatureServiceTable.Status status) {

        GlobalContext.featureServiceTableDomicilio.queryRelated(relatedQueryParameters, new CallbackListener<Map<Long, FeatureResult>>()

            {

                @Override

                public void onCallback(Map<Long, FeatureResult> longFeatureResultMap) {

                ........

                }

                @Override

                public void onError(final Throwable throwable) {

                    runOnUiThread(new Runnable() {

                        @Override

                        public void run() {

                            log.error("Error al ejecutar related query : " + throwable.getMessage(), throwable);

                            ...........

                        }

                    });

                }

            }

        );

    }

    @Override

    public void onError(final Throwable throwable) {

        runOnUiThread(new Runnable() {

            @Override

            public void run() {

                log.error("Erro al cargar datos : " + throwable, throwable);

                .......

            }

        });

    }

});

0 Kudos
4 Replies
EricBader
Regular Contributor II

Hi Kevin,

I can't tell by the code you've provided if you've added any ProxySetup code when you switched to using a proxy server. Can you confirm?

ProxySetup | ArcGIS Android 10.2.7 API

0 Kudos
Kevin_FernandoEscalera_Robles
New Contributor III

Hi Eric,

Thanks for your reply, I'm not using the proxySetUp, but I think it is not the case, as I can see in the Documentation (correct me if I'm wrong), this is for cases when it is necesary to use a Proxy for accesing internet, in my Case I'm using a Reverse Proxy, which are not the same.

0 Kudos
EricBader
Regular Contributor II

Ah...my bad. Sorry.

Reverse proxy should work in the case you described here. I'm wondering, are these other applications you mention...are they also using ArcGIS Android API? Or are they different?

0 Kudos
Kevin_FernandoEscalera_Robles
New Contributor III

Nope, all the other applications are web applications

0 Kudos