【发布时间】:2011-04-28 10:50:27
【问题描述】:
我在 jboss 上部署 spring 项目时遇到问题。
好吧,问题来了,我在文件 applicationContext.xml 中有这个 bean 定义
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="mappingDirectoryLocations">
<list>
<value>
classpath:tn/com/zuro/ris/domain/hibernate/hbm/
</value>
</list>
</property>
...
我在目录类路径中有 Patient.hbm.xml 文件:tn/com/zuro/ris/domain/hibernate/hbm 当我在 jboss 中部署战争时,我得到了这个错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [tn/com/zuro/ris/domain/hibernate/hbm/] cannot be resolved to absolute file path because it does not reside in the file system: vfsfile:/C:/jboss/server/default/deploy/war-1.0-SNAPSHOT.war/WEB-INF/classes/tn/com/zuro/ris/domain/hibernate/hbm/
【问题讨论】:
标签: java hibernate spring jboss