问答详情
源自:1-11 通过Hibernate API编写访问数据库的代码

运行时报错,HCANN000001: Hibernate Commons Annotations {4.0.2.Final} HHH000206: hibernate.properties not found HHH000046: Connection properties: {user=root, password=****}

四月 24, 2016 12:38:08 下午 org.hibernate.annotations.common.Version <clinit>

INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}

四月 24, 2016 12:38:08 下午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {4.2.4.Final}

四月 24, 2016 12:38:08 下午 org.hibernate.cfg.Environment <clinit>

INFO: HHH000206: hibernate.properties not found

四月 24, 2016 12:38:08 下午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

四月 24, 2016 12:38:08 下午 org.hibernate.cfg.Configuration configure

INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml

四月 24, 2016 12:38:08 下午 org.hibernate.cfg.Configuration getConfigurationInputStream

INFO: HHH000040: Configuration resource: /hibernate.cfg.xml

四月 24, 2016 12:38:08 下午 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!

四月 24, 2016 12:38:08 下午 org.hibernate.cfg.Configuration addResource

INFO: HHH000221: Reading mappings from resource: Students.hbm.xml

四月 24, 2016 12:38:08 下午 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!

四月 24, 2016 12:38:08 下午 org.hibernate.cfg.Configuration doConfigure

INFO: HHH000041: Configured SessionFactory: null

四月 24, 2016 12:38:08 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)

四月 24, 2016 12:38:08 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000115: Hibernate connection pool size: 20

四月 24, 2016 12:38:08 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000006: Autocommit mode: false

四月 24, 2016 12:38:08 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:///hibernate?useUnicode=true&charcterEncoding=UTF-8]

四月 24, 2016 12:38:08 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000046: Connection properties: {user=root, password=****}

571c5a530001e08a05000181.jpg

571c5a530001270305000216.jpg

571c5a5300011b9305000406.jpg


提问者:长颈鹿在附近 2016-04-24 13:32

个回答

  • 堇延未七
    2016-04-25 09:26:29
    已采纳

    提示的错误:hibernate.properties not found,也就是说你填写的属性信息找不到,

    <property name="connection.url">jdbc:mysql://localhost:3306/hibernate</property>换成这个试试

  • JUST_4_IT
    2016-12-30 15:39:07

    我也碰到了,jdbc:mysql://localhost:3306/hibernate改成这样也不行,

    hibernate.properties not found,就是这个错误

  • 笑问红尘
    2016-04-30 14:14:07

    2016-4-30 14:08:46 org.hibernate.annotations.common.Version <clinit>

    INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}

    2016-4-30 14:08:46 org.hibernate.Version logVersion

    INFO: HHH000412: Hibernate Core {4.2.4.Final}

    2016-4-30 14:08:46 org.hibernate.cfg.Environment <clinit>

    INFO: HHH000206: hibernate.properties not found

    2016-4-30 14:08:46 org.hibernate.cfg.Environment buildBytecodeProvider

    INFO: HHH000021: Bytecode provider name : javassist

    2016-4-30 14:08:46 org.hibernate.cfg.Configuration configure

    INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml

    2016-4-30 14:08:46 org.hibernate.cfg.Configuration getConfigurationInputStream

    INFO: HHH000040: Configuration resource: /hibernate.cfg.xml

    2016-4-30 14:08:47 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!

    2016-4-30 14:08:47 org.hibernate.cfg.Configuration addResource

    INFO: HHH000221: Reading mappings from resource: Teachers/hbm.xml


  • 堇延未七
    2016-04-25 11:21:25

    mysql JDBC URL格式如下:jdbc:mysql://[host:port],[host:port].../[database][?参数名1][=参数值1][&参数名2][=参数值2]...既然三条斜杠是简写 应该是省略了[host:post]参数吧

  • 长颈鹿在附近
    2016-04-25 09:32:52

    昨天试的时候不知道怎样的突然就通过了,这样的写法与简写有什么区别吗?