简体   繁体   中英

Error shown when creating Hibernate project in Eclipse

Currently I am learning hibernate.I am trying to create a project on hibernate in eclipse.In hibernate.cfg.xml, it shows warning.."stream not available"

hibernate.cfg.xml:

  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE hibernate-configuration PUBLIC
 "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 <hibernate-configuration>
  <session-factory name="studentFactory">
    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="connection.url">jdbc:mysql://localhost/nithya</property>
    <property name="connection.username">root</property>
    <property name="connection.password">root</property>
    <property name="connection.pool_size">5</property>   
    <property name="dialect">org.hibernate.dialect.mysqlDialect</property>  
    <property name="show_sql">false</property>
    <property name="hbm2ddl.auto">update</property>
    <mapping resource="\com\\xmls\\Student.hbm.xml" />
 </session-factory>

the warning line is... " http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd ">

anybody help me to overcome it and also suggest best ways to learn and create hibernate projects.. Thanks in advance..

Use this in your hibernate.cfg.xml

   <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

instead of

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM