hibernate.cfg.xml<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
  "-//Hibernate/Hibernate Configuration DTD//EN"
  "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><hibernate-configuration>
<session-factory>        <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="connection.url">jdbc:oracle:thin:@localhost:1521:oracle</property>
        <property name="connection.username"></property>
        <property name="connection.password"></property>

<mapping resource="hibernate/po/Login.hbm.xml"/>
</session-factory>
</hibernate-configuration>Login.hbm.xml<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mappong PUBLIC
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourccforgc.net/hibernate mapping-3.0.dtd"><hibernate-configuration>
<class name="hibernate.po.Login" table="login" schema="MYHR">
<id name="userName" type="java.lang.String">
<column name="username" length="20"/>
<gencerator class="assigned"/>
</id>
<property name="passWord" type="java.lang.String">
<column name="password" length="20" not-null="true"/>
</property>
</class>
</hibernate-configuration>

解决方案 »

  1.   

    先检查jar包是否完整,再就是<gencerator class="assigned"/>这句貌似写错了,是你自己写的吗?
      

  2.   

    这个是视频上看的 照着敲的 多了个C  
    还有上面的文档声明也写错了不过已经改过来了
    这个jar包应该不少吧
      

  3.   

    把hibernate的jar都导进去就行了,现在还有错吗
      

  4.   


    我不太会下载,那个是人家给我的 除了slf4j-1.5.2都导进去了 所有的jar包都在上面那个图里面现在还是这个异常
      

  5.   


    我不太会下载,那个是人家给我的 除了slf4j-1.5.2都导进去了 所有的jar包都在上面那个图里面现在还是这个异常你用myeclipse加载hibernate的时候,把那些jar包都勾上就行了,你贴一下完整的异常信息。
      

  6.   


    我不太会下载,那个是人家给我的 除了slf4j-1.5.2都导进去了 所有的jar包都在上面那个图里面现在还是这个异常你用myeclipse加载hibernate的时候,把那些jar包都勾上就行了,你贴一下完整的异常信息。
    0.0我用的是eclipse  老师说新手先用eclipse  不然脱离了MYeclipse集成环境啥都不会了
      

  7.   

    既然是新手,告诉你把
    Login.hbm.xml里的 "http://hibernate.sourccforgc.net/hibernate mapping-3.0.dtd">改为
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      

  8.   

    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD//EN"
      "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE hibernate-mappong PUBLIC
      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourccforgc.net/hibernate mapping-3.0.dtd">文件头你都自己敲吗,谁教你的。是你老师脑袋里有水还是你脑袋里有水。
      

  9.   

    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD//EN"
      "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE hibernate-mappong PUBLIC
      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourccforgc.net/hibernate mapping-3.0.dtd">文件头你都自己敲吗,谁教你的。是你老师脑袋里有水还是你脑袋里有水。
      

  10.   


    0.0自己乱敲的
    Login.hbm.xml <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC
      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforgc.net/hibernate-configuration-3.0.dtd">hibernate.cfg.xml
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">现在这样对了吗
      

  11.   

    谢谢了,现在这样对了吗
    Login.hbm.xml <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC
      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforgc.net/hibernate-configuration-3.0.dtd">hibernate.cfg.xml
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      

  12.   


    上面那个回复错了 Login.hbm.xml已经改过来了