第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

hibernated.cfg.xml報(bào)錯(cuò)問(wèn)題,快崩潰了。。。

兩個(gè)hibernate.cfg.xml文件一模一樣,可是一個(gè)總是報(bào)錯(cuò),另外一個(gè)就沒(méi)報(bào)錯(cuò)可以正常運(yùn)行,我把兩個(gè)文件一個(gè)單詞一個(gè)單詞的對(duì)照實(shí)在是照找不出錯(cuò)誤,求大神幫忙看下。

文件A

<?xml?version="1.0"?encoding="UTF-8"?>
<!DOCTYPE?hibernate-configuration?PUBLIC?
	"-//Hibernate/Hibernate?Configuration?DTD?3.0//EN"?
	"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
	<session-factory>
		<property?name="hibernate.connection.username">root</property>		
????????<property?name="hibernate.connection.password"></property>??????????????
????????<property?name="hibernate.connection.url">
????????	<![CDATA[
????????		jdbc:mysql://localhost:3306/webdata?useUnicode=true&characterEncoding=utf8
????????	]]>
????????</property>
????????
		<property?name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
????????<property?name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
????????
		<property?name="show_sql">true</property>
????????<property?name="hbm2ddl.auto">update</property>
????????
????????<mapping?resource="com/bart/entity/Seller.hbm.xml"/>
????????<mapping?resource="com/bart/entity/Student.hbm.xml"/>
	</session-factory>
</hibernate-configuration>

文件B:

<?xml?version="1.0"?encoding="UTF-8"?>
<!DOCTYPE?hibernate-configuration?PUBLIC?
"-//Hibernate/Hibernate?Configuration?DTD?3.0//EN"?
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"?>
<hibernate-configuration>
??<session-factory>
??	<property?name="hibernate.connection.username">root</property>
????????<property?name="hibernate.connection.password"></property>
????????<property?name="hibernate.connection.url">
????????	<![CDATA[
????????		jdbc:mysql://localhost:3306/webdata?useUnicode=true&characterEncoding=utf8
????????	]]>
????????</property>
????????<property?name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
????????<property?name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
????????
????????<property?name="show_sql">true</property>
????????<property?name="hbm2ddl.auto">update</property>
????
????	<!--?指定映射文件的路徑?-->
????	<mapping?resource="com/bart/entity/Student.hbm.xml"/>
??</session-factory>
</hibernate-configuration>

這時(shí)A和B的內(nèi)容,A一直報(bào)錯(cuò),我全選A文件刪除然后粘貼為B文件就不報(bào)錯(cuò)了。太奇怪了。。。開發(fā)環(huán)境是MyEclipse 10,Hibernate包是4.3的

報(bào)錯(cuò)信息:

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-9-18 12:45:13 org.hibernate.cfg.Configuration addResource

INFO: HHH000221: Reading mappings from resource: com/bart/entity/Seller.hbm.xml

2016-9-18 12:45:13 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 in thread "main" java.lang.ExceptionInInitializerError

at com.bart.test.Test01.add(Test01.java:26)

at com.bart.test.Test01.main(Test01.java:14)

Caused by: org.hibernate.InvalidMappingException: Unable to read XML

at org.hibernate.internal.util.xml.MappingReader.legacyReadMappingDocument(MappingReader.java:375)

at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:304)

at org.hibernate.cfg.Configuration.add(Configuration.java:516)

at org.hibernate.cfg.Configuration.add(Configuration.java:512)

at org.hibernate.cfg.Configuration.add(Configuration.java:686)

at org.hibernate.cfg.Configuration.addResource(Configuration.java:769)

at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2255)

at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2227)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2207)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2160)

at org.hibernate.cfg.Configuration.configure(Configuration.java:2075)

at org.hibernate.cfg.Configuration.configure(Configuration.java:2054)

at com.bart.util.HibernateUtil.<clinit>(HibernateUtil.java:20)

... 2 more

Caused by: org.dom4j.DocumentException: Error on line 8 of document ?: Attribute name "column" associated with an element type "id" must be followed by the ' = ' character. Nested exception: Attribute name "column" associated with an element type "id" must be followed by the ' = ' character.

at org.dom4j.io.SAXReader.read(SAXReader.java:482)

at org.hibernate.internal.util.xml.MappingReader.legacyReadMappingDocument(MappingReader.java:325)

... 14 more


正在回答

1 回答

終于找到問(wèn)題所在了。。。粗心粗心粗心?。?!

A文件比B文件多了一個(gè)mapping resource

<mapping?resource="com/bart/entity/Seller.hbm.xml"/>

敲好Seller.hbm.xml文件出錯(cuò)。。導(dǎo)致報(bào)錯(cuò)。。。

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Mark_G 提問(wèn)者

去掉<mapping resource="com/bart/entity/Seller.hbm.xml"/>后A文件和B文件一樣正確運(yùn)行了。。。因?yàn)镾essionFactory在解析hibernate.cfg.xml文件的時(shí)候會(huì)解析里面 的 所有的<mapping resource=“XXX”>標(biāo)簽的源文件,如果有一個(gè)出錯(cuò),就會(huì)報(bào)錯(cuò)的
2016-09-18 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

hibernated.cfg.xml報(bào)錯(cuò)問(wèn)題,快崩潰了。。。

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)