signed

QiShunwang

“诚信为本、客户至上”

Property or field ‘jdbc‘ cannot be found on object of type ‘org.springframework.beans.factory.config

2021/3/21 0:16:33   来源:

Property or field ‘jdbc’ cannot be found on object of type ‘org.springframework.beans.factory.config.BeanExpressionContext’ - maybe not public or not valid?在这里插入图片描述

错误:

<!--    2.加载了配置文件后还需要将里面的数据变成druid对象,,,,,加载druid对象【第三方的资源】-->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
    <property name="driverClassName" value="#{jdbc.driver}"/>
    <property name="url" value="#{jdbc.url}"/>
    <property name="username" value="#{jdbc.username}"/>
    <property name="password" value="#{jdbc.password}"/>
</bean>

正确的:

<!--    2.加载了配置文件后还需要将里面的数据变成druid对象,,,,,加载druid对象【第三方的资源】-->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
    <property name="driverClassName" value="${jdbc.driver}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
</bean>