Spring整合Mybatis异常:BeanCreationException: Error creating bean with name ‘employeeController‘解决方式。

昨天在IDEA做spring整合mybatis练习的时候出现了一个异常,折腾了一天,最后终于在深夜是含泪解决了。具体的异常代码如下

HTTP Status 500 - Servlet.init() for servlet spring threw exception
type Exception report

message Servlet.init() for servlet spring threw exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet spring threw exception
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2527)
    org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2516)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:748)
root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.atguigu.mybatis.service.EmployeeService com.atguigu.mybatis.controller.EmployeeController.employeeService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atguigu.mybatis.service.EmployeeService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
    org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
    org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
    org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:643)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:606)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:657)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:525)
    org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:466)
    org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    javax.servlet.GenericServlet.init(GenericServlet.java:158)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2527)
    org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2516)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:748)
root cause

org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.atguigu.mybatis.service.EmployeeService com.atguigu.mybatis.controller.EmployeeController.employeeService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atguigu.mybatis.service.EmployeeService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:508)
    org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
    org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
    org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
    org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
    org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:643)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:606)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:657)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:525)
    org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:466)
    org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    javax.servlet.GenericServlet.init(GenericServlet.java:158)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2527)
    org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2516)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:748)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.50 logs.

具体各个块的源码如下(部分不易出错的配置文件和接口等省略):

1.Employmapper接口(略)

2.Employmapper.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="com.atguigu.mybatis.dao.EmployeeMapper">

    <select id="getEmpById" resultType="com.atguigu.mybatis.bean.Employee">
        select * from tbl_employee where id=#{id}
    </select>

    <select id="getEmps" resultType="com.atguigu.mybatis.bean.Employee" >
        select * from tbl_employee
    </select>
</mapper>

3.EmployeeCotroller类

@Controller
public class EmployeeController {

   @Autowired
   EmployeeService employeeService;
   
   @RequestMapping("/getemps")
   public String emps(Map<String,Object> map){
      List<Employee> emps = employeeService.getEmps();
      map.put("allEmps", emps);
      return "list";
   }
}

4.EmployeeService类

@Service
public class EmployeeService {
   @Autowired
   private EmployeeMapper employeeMapper;
   @Autowired
   private SqlSession sqlSession;
   public List<Employee> getEmps(){
      //
      //EmployeeMapper mapper = sqlSession.getMapper(EmployeeMapper.class);
      return employeeMapper.getEmps();
   }
}

5.applicationContext.xml配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://mybatis.org/schema/mybatis-spring
        http://mybatis.org/schema/mybatis-spring-1.2.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-4.0.xsd">

    <!--Spring希望管理所有的业务逻辑组件,也就是Service层等...-->
    <!--<context:component-scan base-package="com.atguigu.mybatis"/>-->
    <!--<context:annotation-config/>-->
    <context:component-scan base-package="com.atguigu.mybatis">
        <context:exclude-filter type="annotation"
                     expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>
    <!--<bean id="mployeeController" class="com.atguigu.mybatis.controller.EmployeeController">-->
    <!--</bean>-->
    <!--引入数据库配置文件-->
    <context:property-placeholder location="classpath:dbconfig.properties"/>
    <!--Spring用来控制业务逻辑。数据源、事务控制、aop-->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="jdbcUrl" value="${jdbc.url}"/>
        <property name="driverClass" value="${jdbc.driver}"/>
        <property name="user" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
     </bean>
    <!--spring事务管理器-->
    <bean id="dataSourceTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <!--开启基于注解的事务-->
    <tx:annotation-driven transaction-manager="dataSourceTransactionManager"/>
    <!--整合mybatis
        目的:1.spring管理所有组件,mapper的是实现类
            service===>Dao          @Autowired:自动注入mapper
            2.spring用来管理事务,spring声明事务
    -->
    <!--创建sqlSessionFactory对象-->
    <bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <!--configLocation指定全局配置文件的位置-->
        <property name="configLocation" value="classpath:mybatis-config.xml"/>
        <!--mapperLocations:指定mapper文件的位置-->
        <property name="mapperLocations" value="classpath:mapper/*.xml"/>
    </bean>

    <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg name="sqlSessionFactory" ref="sqlSessionFactoryBean"/>
        <constructor-arg name="executorType" value="BATCH"></constructor-arg>
    </bean>
    <!--扫描所有的mapper接口的实现,让这些mapper能够自动注入
    base-package:指定mapper接口的包名
    -->
    <mybatis-spring:scan base-package="com.atguigu.mybatis.dao"/>
