如何使用hibernate填充MySql数据库?
我从Hibernate开始,先看一下这个示例。但这是调试控制台中的信息,我认为这与配置文件有关,因为调用configure方法时会抛出异常如何使用hibernate填充MySql数据库?,mysql,hibernate,Mysql,Hibernate,我从Hibernate开始,先看一下这个示例。但这是调试控制台中的信息,我认为这与配置文件有关,因为调用configure方法时会抛出异常 debug: Feb 24, 2015 11:53:50 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit> INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final
debug:
Feb 24, 2015 11:53:50 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
Feb 24, 2015 11:53:50 AM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.1.Final}
Feb 24, 2015 11:53:50 AM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Feb 24, 2015 11:53:50 AM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Feb 24, 2015 11:53:51 AM org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: hibernate.cfg.xml
Feb 24, 2015 11:53:51 AM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: hibernate.cfg.xml
Feb 24, 2015 11:53:51 AM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
Feb 24, 2015 11:53:51 AM org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: hibernate.hbm.xml
Feb 24, 2015 11:53:52 AM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
Exception Thrown org.hibernate.InvalidMappingException: Unable to read XML
Exception in thread "main" java.lang.NullPointerException
at hellomain.main(hellomain.java:46)
Java Result: 1
BUILD SUCCESSFUL (total time: 15 seconds)
Confg文件:
org.hibernate.dialogue.mysqldialogue
com.mysql.jdbc.Driver
jdbc:mysql://localhost:3306/hibernate
根
映射文件:
org.hibernate.InvalidMappingException:无法读取xml是异常thrownorg.hibernate.InvalidMappingException:无法读取xml是异常thrown@Tiny我已经编辑了堆栈跟踪