【新手求助】hibernate4问题
我从帮助文档copy下来的xml配置文件,居然出错。想问下各位大神能不能解答我的问题。程序代码:
<?xml version='1.0' encoding='utf-8'?> <hibernate-configuration xmlns="http://www. xsi:schemaLocation="http://www. hibernate-configuration-4.0.xsd" xmlns:xsi="http://www. <!-- Database connection settings --> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://192.168.1.102:3306/hibernate</property> <property name="connection.username">root</property> <property name="connection.password">25358318</property> <!-- JDBC connection pool (use the built-in) --> <!-- <property name="connection.pool_size">1</property> --> <!-- SQL dialect --> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <!-- Enable Hibernate's automatic session context management --> <property name="current_session_context_class">thread</property> <!-- Disable the second-level cache --> <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property> <!-- Echo all executed SQL to stdout --> <property name="show_sql">true</property> <!-- Drop and re-create the database schema on startup --> <!-- <property name="hbm2ddl.auto">update</property> --> <mapping resource="com/jun/hibernate/bean/Student.hbm.xml"/> </session-factory> </hibernate-configuration>
四月 18, 2013 10:43:57 下午 org.hibernate. <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
四月 18, 2013 10:43:57 下午 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.2.0.Final}
四月 18, 2013 10:43:57 下午 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
四月 18, 2013 10:43:57 下午 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
四月 18, 2013 10:43:57 下午 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
四月 18, 2013 10:43:57 下午 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
Exception in thread "main" org.hibernate.MappingException: invalid configuration
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2018)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1935)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1914)
at StudentTest.main(StudentTest.java:16)
Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 25; 文档无效: 找不到语法。
at com.(ErrorHandlerWrapper.java:198)
at com.(ErrorHandlerWrapper.java:134)
at com.(XMLErrorReporter.java:437)
at com.(XMLErrorReporter.java:368)
at com.(XMLErrorReporter.java:325)
at com.(XMLNSDocumentScannerImpl.java:226)
at com.(XMLNSDocumentScannerImpl.java:602)
at com.(XMLDocumentFragmentScannerImpl.java:3065)
at com.(XMLDocumentScannerImpl.java:881)
at com.(XMLDocumentScannerImpl.java:607)
at com.(XMLNSDocumentScannerImpl.java:116)
at com.(XMLDocumentFragmentScannerImpl.java:489)
at com.(XML11Configuration.java:835)
at com.(XML11Configuration.java:764)
at com.(XMLParser.java:123)
at com.(AbstractSAXParser.java:1210)
at com.(SAXParserImpl.java:568)
at org.(SAXReader.java:465)
at org.hi