-->
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.  [ 5 posts ] 
Author Message
 Post subject: An I/O error occurred while parsing file hibernate.cfg.xml
PostPosted: Mon Feb 05, 2007 1:13 pm 
Newbie

Joined: Tue May 02, 2006 1:59 pm
Posts: 17
Location: California
Hello all,

I am using hibernate version 3. To load the config from the hibernate.cfg.xml, I using this strategy :

sessionFactory = new Configuration().configure($$location of the hibernate config file$$).buildSessionFactory();

I am getting this exception :

An I/O error occurred while parsing file: /app/config/hibernate.cfg.xml; nested exception is:
java.lang.Exception: An I/O error occurred while parsing file: /app/config/hibernate.cfg.xml


This issue is seen on some of my machines and some machines it works smoothly. Is it because of some DTD issue. Hibernate is already on the classpath.

Is this a classpath issue? I have tried the other way of initializing the sessionFactory (placing the hibernate config file on the classpath), this approach works fine for me. But at my company we dont want to go by thpalcing the config file on the classpath, so stuck with the I/O parse error.

Any help/ clues will be helpful.

Thanks
Shobhana

_________________
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 05, 2007 3:32 pm 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
It kinda looks like it's a classpath issue. You mentioned that if you place the hibernate.cfg.xml in a folder that you know is in the classpath of your app, it works fine.

One of the reasons that it works on some machines (and not others) is that the path "/app/config" might already be included in a $CLASSPATH environment variable.

Have you tried explicitly including "/app/config" in the classpath of your app?

You can also try to print out the classpath used by your app using System.getProperty("java.class.path");

Good Luck.

Budyanto


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 05, 2007 5:42 pm 
Newbie

Joined: Tue May 02, 2006 1:59 pm
Posts: 17
Location: California
That doesnt seem to work. The hibernate config folder(where the config file is ) is on classpath now.

Get the same exception.

Thanks
SHobhana

_________________
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 05, 2007 11:13 pm 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
Hi shobhanakirtane,

Plz.. check your cfg file which has several tag which cfg file doesn’t support .

_________________
Dharmendra Pandey


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 06, 2007 12:22 am 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
Can you post the xml file? Hopefully it's not too complex.

Budyanto


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.