</beans>

6.spring-servlet.xml配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:mvc="http://www.springframework.org/schema/mvc"
   xsi:schemaLocation="http://www.springframework.org/schema/mvc
   http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
      http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-4.0.xsd">

   <!--SpringMVC只是控制网站跳转逻辑  -->
   <!-- 只扫描控制器 -->
   <context:component-scan base-package="com.atguigu.mybatis.controller" use-default-filters="false">
      <context:include-filter type="annotation"
                        expression="org.springframework.stereotype.Controller"/>
   </context:component-scan>
   
   <!-- 视图解析器 -->
   <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name="prefix" value="/WEB-INF/pages/"></property>
      <property name="suffix" value=".jsp"></property>
   </bean>
   
   <mvc:annotation-driven></mvc:annotation-driven>
   <mvc:default-servlet-handler/>
</beans>

7.mybatis-config.xml配置文件(略)

8.web.xml配置文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">    
<display-name>mybatis_day06_SSM</display-name>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoader</listener-class>
    </listener>

    <!--SpringMVC配置-->
    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <!--<init-param>-->
            <!--<param-name>contextConfigLocation</param-name>-->
            <!--<param-value>classpath:spring-servlet1.xml</param-value>-->
        <!--</init-param>-->
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
          
</web-app>

9.index.jsp(略)

10.list.jsp(略)

        从红色的异常信息大致可以知道:创建名为“employeeController”的bean时出错,自动注入失败。无法自动关联字段:com.atguigu.mybatis.service.EmployeeService com.atguigu.mybatis.controller.EmployeeController.EmployeeService,未找到依赖项类型为[com.atguigu.mybatis.service.EmployeeService]的bean等等,简而言之就是自动注入employeeController以及EmployeeController中的employeeService失败。在度娘和CSND上查找了各位的大佬的处理办法,基本上可以分为以下几类:

(1)是srping ioc自动扫描注解没有写上:

        @Component、@Service、@Controller以及Repository是spring ioc操作bean管理的四个注解,其实际功能都是一样的,都是用来创建bean实例对象的。区别就是@Component是是一种通用形式;@Repository通常应用于Dao持久层,@Service用于Service业务层, @Controller用于控制层。我的练习中@Service对应的EmployeeService、@Controller对应的EmployeeController都有写上注解,所以不会是这个问题。

(2)没有使用Autowired自动装配注解

        这个也不是我的练习的问题的原因。

(3)没有开启注解扫描配置<context:component-scan basePackage=""/>

        在applicationContext.xml配置文件和spring-servlet我都有开启针对于非@Controller注解扫描和@Controller的注解扫描,所以也不会是这个问题。

(4)web.xml没有配置spring的上下文环境和核心的监听器

        在web.xml文件中可以看到我是有配置上下文环境和核心监听器的。
(5)还有说应该在applicationContext.xml和spring-servlet.xml配置文件中添加<context:annotation-config/>,但是看了以下其他大佬的理解说这个配置其实是和<context:component-scan basePackage=""/>配置冲突的,试了一下没有用。

(6)一个接口有多个实现类然后都使用了相同的注解如@Conponent,这个问题时说spring ioc在扫描多个同一接口的实现类并且使用了相同的注解,并且里面设置类属性的属性使用同样的@Autowired注解,当spring创建bean实例的时候,不知道到给哪个实现类创建类里面的类属性的bean实例对象而造成的异常。这个解决方法可以给类的类属性下面使用@Qualifier注解给类属性设置别名,就能解决问题。我这里也没有出现这个问题。

