使用 SAP Fiori Tools 部署 SAP UI5 应用到 ABAP 服务器时遇到的各种错误和解决办法
錯誤1
(node:28340) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘customMiddleware’ of undefined
at handleABAP (C:\Code\UI5\Walkthrough\35\node_modules@sap\ux-ui5-tooling\dist\cli\cmd\add-deploy-config.js:113:29)
錯誤原因:使用的 Fiori tools CLI 版本過低所致。
“@sap/ux-ui5-tooling”: “1.0.10”
https://www.npmjs.com/package/@sap/ux-ui5-tooling
解決辦法:使用最新的 1.4.7 版本:
錯誤消息2
Error: Cannot find proxy middleware config in [C:\Code\UI5\Walkthrough\35\ui5.yaml]
at f (C:\app\node-v12.18.3-win-x64\node_modules@sap\generator-fiori\generators\deployment-generator\abap\index.js:2:616172)
at Object.r.handleErrorMessage (C:\app\node-v12.18.3-win-x64\node_modules@sap\generator-fiori\generators\deployment-generator\abap\index.js:2:616358)
錯誤原因:ui5.yaml 文件內(nèi)容不全。
至少應(yīng)該包含 fiori-tools-proxy 區(qū)域。
參考一個格式正確的 ui5.yaml:
specVersion: '1.0' metadata:name: 'project1' type: application ui5Theme: sap_fiori_3 server:customMiddleware:- name: fiori-tools-proxyafterMiddleware: compressionconfiguration:ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be acceptedbackend:- path: /sap/opu/odataurl: http://localhostui5:path: - /resources- /test-resourcesurl: https://ui5.sap.comversion: # The UI5 version, for instance, 1.78.1. Empty means latest version- name: fiori-tools-appreloadafterMiddleware: compressionconfiguration:port: 35729path: webapp錯誤消息3
info builder:custom deploy-to-abap Create Archive
info builder:custom deploy-to-abap Starting Deployment.on project1 � (11/11) Running task deploy-to-abap…
WARN builder:custom deploy-to-abap Connecting without any credentials, deployment may fail if authorization is required
ERR! builder:custom deploy-to-abap Deployment Failed.tion project1 � (11/11) Running task deploy-to-abap…
ERR! builder:custom deploy-to-abap getaddrinfo ENOTFOUND aa
原因是 ui5-deploy.yaml 文件中 deploy-to-abap 這個自定義 task 的 target, 即遠端 ABAP 系統(tǒng)的 url 維護不正確。
如果看到上圖所示的提示消息:
The deployment destination requires authentication. Please enter your credentials below
? Username:
說明 ABAP 系統(tǒng)連接成功。
錯誤消息4
Upload canceled, archive could not be read or appears to be empty
錯誤消息和這個帖子介紹的一致。
這個錯誤和 SAP UI5 tools 的版本有關(guān)。
使用 generator-easy-ui5 創(chuàng)建的 SAP UI5 項目,SAP UI5 tools 的默認版本號如下圖所示:
"devDependencies": {"@ui5/cli": "^2.11.1","@ui5/fs": "^2.0.6","@ui5/logger": "^2.0.1","@sap/ux-ui5-tooling": "1","rimraf": "3.0.2"},"ui5": {"dependencies": ["@sap/ux-ui5-tooling"]}解決方案:刪除 package-lock.json 文件和 node_modules 文件夾,
執(zhí)行命令行安裝最新版本:
npm install @sap/ux-ui5-tooling@latest
成功安裝的版本號:1.4.7
將 package.json 文件里的 deploy 腳本命令更改為:
npm run build && fiori deploy --config ui5-deploy.yaml
重新執(zhí)行 npm run deploy 即可:
錯誤消息5
Remote creation in customer namespace not possible in SAP systems
解決辦法是,提前在 ABAP 系統(tǒng) ER9 手動創(chuàng)建好 BSP 應(yīng)用即可:
另一種方法,參考這個鏈接。
更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:
總結(jié)
以上是生活随笔為你收集整理的使用 SAP Fiori Tools 部署 SAP UI5 应用到 ABAP 服务器时遇到的各种错误和解决办法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 宝可梦剑盾偷儿狐属性怎么样 偷儿狐属性一
- 下一篇: SAP UI5 应用开发教程之四十 -