Code Bye

Intellij idea 提示SessionFactory 没有类型匹配,不能注入

错误提示信息: could not autowire. no beans of “”sessionfactory”” type found 

下面是我的sessionFactory的配置:
 

<bean id="sessionFactory" autowire="byName" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <!--<property name="mappingLocations">-->
            <!--<list>-->
                <!--<value>classpath:hbm/Channel.hbm.xml</value>-->
            <!--</list>-->
        <!--</property>-->
        <property name="packagesToScan" value="com.jamorn.entity"/>
        <property name="namingStrategy" ref="namingStrategy" />
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
                <prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
                <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
                <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
            </props>
        </property>
    </bean>

40分
你的hibernate是版本4???
我也遇到一模一样的问题呀,楼主问题解决没~~~  求帮助呀

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Intellij idea 提示SessionFactory 没有类型匹配,不能注入