guice

    1熱度

    1回答

    我正在開發一個簡單的應用程序,使用Jersey 1.x,Guice並嘗試在Tomcat上運行。 我使用了Guice過濾器和Guice Listener以及資源和應用程序。 下面是我的web.xml: <filter> <filter-name>guiceFilter</filter-name> <filter-class>com.google.inject.servlet.Gu

    3熱度

    1回答

    我一直在試圖遵循CustomInjections文檔,但更新它爲log4j2。我似乎錯過了InjectLogger類。 任何想法,我錯過了,或有人有一個工作的例子,我可以看到?

    2熱度

    2回答

    我試圖在注入器中創建測試api。 The test binding are as follows class ApiTestModule extends AbstractModule { def configure(): Unit = { bind(classOf[Client]).in(classOf[Singleton]) bind(classOf[

    0熱度

    1回答

    最初我開始研究Play!具有Controller,Processor和DAO的Java項目。我使用Google Guice的@ImplementedBy作爲我的Processor接口的依賴注入,我的ProcessorImpl實現了它。 現在,我創建了另一個項目,它也需要Processor。所以我提取了另一個單獨項目的接口,例如common,並且這兩個項目使用該通用項目作爲引用庫。 問題是,我將無法

    1熱度

    2回答

    我一直在學習Guice。我看到有一個按需注入here。 我想知道它的用途和一些例子。我有一個場景,我從conf文件中讀取一組屬性。那裏沒有注射。後來我想將這些屬性的配置類的相同實例注入其他類。 class Props { //set of properties read from a config file to this class } Props props = readPr

    1熱度

    1回答

    我在Google App Engine上使用Apache Shiro和Guice。 繼過濾器鏈存在於configureShiroWeb addFilterChain("/**/first/second/third/**", AUTHC_BASIC, config(REST, "X")); addFilterChain("/**/first/**", AUTHC_BASIC, config(RES

    0熱度

    3回答

    調用注入斯卡拉類我在玩下面的類斯卡拉是注入其他類: class MainEtl2 @Inject() (ic: injectedClass) { def run (option: String) = { ic.method1() // ... some code } } 我需要調用方法run在阿卡演員。這是我的嘗試,假設當調用MainEtl2吉斯將

    1熱度

    3回答

    我有一個名爲Legacy的現有類,主要是用舊式單例模式編寫的。現在我想介紹一個新的領域,我想用Guice。 Legacy本身不受Guice控制,它被另一個Service類使用(在Service類中,它調用Legacy類的getInstance()以立即檢索Legacy對象),並且該Service類是使用Guice注入器創建的。 public class Legacy { public

    1熱度

    1回答

    我從2.5升級到HazelCast 3.8,但升級後我得到以下異常: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Recursive load of: . . . at com.google.common.cache.LocalCache

    3熱度

    1回答

    我已經升級了我的項目中的Dropwizard,並在運行單元測試時遇到了問題,儘管服務啓動正常,所有API都正常運行,問題僅在運行測試時纔會出現,我的版本:下面 Dropwizard: 1.1.0 Jersey: 2.25.1 Guice: 4.1.0 hk2-api: 2.5.0-b36 hk2-utils: 2.5.0-b36 javax.ws.rs-api : 2.1-m05 是