8

We have 2 applications one is SAP Fiori App which is deployed in SAP ABAP repository and another app which is written OpenUI5 which is not related to SAP so we have deployed in Apache Tomcat.

We need to Integrate these 2 applications like on clicking of a button in Fiori app need to open the OpenUI5 app.

Problem is the Module (App) Which is deployed on Tomcat is not able open because when we registerModulePath the domian is not taking by Fiori

    jQuery.sap.addUrlWhitelist("http", "tomcat.server.host", "7070", "/tomcatapp/resources/js/ui5widgets");

    jQuery.sap.registerModulePath("com.xxx.yyy", "http://tomcat.server.host:7070/tomcatapp/resources/js/ui5widgets");

when i require

error is

core-min-0-dbg.js:17351 Uncaught Error: failed to load 'com/xxx/yyy/aaa/bbb.js' from /sap/bc/ui5_ui5/ui2/ushell/resources/~20151006101200~/com/xxx/yyy/aaa/bbb.js: 

0 - AbortError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://sap.netweaver.net:2020/sap/bc/ui5_ui5/ui2/ushell/resources/~20151006101200~/com/xxx/yyy/aaa/bbb.js'.(…)
chiranjeevigk
  • 1,636
  • 1
  • 23
  • 43
  • You are not overridding an existing package name by any chance? – cschuff Aug 09 '16 at 13:31
  • no, i am using same package names – chiranjeevigk Aug 09 '16 at 13:39
  • Does the path of 'com/xxx/yyy/aaa/bbb.js' get resolved correctly if you use a relative path? I just wonder why it fails to load from 'http://sap.netweaver.net:2020/sap/bc/ui5_ui5/ui2/ushell/resources/~20151006101200~/com/xxx/yyy/aaa/bbb.js' which is not the path you registered. – cschuff Aug 09 '16 at 13:43
  • the 'com/xxx/yyy/aaa/bbb.js' in not deployed in the 'sap.netweaver.net:2020' its in tomcat server. – chiranjeevigk Aug 09 '16 at 13:44
  • I understood that. Could you anyways temporarily register it under a relative path just to see if the path com.xxx.yyy.aaa.bbb resolves correctly under that circumstances? – cschuff Aug 10 '16 at 07:17
  • i have deployed a new BSP Application and deployed to it.. i need to do these `jQuery.sap.registerResourcePath("com.xxx.yyy", '/sap/bc/ui5_ui5/sap/tomcat_app/'); jQuery.sap.registerModulePath("com.xxx.yyy", '/sap/bc/ui5_ui5/sap/tomcat_app/'); jQuery.sap.require("com.xxx.yyy.aaa.bbb");` – chiranjeevigk Aug 11 '16 at 06:26
  • and if you run this and open network tab from where does it try to load com.xxx.yyy.aaa.bbb?! – cschuff Aug 11 '16 at 07:47
  • http://sap.netweaver.net:2020/sap/bc/ui5_ui5/~260E5717C4F9E3BA7C7E1EFFB42F115E~C/sap/tomcat_app/aaa/bbb.js – chiranjeevigk Aug 11 '16 at 08:10

1 Answers1

1

If I do

jQuery.sap.registerModulePath("test.test", "http://www.google.de");
jQuery.sap.require("test.test.MyTest");

The file is correctly resolved to http://www.google.de/MyTest.js.

Are you sure that your package name is not overridden by something else? e.g. a package name like 'sap.ui.something' will obviously be a bad idea. But there are less obvious examples. May be you show a little more/real code?

Anyways you will have to take care of CORS

cschuff
  • 5,502
  • 7
  • 36
  • 52
  • @chiranjeevigk I don't quite get how this solved your problem but thanks for accepting anyways ;) – cschuff Aug 17 '16 at 10:34