遇到異常,以下是日志: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">
創(chuàng)建 bean 時(shí)出錯(cuò),注入自動(dòng)裝配的依賴項(xiàng)失敗,無(wú)法自動(dòng)裝配字段
www說(shuō)
2022-07-14 16:25:01