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 7188039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:58:45+00:00 2026-05-28T18:58:45+00:00

For you all information i am developing one java project using Eclipse to interact

  • 0

For you all information i am developing one java project using Eclipse to interact with database by the use of hibernate.So i updated BUILD PATH with ojdbc14.jar and hibernate3.jar and all 7 jar files present in required folder of Hibernate.

I have pasted all classes here.
On running main Manager.java ,I am getting an error”Exception in thread “main” org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/lara/Person.hbm.xml“.Can somebody tell where i did a mistake.

Error Log

Exception in thread "main" org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/lara/Person.hbm.xml
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:616)
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1635)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
    at com.lara.Manager.main(Manager.java:16)
Caused by: org.hibernate.MappingException: class org.hibernate.tutorial.domain.Person not found while looking for property: id
    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:232)
    at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:302)
    at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:423)
    at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:356)
    at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:295)
    at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)
    at org.hibernate.cfg.Configuration.add(Configuration.java:716)
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:551)
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:613)
    ... 7 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.tutorial.domain.Person
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:228)
    ... 15 more









 **hibernate.cfg** 
       <?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>

        <!-- Database connection settings -->
        <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>
        <property name="connection.username">System</property>
        <property name="connection.password">java</property>

        <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">2</property>

        <!-- SQL dialect -->
        <property name="dialect">org.hibernate.dialect.OracleDialect</property>

        <!-- Enable Hibernate's current session context -->
        <property name="current_session_context_class">org.hibernate.context.ManagedSessionContext</property>

        <!-- Disable the second-level cache  -->
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">true</property>

        <!-- Drop and re-create the database schema on startup -->
        <property name="hbm2ddl.auto">create</property>

        <mapping resource="com/lara/Person.hbm.xml"/>

    </session-factory>

</hibernate-configuration>

Person.bhm.xml

   <?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="org.hibernate.tutorial.domain">

    <class name="Person" table="PERSON">
        <id name="id" column="PERSON_ID">
            <generator class="native"/>
        </id>
        <property name="age"/>
        <property name="firstname"/>
        <property name="lastname"/>

    </class>

</hibernate-mapping>

pojo class or persistence class

package com.lara;

public class Person 
{
    private int id;
    private String firstname;
    private String lastname;
    private int age;
    public int getId() 
    {
        return id;
    }
    public void setId(int id) 
    {
        this.id = id;
    }
    public String getFirstname() 
    {
        return firstname;
    }
    public void setFirstname(String firstname) 
    {
        this.firstname = firstname;
    }
    public String getLastname()
    {
        return lastname;
    }
    public void setLastname(String lastname) 
    {
        this.lastname = lastname;
    }
    public int getAge() 
    {
        return age;
    }
    public void setAge(int age) 
    {
        this.age = age;
    }

}

*Manager.java (Main class where we are using Hibernate framework) *

    package com.lara;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class Manager
{
    public static void main(String[] args)
    {
        Person p1 = new Person();
        p1.setFirstname("saurabh");
        p1.setLastname("rai");
        p1.setAge(25);
        Configuration c1 = new Configuration();
        c1.configure();
        SessionFactory sf = c1.buildSessionFactory();
        Session s1 = sf.openSession();
        s1.beginTransaction();
        s1.save(p1);
        s1.getTransaction().commit();
        s1.flush();
        s1.close();
        System.out.println("done");
    }
}
  • 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-28T18:58:46+00:00Added an answer on May 28, 2026 at 6:58 pm

    <hibernate-mapping package="org.hibernate.tutorial.domain"> and com.lara. How do you think both of these relate? Your mapping file has a wrong package declaration and Hibernate is unable to find a class org.hibernate.tutorial.domain.Person

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

Sidebar

Related Questions

I have a properties file in java, in which I store all information of
I have a database table called Posts which stores all the information regarding an
I am developing a project for one customer, where the design has a radio
I'm developing a web application using a cookie to store session information. I've manually
I am working on an MVC3 project where we are developing one site for
I'm developing a database which includes contact information. PhoneNumbers are stored in a separate
I'm developing an Android application to catch NFC tag information. The device I use
First of all, I'm not the one developing this but I'm the one with
I am building a mobile application that get all the information from a Java
We are moving our application to the OSGI platform (All developers are using Eclipse)

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.