on 2018 Jun 26 10:56 PM
I have been developing an application running sapui5 which doesn't go out of the ordinary.
The bizzare behaviour i have been observing is that my application isn't responding on the localResource i have set for it as it keeps trying to search for the external resource on the online sapui5 library, i have tried different versions of sapui5 library and openui5
here is the index.html:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<title>Project</title>
<!-- https://openui5.hana.ondemand.com/1.38.21/resources/sap-ui-core.js -->
<script id="sap-ui-bootstrap"
src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-theme="sap_bluecrystal">
</script>
<script>
sap.ui.localResources("Project");
var app = new sap.m.App({initialPage:"master"});
var page = sap.ui.view({id:"master", viewName:"Project.master", type:sap.ui.core.mvc.ViewType.XML});
app.addPage(page);
app.placeAt("content");
</script>
</head>
<body id="content">
</body>
</html>
and the Error codes i have been getting
jquery-dbg.js:9203 Failed to load https://openui5.hana.ondemand.com/resources/Project/master.view.xml: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8080' is therefore not allowed access. The response had HTTP status code 404.
Uncaught Error: resource Project/master.view.xml could not be loaded from https://openui5.hana.ondemand.com/resources/Project/master.view.xml. Check for 'file not found' or parse errors. Reason: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://openui5.hana.ondemand.com/resources/Project/master.view.xml'.
the application keeps setting his default resource path as sapui5 library + path to resources instead of 127.0.0.1 + path to resource
I have had no success in using jQuery.sap.registerModulePath aswell with "final" set on true
Request clarification before answering.
Ok so it seems that i have just made a mistake in naming the root path of my localResources and the one that is used for the view itself, which lead to a url that wasn't usable for sapui5 as it couldn't find the root resource folder. Sapui5 tried to resort to the other url as a fail safe function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have the neo-app.json?
there is the configuration of the resources :
{
"routes": [{
"path": "/webapp/resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/resources"
},
"description": "SAPUI5 Resources"
}, {
"path": "/resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/resources"
},
"description": "SAPUI5 Resources"
}, {
"path": "/sap/opu/odata",
"target": {
"type": "destination",
"name": "TEST",
"entryPath": "/sap/opu/odata"
},
"description": "Destination Cockpit"
}, {
"path": "/sap/bc/ui5_ui5",
"target": {
"type": "destination",
"name": "TEST",
"entryPath": "/sap/bc/ui5_ui5"
},
"description": "Destination Cockpit"
}]
}
Also, when I have to use external UI5 libraries I use this :
src="https://sapui5.hana.ondemand.com/1.50.12/resources/sap-ui-core.js"
Or the local:
src="/resources/sap-ui-core.js"
Dunno if this helps you, hope so.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mehdi,
You're using which IDE? WebIDE or Eclipse?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.