第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Spring中構(gòu)造函數(shù)參數(shù)的歧義

Spring中構(gòu)造函數(shù)參數(shù)的歧義

嗶嗶one 2021-09-12 20:34:15
我有一個(gè)關(guān)于類(lèi)型歧義的錯(cuò)誤:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blankRestoreFromRecycleUiOperation' defined in URL: Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)這是我的 spring xml 映射:<bean id="blankRestoreFromRecycleUiOperation" class="BlankRestoreFromRecycleUiOperation">    <constructor-arg index="0" value="blankTab"/>    <constructor-arg index="1" value="false"/></bean>我的java類(lèi):public class BlankRestoreFromRecycleUiOperation implements RestoreFromRecycleUiOperationAware {       private String tab;       private boolean green;       public BlankRestoreFromRecycleUiOperation(String tab, boolean green) {            this.tab = tab;            this.green = green;       }}所以,其他類(lèi)似的問(wèn)題說(shuō)的是正確的構(gòu)造函數(shù)參數(shù)索引和命名,但在這里我想我錯(cuò)過(guò)了其他東西。同樣在發(fā)布之前,我嘗試添加這樣的參數(shù)類(lèi)型:<bean id="blankRestoreFromRecycleUiOperation" class="BlankRestoreFromRecycleUiOperation">    <constructor-arg index="0" type="java.lang.String" value="blankTab"/>    <constructor-arg index="1" type="boolean" value="false"/></bean>然后得到了同樣的錯(cuò)誤。您能否指定正確的方法或缺失的部分?提前感謝您的回答。已解決:?jiǎn)栴}與IDE和gradle版本有關(guān)。有 2 個(gè)不同版本的 Spring 導(dǎo)致整個(gè)應(yīng)用程序工作出錯(cuò)。無(wú)論如何感謝您的回答。
查看完整描述

2 回答

?
有只小跳蛙

TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超8個(gè)贊

只需嘗試在 class = "com.jwt.spring.BlankRestoreFromRecycleUiOperation"> 中的 XML 映射可能會(huì)有所幫助,因?yàn)檫@種類(lèi)型的錯(cuò)誤稱(chēng)為注入類(lèi)型歧義。我希望它會(huì)有所幫助。


查看完整回答
反對(duì) 回復(fù) 2021-09-12
  • 2 回答
  • 0 關(guān)注
  • 306 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)