![](/img/trans.png)
[英]Where does the dependency injection take place?
據我所知: BeanFactory 根據其定義創建 bean。 然后將其發送到BeanPostProcessor以調用postProcessBeforeInitialization() 。 接收回來並提供init()方法。 BeanPostProcessor與postProcessAfterI ...
[英]Where does the dependency injection take place?
據我所知: BeanFactory 根據其定義創建 bean。 然后將其發送到BeanPostProcessor以調用postProcessBeforeInitialization() 。 接收回來並提供init()方法。 BeanPostProcessor與postProcessAfterI ...
[英]JUnit5 test case calls @Transactional function
給定一個帶有 TestMethod 的 TestClass 用於集成測試(在幕后產生 MySQL Testcontainer) 以及用 @Transactional 注釋的 Handler 實現 如果我運行這個測試,事務永遠不會打開,因為它需要從 Bean 調用到 Bean 以應用 @Transa ...
[英]Create a Spring Bean programmatically, but with Autowired within it
如何實例化其中包含一些@Autowired bean 的 Spring Bean? 需要注意的是,實例 bean 類型必須在運行時動態發現(而@Autowired bean 仍然可以是單例)。 例子: 界面 ClientA.class 客戶端B.class ClientFactory.clas ...
[英]How to listen for property change of a Java static class
我正在構建一個 Swing GUI 應用程序,當 static class 中的屬性更改時,我試圖更改 GUI 的其他部分。 這是擁有屬性的 class:package dev.vitto.cna; import java.beans.*; public class Project { ...
[英]How do I manually register filters in springboot?
我有三個Filter class:AFilter、BFilter、CFilter,並嘗試通過以下代碼注冊它們: 他們已經注冊到 beanfactory,但他們不是過濾器。 我怎樣才能把它們變成過濾器? 我的主要目標是使內置過濾器和用戶定義的過濾器可訂購。 使用上面AFilter、BFilter和C ...
[英]Requested bean is currently in creation: Is there an unresolvable circular reference During adding one spring boot applciation to another?
場景:我有一個 springboot 應用程序,它執行類似批處理的功能(從 s3 處理讀取數據並寫入 sql 表)。 我還有一個單獨的 Jmix 應用程序。 所以需要將批處理添加到這個 jmix 應用程序,以便我可以從 jmix 應用程序運行批處理我能夠將它添加到 buid.gradle 中,我在 ...
[英]why Service is not taking by the Service implementation?
這是我的服務:這是我的服務實現: 這是 output 結果: ...
[英]How to correctly define hikari datasource
我有以下 bean 定義。 當我獲得應用程序上下文時。 拋出異常 有什么想法可能是什么原因? ...
[英]Springboot with Graphql error with "Consider defining a bean of type '{component name}' in your configuration."
我正在使用 Spring 啟動與 graphql 和 rest。在添加 graphql 組件時,我使用了這樣的注釋。 Controller 服務 資料庫 但是得到了這些錯誤 它僅在使用測試時發生 我知道我可以使用 ComponentSacn,但我想知道為什么會這樣。 因為這個 package 與 ...
[英]Spring Boot - Not a managed type, Error creating bean
我想知道如何在我的 Spring Boot 項目中修復這些錯誤,我創建了一個非常簡單的項目,使用基於 Spring Security 的登錄/注冊,但我不知道如何修復這些東西,我已經嘗試了所有具有相同問題的建議,但這些都沒有幫助我:( 提前致謝! 我項目中的所有代碼: 安全配置 應用控制器 員工實體 ...
[英]Spring boot bean name conflict in two external packages with no controll of the external code
我正在嘗試在 Spring Boot 3.0.0 中使用兩個依賴項 問題是它們都有一個名為“objectMapperProvider”的 Bean。 一種用於: 另一個用於: 我得到的錯誤是: 有沒有辦法解決這個問題,或者我是否需要確定優先級並選擇更重要的使用方法。 尋找其他解決方案。 ...
[英]Where to add a bean to the Apache Ignite configuration file?
我有一個 Apache Ignite 集群,我正在嘗試將其與 Prometheus 堆棧集成,一切都很好,除了沒有生成指標。 這是我當前的配置文件:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
[英]How to bind a List<String> to a ObservableList<String>?
我有一個包含List<String>的 object Bean 。 我想將此列表“綁定”到ObservableList ,以便在將項目添加到原始列表或從原始列表中刪除時,更新ObservableList (然后觸發監視ObservableList的偵聽器)。 我發現了這個問題,它的答案 ...
[英]How to fetch value of a bean variable inside the application
我有一個用例,我想聲明一個在應用程序啟動時初始化的 bean,稍后我想在條件表達式上使用 bean 的變量下面是代碼片段 現在我想通過條件表達式上已經注冊的 bean 在我的應用程序中使用變量 isXYZ 的值。 這就是我現在正在嘗試的方式。 但是我收到以下錯誤表達式解析失敗; 嵌套異常為 org. ...
[英]@Component always null in spring boot
我有兩個類被注釋為 @Component 我將它們注入不同的服務 但我的映射器一直是 null。我不會使用新命令創建新的 Object。 此外,對於我的存儲庫接口,一切都很好,所以我注入評論的方式(@AllArgsContrustor)工作正常。 請注意,我有測試類,我在服務類上使用了@Inje ...
[英]Store POJOs to a Spark Dataset
我正在將Zeppelin連接到我的 rest 網絡服務,該服務通過OpenAPI返回城市:import java.util.Map; import fr.ecoemploi.application.etude.swagger.model.Commune; import fr.ecoemploi.a ...
[英]How to create and use beans from Command Line Argument in SpringbootApplication and use them?
我正在嘗試在我的 sprinbootApplication 中使用 ApplicationRunner 創建一個批處理作業,我想在我的代碼中使用命令行 arguments 作為變量。 所以我想提取命令行 arguments,從中生成 bean 並在我的代碼中使用它們。 如何實現?@SpringBo ...
[英]Spring Bean definition with value from application.yml
我想定義一個 Bean,它應該由 Spring 管理,並從 application.yml 注入它的屬性。 我確實嘗試使用 @Configuration 但它不起作用。 錯誤是地址未設置,同時嘗試訪問客戶端實例。 非常感謝任何幫助。 ...