404 config.json error for server deployment of WebAppBuilder Application?

5229
15
Jump to solution
07-14-2016 03:38 PM
GeoffreyWest
Occasional Contributor III


I am reeving  a 404 error that my config.json cannot be found, I have added the JSON mime type to my IIS configuration at the site and server levels and have restarted IIS.  This error appears as so in my console  with other errors which I think are caused by the initial 404 of the config.json.  What other steps can be taken to remedy this?  Additionally when I hit the index.html I receive  an "Unexpected token < in JSON at position 0" error

GET http://gisdev01/LifeSupportApplication/LifeSupportApplication/jimu.js/css/fonts/c4352a95-7a41-48c1-8...
main.js?wab_dv=2.1:1521 jimu.js init...
init.js:140 GET http://gisdev01/LifeSupportApplication/LifeSupportApplication/config.json?wab_dv=2.1 404 (Not Found)h @ init.js:140_tryLoadConfig @ main.js?wab_dv=2.1:236loadConfig @ main.js?wab_dv=2.1:227loadConfig @ main.js?wab_dv=2.1:11f.initApp @ main.js?wab_dv=2.1:1522(anonymous function) @ init.js:200ia @ init.js:28(anonymous function) @ init.js:28ja @ init.js:28ga @ init.js:28b @ init.js:29f @ init.js:151d @ init.js:152
init.js:113 TypeError: Cannot read property 'portalUrl' of undefined(…) "TypeError: Cannot read property 'portalUrl' of undefined
    at _addDefaultPortalUrl (http://gisdev01/LifeSupportApplication/LifeSupportApplication/jimu.js/main.js?wab_dv=2.1:32:492)
    at _addDefaultValues (http://gisdev01/LifeSupportApplication/LifeSupportApplication/jimu.js/main.js?wab_dv=2.1:31:416)
    at .<anonymous> (http://gisdev01/LifeSupportApplication/LifeSupportApplication/jimu.js/main.js?wab_dv=2.1:11:456)
    at http://js.arcgis.com/3.17/init.js:63:209
    at h (http://js.arcgis.com/3.17/init.js:107:279)
    at k (http://js.arcgis.com/3.17/init.js:107:205)
    at g.resolve (http://js.arcgis.com/3.17/init.js:109:280)
    at a (http://js.arcgis.com/3.17/init.js:108:148)
    at h (http://js.arcgis.com/3.17/init.js:107:419)
    at k (http://js.arcgis.com/3.17/init.js:107:205)
    ----------------------------------------
    rejected at a (http://js.arcgis.com/3.17/init.js:108:174)
    at h (http://js.arcgis.com/3.17/init.js:107:438)
    at k (http://js.arcgis.com/3.17/init.js:107:205)
    at g.resolve (http://js.arcgis.com/3.17/init.js:109:280)
    at a (http://js.arcgis.com/3.17/init.js:108:148)
    at h (http://js.arcgis.com/3.17/init.js:107:419)
    at k (http://js.arcgis.com/3.17/init.js:107:205)
    at g.w.reject (http://js.arcgis.com/3.17/init.js:109:488)
    at a (http://js.arcgis.com/3.17/init.js:108:174)
    at h (http://js.arcgis.com/3.17/init.js:107:452)
    ----------------------------------------
Error
    at then.c.then (http://js.arcgis.com/3.17/init.js:110:97)
    at loadConfig (http://gisdev01/LifeSupportApplication/LifeSupportApplication/jimu.js/main.js?wab_dv=2.1:11:361)
    at Object.f.initApp (http://gisdev01/LifeSupportApplication/LifeSupportApplication/jimu.js/main.js?wab_dv=2.1:1522:55)
    at http://gisdev01/LifeSupportApplication/LifeSupportApplication/init.js:200:24
    at ia (http://js.arcgis.com/3.17/init.js:28:3)
    at http://js.arcgis.com/3.17/init.js:28:256
    at ja (http://js.arcgis.com/3.17/init.js:28:125)
    at ga (http://js.arcgis.com/3.17/init.js:28:198)
    at b (http://js.arcgis.com/3.17/init.js:29:177)
    at f (http://js.arcgis.com/3.17/init.js:151:195)"
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Geoffery,

OK, so the url http: //gisdev01/LifeSupportApplication/LifeSupportApplication/config.json?wab_dv=2.1 seems to be the issue.

you state:

I have the app in a folder called LifeSupportApplication and the

index.html is in there.

So if that is the case the url you should be using is:

http://gisdev01/LifeSupportApplication/config.json?wab_dv=2.1

not

http://gisdev01/LifeSupportApplication/LifeSupportApplication/config.json?wab_dv=2.1

View solution in original post

15 Replies
RobertScheitlin__GISP
MVP Emeritus

Geoffery,

  Sounds like you have a syntax error in your config.json. Can you zip and attach it using the advanced editor?

0 Kudos
GeoffreyWest
Occasional Contributor III

Hi Robert,

I have attached my .json.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Geoffery,

  I can find nothing wrong with your config.json. The main thing I do see is that you have "portalUrl": "your true orgs address" in the map object and "portalUrl": "http://myorg.maps.arcgis.com", in the main portion. In all my apps they are the same url. Another thing that looks odd is "icon": "widgets/MyLocation/images/icon.png?wab_dv=2.1",. What did you use to create this app (WAB Dev or AGOL)?

0 Kudos
GeoffreyWest
Occasional Contributor III

Hi Robert,

Thanks for your insight; I used AGOL to create the app.  I was using my.org.maps.arcgis as a placeholder bc I didn't want the org address to be public, but I mistakenly left that in there. Do you mind removing it from your message?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

OK, Have you tried to just bring up the config.json for your site in the url?

http://gis.calhouncounty.org/WAB/V2.0/widgets/eSearch/config.json

0 Kudos
GeoffreyWest
Occasional Contributor III

I just tried, same error, I am using IIS6. So something is not correct on my configuration, do I need a proxy as suggested?

Use proxy—Web AppBuilder for ArcGIS | ArcGIS

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Geoffery,

  1. Is this a public site yet?
  2. Can you access any other files using the url i.e. http://gis.calhouncounty.org/WAB/V2.0/widgets/eSearch/images/loading.gif
0 Kudos
GeoffreyWest
Occasional Contributor III

The site should be made public via arcgis online, correct?

Error below

wab_error.JPG

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Geoffery,

  I think you are a little confused.

  1. When you created the app on AGOL did you download/export the site from AGOL and then host the site on your IIS6 machine?
  2. If so then NO it would not be publicly accessible unless your IIS machine is.
  3. With a url like http: //gisdev01/LifeSupportApplication/LifeSupportApplication/... you are only hosting locally.
  4. Are you sure that http: //gisdev01/LifeSupportApplication/LifeSupportApplication/ is correct for the url?
  5. Do you have the app in a folder called LifeSupportApplication and that folder has a child folder called LifeSupportApplication in it?
0 Kudos