(7)还有大佬说sping的jar包与JDK的版本不匹配,我前段时间采用srping jdbcTemplate操作了一波都没有问题,所以肯定不是这个的问题。

(8)更有大佬说,把Settings里面的Editor-Inspections属性里面的spring-core的Severity的值从error改成warining或者weakwaining,我觉得着像是在掩耳盗铃一样,只是不让他报红的而已,根本没有解决问题。改了也没用,哈哈哈。

(9)还有就是拼写问题啦,建议大家复制,哈哈哈,因为拼写问题查起来真的很蛋疼,不过复制也得注意别的地方是不是有改动啥的,万一前一个模块你多写了几个字母或者是少写了几个字母,直接复制也得改改哈哈哈。

(10)接着就是包的问题了,可能是配置文件说着@Service还有@Controller注解的类不在你设置的注解扫描的包里,肯定也会出问题。另外,eclipse好像有需要把mapper和mapper.xml文件放在同一目录下的要求,不然也会出错。

(11)还有大佬说可能是配置了事务的原因,在两个实现类上同时开启事务,就不能再使用实现类自动生成bean实例了,需要使用接口。我的applicationContext虽然有配置事务,但是EmployeeService和EmployeeController并没有使用事务注解,所以也不会是这个问题。

        说来惭愧,折腾了一天,用以上大佬们遇见的问题的解决方法,对我的异常还是没有能解决,可能是我太粗心了没有认真核对的原因。由于我的学习和练习是在b站上跟着尚硅谷的老师进行学习的,老师使用的是eclipse,而我用的是IDEA。晚上在吃零食的时候突然想到会不会是xml配置文件的头部配置有问题?以前学JavaWeb的时候也出现了这个问题,那时候也是搞了一天多才发现,emmm。想到这里,我立马又新建了一个模块,导入老师给的源码,修改了自己的数据库的配置,运行发现没有问题,突然看到了希望,让我扔掉手里的零食,立马开始一个文件一个文件的检查。最后把目标锁定在了web.xml上,我先替换掉了头部,发现还是不行,然后直接全部替换,果然,在使用老师给的web.xml替换掉我的web.xml后程序就能正常运行了,tomcat也能正常调用我的数据库里面的数据了。好,先看下我的web.xml文件

我的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaeehttp://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"version="4.0">
    <display-name>mybatis_day06_SSM</display-name>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoader</listener-class>
    </listener>
    <!--SpringMVC配置-->
    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <!--<init-param>-->
            <!--<param-name>contextConfigLocation</param-name>-->
            <!--<param-value>classpath:spring-servlet1.xml</param-value>-->
        <!--</init-param>-->
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>

再看老师给的web.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>111</display-name>
  
  <!--Spring配置: needed for ContextLoaderListener -->
   <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:applicationContext.xml</param-value>
   </context-param>

   <!-- Bootstraps the root web application context before servlet initialization -->
   <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
   </listener>
   
   <!-- SpringMVC配置 -->
   <!-- The front controller of this Spring Web application, responsible for handling all application requests -->
   <servlet>
      <servlet-name>spring</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>

   <!-- Map all requests to the DispatcherServlet for handling -->
   <servlet-mapping>
      <servlet-name>spring</servlet-name>
      <url-pattern>/</url-pattern>
   </servlet-mapping>
  
</web-app>

        对比可以看到一个是web_app4.0版本,一个是web_app2.5版本,但是替换头部发现我的还是有问题,说明版本并没有影响。后来终于在下面发现我的ContextLoaderListener监听器少写了个Listener,真的是服了,蓝瘦。。。

        这里我觉得,有些配置能复制就复制,自己写容易出问题。

        以此纪念努力学习的一天!

注:本文中代码出处均来自于尚硅谷教育Mybatis学习视频。

  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值