0
У меня есть создать проект Hibernate приложений, но я получаю следующее сообщение об ошибке, когда я запустить программуHibernate программа дает ошибку
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
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 org.hibernate.cfg.Configuration.configure(Configuration.java:1411)
at SimpleTest.main(SimpleTest.java:11)
Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1481)
... 3 more
Ниже мой файл hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@127.0.0.1:1521:xe</property>
<property name="hibernate.connection.username">sys</property>
<property name="hibernate.connection.password">newpassword</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.default_schema">sys</property>
<property name="show_sql">true</property>
<mapping resource="emp.hbm.xml"></mapping>
</session-factory>
</hibernate-configuration>
Вы могли бы объяснить, какой конкретный вопрос у вас есть относительно этой ошибки? – Lexi
Когда я пытаюсь запустить приложение hibernate, я получаю это исключение – Sawyer
Пожалуйста, посмотрите, поможет ли это: http://stackoverflow.com/questions/23681589/exceptioncould-not-parse-configuration-hibernate-cfg-xml – zmf