cancel
Showing results for 
Search instead for 
Did you mean: 

fiori app connect backend system: failed to load 'sap/m/toolbar.js'

former_member189009
Active Participant
0 Kudos

Dear friends,

        I create a fiori app in web IDE, then I import it to eclipse to deploy the application to my gateway system, but when I open the index.html file run on ABAP service form my gateway system, it have many problem,first I use this path to load the recourse: resources/sap-ui-core.js   but it have error :  sap is not defind. So I use this instead, so it can enter the index page. but when I nav to another page, it have another error, I am very confuse by the lib I load,how can I load the lib successfully!

failed to load 'sap/m/toolbar.js' from https://sapui5.hana.ondemand.com/resources/sap/m/toolbar.js: 0 - NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://sapui5.hana.ondemand.com/resources/sap/m/toolbar.js'

<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"

  id="sap-ui-bootstrap"

  data-sap-ui-libs="sap.m,sap.ushell, sap.collaboration"

  data-sap-ui-resourceroots='{"Demo": "./"}'

  data-sap-ui-compatVersion="edge"

  data-sap-ui-theme="sap_bluecrystal">

</script>

Thanks for your sincerely answer!

Zhang

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Can you please change your bootstap to below when executing it on your gateway. Also before executing it on your gateway, I hope you created the BSP app first and checked-in all your code.

<script src="/resources/sap-ui-core.js"

  id="sap-ui-bootstrap"

  data-sap-ui-libs="sap.m,sap.ushell, sap.collaboration"

  data-sap-ui-resourceroots='{"Demo": "./"}'

  data-sap-ui-compatVersion="edge"

  data-sap-ui-theme="sap_bluecrystal">

</script>

former_member189009
Active Participant
0 Kudos

Hi Eldhose,

    I already create the BSP app when I deploy my application to gateway, I try your suggestion, but when I use your code, it will have this error :  sap is not defined

younghwan_kim
Active Participant
0 Kudos

Change your script source URL to your gateway, and try again.

And don't forget to activate your related SICF services.

http://<your gatewaysever>:<your gatewaysever port>/sap/public/bc/ui5_ui5/ui2/ushell/resources/sap-ui-core.js

former_member189009
Active Participant
0 Kudos

Hi Young,

     Thank you so much. I try your script source URL, it no longer had the error: sap is not defined, but it have another error:Cannot read property 'getResourceBundle' of undefined   which can be avoid by using the script source: "https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"  so I think this is still the source problem.

     And by the way what is activate my related SICF services?  maybe if I do this step, my app will be ok ?

former_member189009
Active Participant
0 Kudos

Update: I check the t-code: SICF, the related SICF services already active.

younghwan_kim
Active Participant
0 Kudos

Might be the difference from your Gateway source and HANA Cloud server source.

The first one you used is the latest UI5 resource from SAP HANA cloud server.

https://sapui5...

The one I suggested is the old, I think, UI5 resource in your Gateway server .

http://<your gatewaysever>:<your gatewaysever port>/sap/public/bc/ui5_ui5/ui2/ushell/resources/sap-ui-core.js

Also, try the URL from Mathew without prefix "/", which is relative path to your UI5 resources .

src="resources/sap-ui-core.js"

Former Member
0 Kudos

Hi Zongjje,

Can you please share the entire source code inside your index.html and Component.js.

Thanks

Eldhose

former_member189009
Active Participant
0 Kudos

Hi Young,

    Thanks!  My gateway UI5 version is 1.28, So I think the resource is not very different, and the error is from the:   sap.ui.model.resource.ResourceModel

    In addition, I already try src="resources/sap-ui-core.js"  but it still get the error: Cannot read property 'getResourceBundle' of undefined

former_member189009
Active Participant
0 Kudos

Hi Eldhose,

    Please Check my attach file, thank you so much!

Former Member
0 Kudos

Looks like you are using Master-detail template. You might be using some control which is not available in 1.28.  Can you please send me your view and controller files too.

Thanks

Eldhose

former_member189009
Active Participant
0 Kudos

Yeah, I create my project base on the CURD temple from web IDE, then I import my project in Eclipse then deploy it to my gateway system. But it just have this recourse issue so I can not run the application.

The attachment is my hole project file(please rename the file and replace the .txt to .zip). Thank you so much for the help!