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

6029
15
Jump to solution
07-14-2016 03:38 PM
GeoffreyWest
Frequent Contributor


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
15 Replies
GeoffreyWest
Frequent Contributor

1. I did download app director and put it in my Inetpub folder. Configured

IIS with .json and application/json MIME settings

2. This is not publicly available, but is available on the organization

network, i.e. I can hit GISDEV01 from any machine that is on this network.

(However the app via AGOL is public)

3.I have the app in a folder called LifeSupportApplication and the

index.html is in there.

On Fri, Jul 15, 2016 at 8:36 AM, Robert Scheitlin, GISP <geonet@esri.com>

0 Kudos
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

GeoffreyWest
Frequent Contributor

I was able to successfully hit the JSON from my client; where is it

supposed to be changed in my JS or HTML? Thanks for your help Robert. Is

there a better way to configure this so I don't encounter this issue again?

On Fri, Jul 15, 2016 at 8:46 AM, Robert Scheitlin, GISP <geonet@esri.com>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Geoffery,

If you just use http://gisdev01/LifeSupportApplication/​in your browsers url does it not work?

0 Kudos
GeoffreyWest
Frequent Contributor

It does work; I was able to figure it out; I had to redirect the file in

IIS to the correct URL.

On Fri, Jul 15, 2016 at 9:29 AM, Robert Scheitlin, GISP <geonet@esri.com>

RobertScheitlin__GISP
MVP Emeritus

Geoffery,

  Great don't forget to mark this thread as answered.