2017-06-16 2 views
0

ci-dessous sont les détails d'exception je suis arrivé:Je reçois exception « Impossible d'analyser la configuration »

Exception in thread "main" org.hibernate.HibernateException: Could not        
     parse configuration:<br> 
     <br> hibernate.cfg.xml<br><br> 
     at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1491) 
     at org.hibernate.cfg.Configuration.configure(Configuration.java:1425) 
     at com.javatpoint.mypackage.StoreData.main(StoreData.java:14)<br> 
     Caused by: org.dom4j.DocumentException:Read timed out Nested exception: 
     Read timed out<br> <br> 
     at org.dom4j.io.SAXReader.read(SAXReader.java:484)<br> 
     at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1481) 
     <br> 
     ... 2 more 

C'est hibernate.hbm.xml je codé. J'utilise MySQL à travers XAMPP comme backend. Pourriez-vous s'il vous plaît aider à résoudre cela? 'hr' est le nom de la base de données que j'utilise. le nom d'utilisateur est root.password est laissé vide.

<!-- Generated by MyEclipse Hibernate Tools.     --> 
<hibernate-configuration> 
<session-factory> 
<property name="hbm2ddl.auto">update</property> 
<property name="dialect">org.hibernate.dialect.MySQLDialect</property> 
<propertyname="connection.url">jdbc:mysql://localhost:3306/hr</property> 
<property name="connection.username">root</property>  
<property name="connection.password"></property>  
<property 
name="connection.driver_class">com.mysql.jdbc.Driver</property> 
<mapping resource="employee.hbm.xml"/> 
</session-factory> 
</hibernate-configuration> 
+0

I ajouté DTD ... encore obtenu la même erreur –

Répondre

1

Il y a une faute de frappe dans votre fichier hibernate.cfg.xml: un espace est manquant entre le nom de la balise property et le nom d'attribut name. Modifiez cette ligne:

<propertyname="connection.url">jdbc:mysql://localhost:3306/hr</property> 

à ceci:

<property name="connection.url">jdbc:mysql://localhost:3306/hr</property> 
+0

Merci pour l'aide. Ça a marché. –