Select to view content in your preferred language

Display of packages from different sources

3491
7
09-24-2012 06:49 AM
JFr
by
Emerging Contributor
Hello,
as I tried to display a local saved Map Package and a tile Package from ArcGISOnline in a single JMap, the following problem occured:
the tile package is loaded correctly, but at the attempt to display the map package a com.esri.core.io.EsriServiceException is thrown (complete exception output below). A proxy server is used to access ArcGISOnline (based on this code snippet: http://forums.arcgis.com/threads/58786-Proxy-settings?p=206983&viewfull=1#post206983). The exclusive display of local data or online data works without difficulties, but data from different sources aren't displayed.
Here is the code where the proxy settings are set and the packages are added:
String proxyHost = "myproxy.domain.com";
int proxyPort = 8080;

try 
{
       ProxySetup.setupProxy(proxyHost, proxyPort);
}
catch (Exception e) 
{
       // TODO Auto-generated catch block
       e.printStackTrace();
}
        
ArcGISTiledMapServiceLayer tiledLayer = new ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
map.getLayers().add(tiledLayer);

ArcGISLocalDynamicMapServiceLayer waternetwork = new ArcGISLocalDynamicMapServiceLayer("...\\OperationalLayers.mpk");
map.getLayers().add(waternetwork);


The complete thrown exception:
com.esri.core.io.EsriServiceException: Service Unavailable
 at com.esri.core.internal.a.a.b.a(Unknown Source)
 at com.esri.core.internal.a.a.e$1.handleResponse(Unknown Source)
 at com.esri.core.internal.a.a.e$1.handleResponse(Unknown Source)
 at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:735)
 at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:709)
 at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:700)
 at com.esri.core.internal.a.a.e.a(Unknown Source)
 at com.esri.core.internal.a.a.e.a(Unknown Source)
 at com.esri.client.local.LocalMapService.completeStart(Unknown Source)
 at com.esri.client.local.LocalService.a(Unknown Source)
 at com.esri.client.local.LocalService$a.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
com.esri.core.io.EsriServiceException: Service Unavailable
 at com.esri.core.internal.a.a.b.a(Unknown Source)
 at com.esri.core.internal.a.a.e$1.handleResponse(Unknown Source)
 at com.esri.core.internal.a.a.e$1.handleResponse(Unknown Source)
 at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:735)
 at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:709)
 at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:700)
 at com.esri.core.internal.a.a.e.a(Unknown Source)
 at com.esri.core.internal.a.a.e.a(Unknown Source)
 at com.esri.map.Layer.getMapServerInfo(Unknown Source)
 at com.esri.map.ArcGISDynamicMapServiceLayer$1.run(Unknown Source)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)


Is there a way to display data from both sources (local and online) correctly (or am I missing something) ?
0 Kudos
7 Replies
EricBader
Honored Contributor
This should work, provided that "myproxy.domain.com" is an actual hostname in your organization. ?
I doubt that it is.

Do you have an actual proxy server running? If not, you do not need to do a ProxySetup and you should be good to go.

Maybe I missed something here. I apologize. Just let me know.
0 Kudos
JFr
by
Emerging Contributor
First of all, thanks for your answer.
The string "myproxy.domain.com" is just a place holder for the posted code snippet, the hostname is actual represented by an IP Address. A Proxy Server is running, that's why the ProxySetup is necessary. Without the ProxySetup, an access to ArcGIS Online isn't possible and a package from this online source isn't displayed in the JMap.
0 Kudos
JFr
by
Emerging Contributor
This problem still exists unchanged. I don't know for sure what could cause this difficulty. I guess that the need of defining the proxy server configurations induces this, but it's only a speculation.
Any help would be still greatly appreciated.

J.
0 Kudos
EricBader
Honored Contributor
Ok. Yes, I can confirm that this seems to be a bug we are trying to track down.
Apologies for the delayed response to this.
0 Kudos
JFr
by
Emerging Contributor
Thank you for your response. At least I know that the problem doesn't result from inaccurate data or something else erroneous at my side.
0 Kudos
JFr
by
Emerging Contributor
Hello,
has this problem a NIM-Number already ? Which severity has this bug (if it's categorized) ?

Regards,
J.
0 Kudos
VijayGandhi
Deactivated User
Hi J,

The ProxySetup has been fixed in the latest release (version 10.1.1).

Also, in your snippet, the path to .MPK file ("...\\OperationalLayers.mpk") doesn't seem to be valid. The following code could help in verification.

ArcGISLocalDynamicMapServiceLayer dynamicLayer = ...
dynamicLayer.addLayerInitializeCompleteListener(new LayerInitializeCompleteListener() {
@Override
public void layerInitializeComplete(LayerInitializeCompleteEvent e) {
  System.out.println(e.getLayer().getStatus());
  System.out.println(e.getLayer().getInitializationError());
}
});


Thanks,
VJ
0 Kudos