Webapp builder app integration with Javabased web application Issue.

4870
7
05-15-2016 11:27 PM
LAXMI_KANTHPULIMATI
New Contributor II

Hi Team,

We designed an app with Plato theme using Web App Builder 2.0 version, this app is holding couple of outer box widgets(Search, Zoom controls and Home button) and custom widgets in header controller.

We embedded this app in another web application which was built on Java and this was deployed in Web logic Server, So we deployed web app builder app also in the same web logic server. When we are trying to access this app through browser it couldn't able to identify the header control widget resources and it is returning issue "404 Not found" and also please find the attached error screenshot.

If we place our custom widgets folder in the web logic server root location it is working as expected. It is always expecting the resources in the root level with widgets as folder name.

Please let us know if any alternate solution to make it work if we place the widgets folder in a same folder structure which web app builder was generated.

Thanks,

Laxmikanth.

0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus

Laxmikanth,

  I would start in the main config.json file and add the fill path to the widgets there. Right now they will look like this:

{

        "uri": "widgets/Coordinate/Widget",

        "position": {

          "left": 7,

          "bottom": 5,

          "relativeTo": "map"

        },

        "version": "2.0.1",

        "id": "widgets_Coordinate_Widget_22",

        "name": "Coordinate",

        "label": "Coordinate"

      },

Edit the uri to include the full path.

LAXMI_KANTHPULIMATI
New Contributor II

Hi Robert Scheitlin,

Thank you very much for the quick response.

I tried the solution which you suggested but I am getting different issue when I do this change and still Custom widgets are not working.

I don't know why the modified URi path is trying to get the response with a prepath[http://js.arcgis.com/3.16/dojo/].

Please find the below error and screen shot:

Error Message:

[widgets_Asset_Widget_28_panel] created.

VM364 init.js:152 OPTIONS http://js.arcgis.com/3.16/dojo/w1/wamgis/base/widgets/Asset/manifest.json

XMLHttpRequest cannot load http://js.arcgis.com/3.16/dojo/w1/wamgis/base/widgets/Asset/manifest.json. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxxxxxxxx.com:7010' is therefore not allowed access. The response had HTTP status code 403.

VM364 init.js:30 GET http://js.arcgis.com/3.16/dojo/w1/wamgis/base/widgets/Asset/Widget.js

Error: scriptError(…)(anonymous function) @ VM364 init.js:31(anonymous function) @ VM364 init.js:9a @ VM364 init.js:5r.signal @ VM364 init.js:9(anonymous function) @ VM364 init.js:30

VM364 init.js:31 src: dojoLoader

VM364 init.js:31 info: ["//js.arcgis.com/3.16/dojo/w1/wamgis/base/widgets/Asset/Widget.js", Event]

URI Change Impact Issue.png

Please suggest me if you have any solution to resolve this.

Once again thanks for the response!

Thanks,

Laxmikanth.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Laxmikanth,

  Can I see what you put in your main config.json for the widget path? It sounds like you did not add a complete url for the path (i.e. http://yourmachine/appname/blah/blah/widgets/)

0 Kudos
LAXMI_KANTHPULIMATI
New Contributor II

Hi Robert Scheitlin,

I have given the URI for each custom widget like below and please find the below screenshot of config.json file.

ex: "uri": "w1/wamgis/base/widgets/Work/Widget"

Thanks,

Laxmikanth.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Laxmikanth,

  Try assigning a full url http:// and all.

LAXMI_KANTHPULIMATI
New Contributor II

Hi Robert Scheitlin,

     Thank you very much for your help.  It's working now.

Regards,

Laxmikanth.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Laxmikanth,

Glad to help. Make sure you mark this post as answered by clicking on the "Correct Answer" link on the reply that answered your question.

0 Kudos