![](/img/trans.png)
[英]Springboot app not detecting the application properties file when the application is packaged as jar
[英]Springboot application packaged as a library to be used in another springboot application
我的場景如下:
當我啟動 APP2 時,它啟動正常。 但是當我使用 http 請求進行測試時,我得到了 LIB 中某些類的 NoClassDefFoundError。
有沒有一種方法可以很好地實現這種情況。
代碼流程:Controller(APP2)->Service(APP@)->Service(APP1)->業務邏輯類(LIB)
更好的設計:-
-或者-
獨立運行這兩個服務,並在這兩個服務之間添加一個 http 調用。
通常當你想在微服務架構中擁有庫時,它們應該是普通的 Java 類,以便它們可以在任何地方使用。
當前設置可能無法正常工作的一個原因是 APP1 中的服務可能沒有按預期注入所需的依賴項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.