我想知道如果彈簧加載一個接口,當聲明爲一個實現類的@autowired
屬性,而不註釋接口爲a @component
。彈簧接口加載
讓我再描述一下我的問題: 我有一個接口和它的實現類具有相同的名稱,但它們駐留在不同的包中。我註釋了執行情況爲@Component("myImplementation")
。 但我最終,上面寫着一個例外:
conflicts with existing, non-compatible bean definition of same name and class
我在想,不包括<context:component-scan
接口的,你覺得呢?
PS:我的界面不@Component
註釋,應用程序運行在DEVELOPPEMENT environement就好了,我只Proguard的混淆後得到的錯誤
很好的問題,試着通過實現例如和post結果來排除組件掃描。 – 2012-04-25 15:20:34
你的意思是排除組件掃描權的接口? – Genjuro 2012-04-25 15:23:29
你能更詳細地描述你的情況嗎? ''context:component-scan>'的配置有什麼特別之處嗎? – axtavt 2012-04-25 15:26:07