我有一個 springboot 應用程序,它連接到 DB2 數據庫,然后檢索一些數據并為其提供 REST 端點。為了促進這一點,許可證被添加到應用程序的類路徑中,以允許它與 DB2 數據庫進行通信。這有效。但是,當我在本地構建和鏡像并運行該鏡像時,我收到一條錯誤,指出許可證不存在。{ "timestamp": 1569854043909, "status": 500, "error": "Internal Server Error", "exception": "org.springframework.jdbc.CannotGetJdbcConnectionException", "message": "Could not get JDBC Connection; nested exception is com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][t4][10509][13454][4.26.14] Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid \nor was not activated for the DB2 for z/OS subsystem. If you are connecting directly to \nthe data server and using DB2 Connect Unlimited Edition for System z, perform the \nactivation step by running the activation program in the license activation kit. \nIf you are using any other edition of DB2 Connect, obtain the license file, \ndb2jcc_license_cisuz.jar, from the license activation kit, and follow the installation \ndirections to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968", "path": "/test"}我假設這是因為許可證現在不包含在 Docker 容器類路徑中。我對此進行了相當多的研究,但看不到任何關于我將如何做到這一點的指示。因此,任何幫助將不勝感激。我的許可證保存在項目根目錄的 lib 文件夾中,是一個 jar 文件。我的泊塢窗文件:FROM openjdk:8-jdk-alpineVOLUME /tmpARG JAR_FILECOPY target/mydb2jdbcproject-1.jar mydb2jdbcproject-1.jarCOPY lib/db2jcc_license_cisuz.jar db2jcc_license_cisuz.jar#CLASSPATH: lib/db2jcc_license_cisuz.jar/EXPOSE 8080ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","mydb2jdbcproject-1.jar"]
將 .jar 許可證文件添加到 Docker 映像的類路徑?
慕碼人2483693
2023-09-13 15:41:10