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

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

創(chuàng)建 bean 時(shí)出錯(cuò),注入自動(dòng)裝配的依賴項(xiàng)失敗,無(wú)法自動(dòng)裝配字段

創(chuàng)建 bean 時(shí)出錯(cuò),注入自動(dòng)裝配的依賴項(xiàng)失敗,無(wú)法自動(dòng)裝配字段

www說(shuō) 2022-07-14 16:25:01
遇到異常,以下是日志:org.springframework.beans.factory.BeanCreationException:創(chuàng)建名為“speaker”的bean時(shí)出錯(cuò):注入自動(dòng)裝配依賴項(xiàng)失敗;嵌套異常是 org.springframework.beans.factory.BeanCreationException:無(wú)法自動(dòng)裝配方法:public final void org.mybatis.spring.support.SqlSessionDaoSupport.setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate); 嵌套異常是 java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getNestedParameterType()Ljava/lang/ClassJava網(wǎng)絡(luò)服務(wù):@WebServicepublic class voiceRecognition extends SpringBeanAutowiringSupport {    @Autowired    private Speaker speaker;    @WebMethod    public void test() {        String userid = "111";        String enrollmentid = "111";        try{        String test1 = speaker.getEnrollmentId(userid);          System.out.println(test1);        }        catch (Exception e)        {            e.printStackTrace();        }        }}Speaker.java:package ph.com.aub.mapper;import org.apache.ibatis.annotations.Param;import org.springframework.stereotype.Service;@Servicepublic interface Speaker {    public String getEnrollmentId(@Param("userid") String userid);}揚(yáng)聲器.xml:<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace = "ph.com.aub.mapper.Speaker"><select id = "getEnrollmentId" resultType = "string" parameterType = "string">Select enrollmentid from speakerids where userid = #{userid}</select></mapper>網(wǎng)頁(yè).xml:<?xml version = '1.0' encoding = 'windows-1252'?><web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"         version="2.5">
查看完整描述

1 回答

?
繁星coding

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

我相信您配置錯(cuò)誤basePackage。MapperScannerConfigurer它應(yīng)該是包含映射器類而不是映射器類本身的包。所以嘗試將其更改basePackage為:


<bean id="mapperSpeaker" class="org.mybatis.spring.mapper.MapperScannerConfigurer">

    <property name="basePackage" value="ph.com.aub.mapper" />

    <property name="sqlSessionFactoryBeanName" value="sqlSessionFactorySpeaker" />

</bean>


查看完整回答
反對(duì) 回復(fù) 2022-07-14
  • 1 回答
  • 0 關(guān)注
  • 452 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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