spring4 整合 hibernate时 产生HibernateTemplate报错

问题描述

spring4 整合 hibernate时 产生HibernateTemplate报错

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/web-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController' defined in ServletContext resource [/WEB-INF/web-config.xml]: Cannot resolve reference to bean 'userService' while setting bean property 'userService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in ServletContext resource [/WEB-INF/service-config.xml]: Cannot resolve reference to bean 'userDao' while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in ServletContext resource [/WEB-INF/dao-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.orm.hibernate4.HibernateTemplate' to required type 'org.springframework.orm.hibernate3.HibernateTemplate' for property 'hibernateTemplate'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.orm.hibernate4.HibernateTemplate] to required type [org.springframework.orm.hibernate3.HibernateTemplate] for property 'hibernateTemplate': no matching editors or conversion strategy found

解决方案

no matching editors or conversion strategy found//没有发现匹配的编辑器或版本策略。
可能是版本不匹配。
你看看你的配置有没有错误,没有错误就大概是这个问题了

解决方案二:

'urlMapping' 这没有在web-config.xml中配置bean

时间: 2024-08-31 17:14:33

spring4 整合 hibernate时 产生HibernateTemplate报错的相关文章

求解:整合SSH时关闭tomcat报错

问题描述 在spring的配置文件中,我用的是c3p0数据源bean的配置加上了destroy-method="close",关闭tomcat时就报错了,说缺少包,可是jar包明明已经导入了.但是去掉destroy-method="close"这部分就好了,这是怎么了错误信息如下:信息:Illegalaccess:thiswebapplicationinstancehasbeenstoppedalready.Couldnotloadcom.mchange.v2.re

ssh整合-spring整合hibernate做测试时没有报错,当三个整合时启动就报错啦,求大神指点!!

问题描述 spring整合hibernate做测试时没有报错,当三个整合时启动就报错啦,求大神指点!! 报的错误org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'ecsUnsigned' on target class [class $Proxy17] failed; nested exception is org.springframework.tran

接口-在上传图文消息素材时,总报错说是不合法的媒体文件id,不知道什么才是正确的id呢

问题描述 在上传图文消息素材时,总报错说是不合法的媒体文件id,不知道什么才是正确的id呢 package main;import java.util.ArrayList;import java.util.List;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import pojo.AccessToken;import pojo.Article;import pojo.Articles;import util.WeixinUtil

spring-mvc和mybatis整合DruidDataSource配置连接池报错

问题描述 spring-mvc和mybatis整合DruidDataSource配置连接池报错 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dynamicDatasourceAspect' defined in file [D:workspace.metadata.pluginsorg.eclipse.wst.server.coretmp1wtpwebappsdm_

jsp页面访问带有空格的路径的文件时,会报错?

问题描述 jsp页面访问带有空格的路径的文件时,会报错? 解决方案 单例模式?可能会出错,但是你首先考虑路径是否正确. 解决方案二: 这是命名要求的把!一般命名不能有空格 解决方案三: 你的propertise文件没有找到,你执行IO操作的时候,路径错了 解决方案四: 我把tomcate的路径换到没有空格的文件夹下面,重新配环境变量就好了,,谨记 解决方案五: 我把tomcate的路径换到没有空格的文件夹下面,重新配环境变量就好了,,谨记

nodejs 判断 数组为空的 json数据时,一直报错undefined

问题描述 nodejs 判断 数组为空的 json数据时,一直报错undefined 对不起各位大神,请不要恨铁不成钢,我真心不懂这个简单的初级问题. 我自己在做一个API小程序,用nodejs的request包抓取了许多json数据. 问题简单的来说就是,我需要判断一个有时候有数值,有时候却为空的属性,属性名为deliverTime, 当deliverTime存在的时候,抓取这个json属性,当deliverTime不存在的时候,不抓取. 然而,如果我的判断语句为: if(body.data.

c#-C#仿QQ聊天的代码。在打开聊天窗口并输入聊天内容执行发送时,程序报错

问题描述 C#仿QQ聊天的代码.在打开聊天窗口并输入聊天内容执行发送时,程序报错 这是一段仿QQ聊天的代码.在打开聊天窗口并输入聊天内容执行发送时,程序报错: 参数化查询 '(@FromUserId int,@ToUserId int,@Message nvarchar(1),@MessageType' 需要参数 '@MessageState',但未提供该参数. 错误详细信息为: 未处理 System.Data.SqlClient.SqlException Message="参数化查询 '(@F

linux下php添加mysqli拓展库时,编译报错

问题描述 linux下php添加mysqli拓展库时,编译报错 php和mysql都是已经编译安装好了,现在想要给php添加mysqli 拓展库,结果在make的时候报错 cd /usr/local/src/php-5.6.19/ext/mysqli /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/local/mysql/bin/mys

下面的代码为什么出错?该怎么去改?数据库中设置的允许为NULL,但不输入值时为什么会报错?

问题描述 下面的代码为什么出错?该怎么去改?数据库中设置的允许为NULL,但不输入值时为什么会报错? 解决方案 看下output窗格输出的错误提示,你的empAge是什么类型?是int?还是int,如果是int不能接收null