Java Spring:创建bean时出错

时间:2014-04-26 13:30:41

标签: java eclipse spring hibernate spring-mvc

我在Eclipse中添加了一个spring项目。当我从eclipse在服务器上运行项目时,我收到了这些错误:

Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/myprojectwebsite-servlet.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Unable to load class declared as <mapping class="com.test.myproject.data.User"/> in the configuration:

Caused by: org.hibernate.MappingException: Unable to load class declared as <mapping class="com.test.myproject.data.User"/> in the configuration:

myprojectwebsite-servlet.xml有:

...
<property name="configLocation">
   <value>classpath:hibernate.cfg.xml</value>
</property>
...

和hibernate.cfg.xml包含引发错误的代码:

<mapping class="com.test.myproject.data.User"/>

知道可能出现什么问题吗?

0 个答案:

没有答案