This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Could not parse configuration: /hibernate.cfg.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Could not parse configuration: /hibernate.cfg.xml" Watch "Could not parse configuration: /hibernate.cfg.xml" New topic
Author

Could not parse configuration: /hibernate.cfg.xml

Leonardo Terrao
Greenhorn

Joined: Oct 13, 2011
Posts: 15
Hi all,
I know little about hibernate, and then decided to explore this framework and came across an error!

Could anyone help me?

My application is returning me the following error:


Here is my hibernate.cfg.xml:


Mapping (Cadastro.hbm.xml):


Thank you guys!
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

Sometimes, is the XML declaration which you do in the first 3 or 4 lines contains an extra space or some extra character, it's possible that you might get this error.
Also your properties in HBM files have no mapped columns. Is that okay? I'm not sure about that. It's been long time since I worked in hibernate.


If you are not laughing at yourself, then you just didn't get the joke.
Leonardo Terrao
Greenhorn

Joined: Oct 13, 2011
Posts: 15
In other research found that people resolvero your problem by removing a blank header but already checked mine and found nothing that is strange. I added the columns in my HBM and still continue with the error. I'm lost

Thank you!

Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

Try opening the xml in IE and check if there are any errors.
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

Is the file in classpath and is it able to find the file?
Leonardo Terrao
Greenhorn

Joined: Oct 13, 2011
Posts: 15
I tried a little more and got out the error!

I changed the link in the header
The configuration file looks like this (hibernate.cfg.xml):
by:
and hbm.xml
by:
Leonardo Terrao
Greenhorn

Joined: Oct 13, 2011
Posts: 15
I now have a new error and I am trying to solve! any information is welcome!

the new error:

Thank you!
Leonardo Terrao
Greenhorn

Joined: Oct 13, 2011
Posts: 15
Resolvido!

Estava faltando um JAR.
Importei o: javassist-3.12.0.GA.jar.

New error!


I'm trying to solve here!

Thank you!
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

try setting this property - "hibernate.current_session_context_class" in your configuration file.
This Link might help.
Leonardo Terrao
Greenhorn

Joined: Oct 13, 2011
Posts: 15
Thanks Arun Kumarr!

I added the following lines in my hibernate.cfg.xml:


Now it's working!

The file looks like this:
 
jQuery in Action, 2nd edition
 
subject: Could not parse configuration: /hibernate.cfg.xml