这个是本人配置的sessionFactory <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>classpath*:/com/heping/oa/entity/main/hbm/*.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.show_sql=true
</value>
</property>
</bean>
当执行 mvn clean test时候 出现 异常信息如下:
]
Tests in error:
testSessionFactory(com.heping.oa.hibernate.SpringHibernateTest): Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [classpath:/com/heping/oa/entity/main/hbm/Hospital.hbm.xml] cannot be opened because it does not existTests run: 1, Failures: 0, Errors: 1, Skipped: 0本人疑问,我这个配置方法是否有问题,因为我这个配置是照抄之前项目的,之前版本是hibernate3.3 现在版本是4.17 如果这样配置是错误的,帮忙说下 该怎么写?hibernate
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>classpath*:/com/heping/oa/entity/main/hbm/*.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.show_sql=true
</value>
</property>
</bean>
当执行 mvn clean test时候 出现 异常信息如下:
]
Tests in error:
testSessionFactory(com.heping.oa.hibernate.SpringHibernateTest): Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [classpath:/com/heping/oa/entity/main/hbm/Hospital.hbm.xml] cannot be opened because it does not existTests run: 1, Failures: 0, Errors: 1, Skipped: 0本人疑问,我这个配置方法是否有问题,因为我这个配置是照抄之前项目的,之前版本是hibernate3.3 现在版本是4.17 如果这样配置是错误的,帮忙说下 该怎么写?hibernate
解决方案 »
- JavaEE开发中的缓存问题
- 一个数字的二进制字符串形式,如何转换为一个byte[],因为要存进数据库中定义为binary的字段里。
- j2ee面试题
- 测试数据库连接池问题
- RMI调用的事务问题
- 比较基础的问题,希望大峡门进来帮帮我??
- 问个数据库连接与性能,缓存方面的问题!求高人指点
- 有没有介绍turbine和velocity的书?
- 关于JBUILDER8的问题!!!!!!!!!!!!!!!!!!!!!!!!
- spring + jspsmartupload 一直有空指针异常怎么处理?
- Struts2遇到了一个问题,解决不了了,希望各位帮帮忙
- 关于JQuery easyUI的datagrid问题
<value>com/heping/oa/entity/main/hbm/XXX.hbm.xml</value>
<value>com/heping/oa/entity/main/hbm/XXX.hbm.xml</value>
<value>com/heping/oa/entity/main/hbm/XXX.hbm.xml</value>
<value>com/heping/oa/entity/main/hbm/XXX.hbm.xml</value>
</list> 别懒,一个个的都敲进去。