静态初始化异常 。 很无奈 下面日志
十二月 22, 2016 9:29:06 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
十二月 22, 2016 9:29:06 下午 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.0.Final}
十二月 22, 2016 9:29:06 下午 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
十二月 22, 2016 9:29:06 下午 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
十二月 22, 2016 9:29:06 下午 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
十二月 22, 2016 9:29:06 下午 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
十二月 22, 2016 9:29:06 下午 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: com/xn/entity/Grade.hbm.xml
十二月 22, 2016 9:29:06 下午 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!
十二月 22, 2016 9:29:06 下午 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: com/xn/entity/Student.hbm.xml
十二月 22, 2016 9:29:06 下午 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!
十二月 22, 2016 9:29:06 下午 org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
十二月 22, 2016 9:29:06 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
十二月 22, 2016 9:29:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/sgu?useUnicode=true&characterEncoding=utf8]
十二月 22, 2016 9:29:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000046: Connection properties: {user=root, password=****}
十二月 22, 2016 9:29:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000006: Autocommit mode: false
十二月 22, 2016 9:29:07 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
十二月 22, 2016 9:29:07 下午 org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.xn.entity.test.add(test.java:25)
at com.xn.entity.test.main(test.java:13)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/xn/entity/Student.hbm.xml
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3736)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXmlQueue(Configuration.java:3725)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3713)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1410)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
at com.xn.util.hibernateUtil.<clinit>(hibernateUtil.java:19)
... 2 more
Caused by: org.hibernate.MappingException: column attribute may not be used together with <column> subelement
at org.hibernate.cfg.HbmBinder.bindColumns(HbmBinder.java:1117)
at org.hibernate.cfg.HbmBinder.bindColumnsOrFormula(HbmBinder.java:1627)
at org.hibernate.cfg.HbmBinder.bindSimpleValue(HbmBinder.java:1193)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:443)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:386)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:326)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:177)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3733)
... 7 more