Mintondedie
2022-01-21 10:55
采纳率: 100%
浏览 92
已结题

配置文件transactionmanager标红 错误信息: Cannot resolve bean 'transactionManager'


<?xml version="1.0" encoding="UTF-8"?>
<!--suppress SpringFacetInspection -->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
 http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">


    <context:property-placeholder location="database.properties"></context:property-placeholder>
        <bean id="dataSourse" class="com.alibaba.druid.pool.DruidDataSource">
            <property name="driverClassName" value="${driverCLiass}"></property>
            <property name="url" value="${url}"></property>
            <property name="username" value="${user}"></property>
            <property name="password" value="${password}"></property>
        </bean>

        <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
            <property name="dataSource" ref="dataSourse"></property>
        </bean>

        <context:component-scan base-package="com.fan4"></context:component-scan>
        <context:component-scan base-package="com.fan5"></context:component-scan>
        <tx:annotation-driven transaction-manager="transactionManager"></tx:annotation-driven>
</beans>

img

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题