spring junit测试-spring 的beans.xml问题

问题描述

spring 的beans.xml问题

我用JUnit做测试最后出这个问题是怎么回事啊,是不是包引错了?求大神帮助

 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: Integer, at table: questions, for columns: [org.hibernate.mapping.Column(id)]

解决方案

http://www.cnblogs.com/davidwang456/p/4204569.html

解决方案二:

http://www.myjourneyonjava.blogspot.com/2013/12/orghibernatemappingexception-could-not.html

解决方案三:

hibernate 的映射有问题,是不是你的xxx.hbm.xml文件里的数据类型和数据库的没对应好

时间: 2024-09-12 14:27:08

spring junit测试-spring 的beans.xml问题的相关文章

junit-搭建SSM框架进行JUnit测试spring和mybatis整合

问题描述 搭建SSM框架进行JUnit测试spring和mybatis整合 log4j:WARN No such property [converssionPattern] in org.apache.log4j.PatternLayout. log4j:WARN No such property [macFileSize] in org.apache.log4j.RollingFileAppender. [org.springframework.beans.factory.xml.XmlBea

spring junit测试

利用spring的mock类进行单元测试: spring框架提供了大量测试的mock类,包括与jndi,porlet,web应用相关的mock类.尤其是web应用相关 的mock类,可以大大提高web组件测试的方便性. 打开spring的下载包的mock文件夹(路径...mock\org\springframework\mock\web),就发觉有如下几个 文件: MockHttpServletRequest:是HttpServletRequest接口的mock实现,用来模拟客户端的HTTP请求

test-spring4+mybatis3整合 junit测试的问题

问题描述 spring4+mybatis3整合 junit测试的问题 applicationContext.xml <context:component-scan base-package=""com""/> <bean id=""propertyConfigurer"" class=""org.springframework.beans.factory.config.PropertyPl

java spring junit-java junit测试报错找不到自己定义的xml文件 跪求各位高手帮忙解决一下

问题描述 java junit测试报错找不到自己定义的xml文件 跪求各位高手帮忙解决一下 eclipse下junit测试时遇到如下错误,错误内容如下: at jp.co.dgic.eclipse.jdt.internal.junit.runner.DJUnitRunner.main(DJUnitRunner.java:49) caused by:org.springframework.beans.factory. BeanDefinitionStoreException:IoException

mybatis spring 整合 junit测试。 事务不起作用,不提交。删除无效???

问题描述 mybatis spring 整合 junit测试. 事务不起作用,不提交.删除无效??? applicationContext.xml 中的数据库和 sessionFactory以及事务配置 Xml代码 <bean id="bssDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <!-- Connec

spring mvc-springmvc+mybatis tomcat加载时出错,JUNIT测试通过

问题描述 springmvc+mybatis tomcat加载时出错,JUNIT测试通过 springmvc+mybatis tomcat加载时出错,JUNIT测试通过,就是tomcat起不来,请各位大神帮帮忙 十月 25, 2015 6:18:41 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 十月 25

spring配置多数据源t junit测试报错

问题描述 spring配置多数据源t junit测试报错 Error creating bean with name 'seentao.workflow.engine.EngineTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: publi

spring 写junit测试时使用aop报错

问题描述 spring 写junit测试时使用aop报错 当我在我的配置文件中加上如下配置会包下面的错误,我不加时就不会出错这是为什么 <aop:config> <aop:pointcut id="interceptorPointCuts" expression="execution(* cn.qtt.service.*.*(..)) " /> <aop:pointcut id="interceptorPointCutsNew

请教各位高手一个spring下的junit测试问题

问题描述 由于我注入的service里面加载了一些properties等文件,导致出现路径问题使得applicationContext.xml加载不成功.类似:假如我要初始化一个abcService,这个service加载了/web-inf/abc.properties由于正常运行时,初始化abcService需要读取d:eclipse.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappstestPrjWEB-INFabc.prope