-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: problem parsing configuration/hibernate.cfg.xml
PostPosted: Mon Nov 21, 2005 8:22 am 
Newbie

Joined: Mon Nov 21, 2005 7:08 am
Posts: 1
Location: India
Hi all,

I am getting the parsing error even after changing the DOCTYPE tag and
jdom jars.

I am using hibernate 3.0.5.
My mapping document looks like this,

<?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.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.177.5:1590:ora92db</property>
<property name="hibernate.connection.username">UserName</property>
<property name="hibernate.connection.password">****</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>
<property name="hibernate.hbm2ddl.auto">update</property>

<mapping resource="company.hbm.xml"/>

</session-factory>

</hibernate-configuration>



Stack Trace:

7:50:42,715 ERROR Configuration:1172 - problem parsing configuration/hibernate.cfg.xml
org.dom4j.DocumentException: Connection refused: connect Nested exception: Connection refused: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
at com.saravana.HibernateUtil.<clinit>(HibernateUtil.java:11)
at com.saravana.CompanyController.main(CompanyController.java:15)
Nested exception:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:512)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:489)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:617)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
at com.saravana.HibernateUtil.<clinit>(HibernateUtil.java:11)
at com.saravana.CompanyController.main(CompanyController.java:15)
org.hibernate.HibernateException: problem parsing configuration/hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1173)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
at com.saravana.HibernateUtil.<clinit>(HibernateUtil.java:11)
at com.saravana.CompanyController.main(CompanyController.java:15)
Caused by: org.dom4j.DocumentException: Connection refused: connect Nested exception: Connection refused: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
... 4 more
Initial SessionFactory creation failed.org.hibernate.HibernateException: problem parsing configuration/hibernate.cfg.xml
java.lang.ExceptionInInitializerError
at com.saravana.HibernateUtil.<clinit>(HibernateUtil.java:16)
at com.saravana.CompanyController.main(CompanyController.java:15)
Caused by: org.hibernate.HibernateException: problem parsing configuration/hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1173)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
at com.saravana.HibernateUtil.<clinit>(HibernateUtil.java:11)
... 1 more
Caused by: org.dom4j.DocumentException: Connection refused: connect Nested exception: Connection refused: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
... 4 more
Exception in thread "main"

_________________
β€œIn three words I can sum up everything I've learned about life: it goes on.” – Robert Frost


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 8:25 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Quote:
Nested exception:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)


Hi,

this looks more like a connection problem,
maybe user id or password wrong.
Did you try opening a connection with plain
jdbc ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 9:37 am 
Regular
Regular

Joined: Sat Nov 05, 2005 5:33 am
Posts: 70
Location: Linz, Austria
Have you left the DTD definition at the standard of http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd?
AFAIK, then your computer has to be able to access this file via the internet.

Maybe you have http blocked on the computer you tested on?

_________________
hth,
Heinz
Don't forget to rate if this helped


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 10:10 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Please forget my previous posting.
hhuber is right.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 10:15 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
No, he is not.

http://www.hibernate.org/116.html#A33


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 10:18 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
the URL: http://hibernate.sourceforge.net/hibern ... on-3.0.dtd
is resolved in
DTDEntityResolver.resolveEntity

The class is in hibernate3.jar
Can you try to debug this function ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.