新手入Hibernate遇hibernate.properties not found一直无法解决
你的教官 2017-02-11 04:46:02 配置环境
Eclipse Mars 4.5.2
Hibernate 5.x
Mysql
Hibernate Tools 4.3.1
用JUnit4运行测试类时一直失败,控制台报:
二月 11, 2017 4:35:27 下午 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {5.2.2.Final}
二月 11, 2017 4:35:27 下午 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
二月 11, 2017 4:35:27 下午 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
二月 11, 2017 4:35:27 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
下面给出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">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">123456</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.hbm2ddl.auto">create</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
真心搞不定,猜测是控制台报的hibernate.properties not found 引起的