• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Could not parse configuration: /hibernate.cfg.xml

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Leonardo Terrao
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try opening the xml in IE and check if there are any errors.
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the file in classpath and is it able to find the file?
 
Leonardo Terrao
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I now have a new error and I am trying to solve! any information is welcome!

the new error:

Thank you!
 
Leonardo Terrao
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try setting this property - "hibernate.current_session_context_class" in your configuration file.
This Link might help.
 
Leonardo Terrao
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Arun Kumarr!

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


Now it's working!

The file looks like this:
reply
    Bookmark Topic Watch Topic
  • New Topic