我有一个 SAP CAP 全栈应用程序。我还有一些自定义 UI5 代码 - XML 视图和 JS 控制器。
一切工作正常,但如果我只是更改
sap.app/id
文件中的 manifest.json
部分(从 test.reporting.app
更改为 test.reporting.app.predev
),在 SAP Build Work Zone 中打开应用程序时,我开始收到错误。错误是:
Error: resource test/reporting/app/view/App.view.xml could not be loaded from https://sapui5.hana.ondemand.com/1.123.2/resources/test-reporting-app/view/App.view.xml. Check for 'file not found' or parse errors.
奇怪的是;当我在 BTP Cockpit 的 HTML5 应用程序中找到该应用程序并打开它时,它加载得很好。所以只有当我在SAP Build Work Zone中打开应用程序时,才会报告错误。
注意:部署后,我在 SAP Build Work Zone 中更新/重新加载了 HTML5 应用程序的内容。
有什么想法为什么只是更改
sap.app/id
就会导致此错误吗?
这是我的
manifest.json
:
{
"_version": "1.49.0",
"sap.app": {
"id": "test.reporting.app.predev",
"type": "application",
"...": "..."
},
"sap.ui5": {
"rootView": {
"viewName": "test.reporting.app.view.App",
"type": "XML",
"async": true,
"id": "app"
},
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"type": "View",
"viewType": "XML",
"path": "test.reporting.app.view",
"controlId": "app",
"controlAggregation": "pages",
"async": true
},
"..." "..."
},
"...": ".."
}
}
文档
应用程序、组件和库的描述符 (manifest.json)中的
sap.app/id
部分的描述有帮助吗?
即将必须以点表示法提供的强制属性[...]必须是在系统中是唯一的。它 必须与相应的
Component.js
.”中提供的命名空间匹配。
sap.app/id
值更改为
"test.reporting.app.predev"
还需要更改应用程序
Component.js
名称:
return UIComponent.extend("test.reporting.app.predev.Component", {/*...*/});
确保同时更改 ui5*.yaml
文件中的 UI5 工具部分名称:
metadata:
name: test.reporting.app.predev
否则,将使用默认基本 URL 前缀(即 SAPUI5 资源路径)来请求应用程序资源(例如 view/App.view.xml
)。