ความคิดเห็นจาก Scott Kurz ยอดเยี่ยมมาก มันควรจะได้รับโพสต์ของตัวเอง:
หากคุณต้องการตรวจสอบว่าการกำหนดค่าเซิร์ฟเวอร์ Liberty เป็นสิ่งที่คุณคาดหวังจริงหรือไม่:
ดูบล็อกนี้: https://openliberty.io/blog/2019/09/13/testing-database-connections-REST-APIs.html
คุณต้องการ
<feature>restConnector-2.0</feature>
และผู้ใช้ที่เป็นผู้ดูแลระบบ (หากคุณไม่มี) เช่น
<quickStartSecurity userName="Bob" userPassword="bobpwd" />
ตอนนี้คุณสามารถดู DB-config ของคุณได้แล้ว: http://localhost:9080/ibm/api/config/dataSource/todoListDS
สำหรับ postgres ควรมีลักษณะดังนี้:
{
"configElementName": "dataSource",
"uid": "jpadatasource",
"id": "jpadatasource",
"jndiName": "jpadatasource",
"beginTranForResultSetScrollingAPIs": true,
"beginTranForVendorAPIs": true,
"connectionSharing": "MatchOriginalRequest",
"enableConnectionCasting": false,
"jdbcDriverRef": {
"configElementName": "jdbcDriver",
"uid": "dataSource[jpadatasource]/jdbcDriver[default-0]",
"libraryRef": {
"configElementName": "library",
"uid": "postgresql-driver",
"id": "postgresql-driver",
"apiTypeVisibility": "spec,ibm-api,api,stable",
"filesetRef": [
{
"configElementName": "fileset",
"uid": "library[postgresql-driver]/fileset[default-0]",
"caseSensitive": true,
"dir": "/Users/d067570/SAPDevelop/gh/ciaas/api/target/liberty/wlp/usr/shared/resources/",
"excludes": "",
"includes": "postgresql-*.jar",
"scanInterval": 0
}
]
}
},
"statementCacheSize": 10,
"syncQueryTimeoutWithTransactionTimeout": false,
"transactional": true,
"properties.postgresql": {
"databaseName": "postgres",
"password": "******",
"portNumber": 5432,
"preparedStatementCacheQueries": 0,
"serverName": "localhost",
"user": "postgres"
},
"api": [
"/ibm/api/validation/dataSource/jpadatasource"
]
}
person
Ich
schedule
29.06.2021