jackmot 2012-02-19 12:47
浏览 194
已采纳

hibernate的问题

我在写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

  • 写回答

4条回答 默认 最新

  • ll89308839 2012-02-20 09:10
    关注

    是不是没有把编译文件放过去
    提示找不到entiy实体类的对象

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误