Hi Everyone,
I am a beginner in hibernate and I am trying to write my first application but I am getting an error saying "
Could not parse configuration: hibernate.cfg.xml" and I have been try to resolve this from last 2 days but with no success
Can anyone please help me in resolving this issue. Thanks in advance
my hibernate.cfg.xml file
<?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.hbm2ddl.auto">update</property>
<property name="dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="connection.url">
jdbc:sqlserver://isvdbd3:1119</property>
<property name="connection.username">digite</property>
<property name="connection.password">marksession</property>
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="current_session_context_class">
thread</property>
<mapping resource="employee.hbm.xml"/>
</session-factory>
</hibernate-configuration>
I am using MS sql as my database
Error stack trace is as below
Exception in thread "main" org.hibernate.HibernateException: Could not parse configuration: hibernate.cfg.xml
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:13)
Caused by: org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1481)
... 2 more
Someone please let know
Regards,
Deepak