我在写User.hbm.xml时这样配置(包是com.hyctl.hibernate.beans,类名未User,对应的表名是user的属性都没错)。
<class name="User" table="user">
<id name="id" column="ID" type="integer">
<generator class="increment"/>
</id>
<property name="username" column="username" type="string" />
<property name="password" column="password" type="string" />
<property name="email" column="email" type="string" />
</class>
但是在跑起来是却出现了以下的异常,什么原因啊?我在另一台机器上是可以跑的,但代码放到另一台机器就不行了。
2012-2-19 11:42:59 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
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 org.hibernate.MappingException: entity class not found: com.hyctl.hibernate.beans.User
Caused by: org.hibernate.MappingException: entity class not found: com.hyctl.hibernate.beans.User