Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6104923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:53:53+00:00 2026-05-23T13:53:53+00:00

I´ve just started playing around with Java and Hibernate and have gotten an application

  • 0

I´ve just started playing around with Java and Hibernate and have gotten an application working. Everything works “perfectly” when I run it from eclipse but when I use Eclipse builtin function for packaging the project with dependencies into a jar files I get:

org.hibernate.InvalidMappingException: Unable to read XML
        at org.hibernate.util.xml.MappingReader.readMappingDocument(MappingReader.java:101)
        at org.hibernate.cfg.Configuration.add(Configuration.java:510)
        at org.hibernate.cfg.Configuration.add(Configuration.java:506)
        at org.hibernate.cfg.Configuration.add(Configuration.java:686)
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:771)
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2314)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2280)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2260)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2213)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:2128)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:2107)
        at myPackage.MyClass.setUp(MyClass.java:89)

The hibernate.cfg.xml and mapping.hbm.xml are both located directly in the src folder. Tthe “link” between them is:

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

In the resulting jar-file they both end up in the root.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:53:53+00:00Added an answer on May 23, 2026 at 1:53 pm

    Your message could have several explanations regarding XML validity.

    In my case, I had the same problem the whole day but with a legacy application, so it couldn’t be invalid. I just realized that there were a crash in my classpath so dfc.jar file was interfering with Hibernate when reading XML mappings.

    In your case it could be a question of XML validity (as you can see all around the web), or another JAR file interfering your classpath as in my case.

    I hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started playing around with the WPF RibbonControl library from Microsoft (October 2010
I have just started playing around with using Dojo in Zend Framework and things
I have just started playing around with Log4Net... I now want to send an
I have no experience at all with OpenGL and just started playing around with
I'm learning Java and just started playing around with mysql and am having a
Have just started playing with ASP.NET MVC and have stumbled over the following situation.
I have just started playing with the ASP.Net MVC framework, and today I created
Just started playing around with, how is everyone linking up their component ids ?
I've just started playing around with Scala, and I just learned about how methods
I just started playing around with Mozilla Jetpack , and I love it so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.