Unable to use Javascript preview service in server Manager

1932
5
Jump to solution
03-19-2019 03:23 PM
ClintonBallandis1
Occasional Contributor

Hi,

I've just upgraded our enterprise from 10.5 to 10.6.1.

When I go into the Server manager and try and view the service using ArcGIS Javascript API the window is blank. I can view the service ok through Portal.

I found the following thread that suggest the service directory may be corrupt and have checked our configuration (refer to below). 

REST - ArcGIS Javascript Preview not Working after upgrade to 10.4.1 

 In the developer console I'm getting the following error indicating that these files cant be loaded.

Our IT department have removed internet access for the ArcGIS Server. So I'm assuming that the Server needs internet access to render the previews  via arcgis.com? Do I need to allow internet access and add a rule allow traffic to ESRI only *arcgis.com?

Is there an option to use this offline?  

Thanks,

Clinton

0 Kudos
1 Solution

Accepted Solutions
ClintonBallandis1
Occasional Contributor

Hi all,

I've resolved this issue. When I upgraded from 10.5 to 10.6.1 the API versions didn't get upgraded in the services directory. For 10.6 the api needs to be version 4.5 not 3.18.

Javascript API URL : http://js.arcgis.com/4.5

Javascript API CSS URL : http://js.arcgis.com/4.5/esri/css/main.css   

Thanks,

Clinton 

View solution in original post

5 Replies
JacobSnyder1
Esri Contributor

Hi Clinton,

It looks like you are seeing these errors in the browser console due to the fact that the ArcGIS API for JavaScript is specified to be accessed via CDN within the settings in the ArcGIS Server Administrator Directory. In the case that you have demonstrated, the ArcGIS Server machine would need access to the internet in order to retrieve the necessary files it needs to access the API via CDN. If the ArcGIS Server machine does not have internet access, an alternative to CDN would be to download the ArcGIS API for JavaScript and deploy it on-premise. 

Please see the following document associated with version 3.x of the ArcGIS API for JavaScript, which details different ways in which you can access ArcGIS API for JavaScript 3.x:

Get the ArcGIS API for JavaScript | Guide | ArcGIS API for JavaScript 3.27 

Additionally, please see the following document that explains how to customize the JavaScript API URL's that are utilized by the ArcGIS Server REST Services Directory:

Configuring the REST API—ArcGIS REST API: Services Directory | ArcGIS for Developers 

I hope that this is helpful.

Thank you,

Jacob

ClintonBallandis1
Occasional Contributor

Hi Jacob,

My ArcGIS server now has internet access however the Javascript Preview is still blank. If I look in the developer console the following urls are returning 404 Not Found Code: NoSuchKey Message: The specified key does not exist.

https://js.arcgis.com/3.18/esri/Map.js 

https://js.arcgis.com/3.18/esri/views/MapView.js 

https://js.arcgis.com/3.18/esri/widgets/Home.js 

I've tried  hitting the URL's from my local machine same 404 errors are returned.

Interestingly if I change the version from say 3.18 to 4.0 I get a response.

Any help would be appreciated.

Thanks,

Clinton

0 Kudos
ClintonBallandis1
Occasional Contributor

Hi all,

I've resolved this issue. When I upgraded from 10.5 to 10.6.1 the API versions didn't get upgraded in the services directory. For 10.6 the api needs to be version 4.5 not 3.18.

Javascript API URL : http://js.arcgis.com/4.5

Javascript API CSS URL : http://js.arcgis.com/4.5/esri/css/main.css   

Thanks,

Clinton 

JimCunningham3
New Contributor

Hey Clinton,

I recently found this thread when I was having the same issue and looking for a solution. Your post, replies, and solution did the trick. Just wanted to say thank you!

Jim

0 Kudos
KiraEvers1
New Contributor II

Hi Clinton,

I've run into what I presume is a similar issue. In order to update the API versions did you edit the URLs from the ArcGIS Server Administrator Directory as shown in your screen shot?

Thanks!

0 Kudos