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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:13:25+00:00 2026-06-14T20:13:25+00:00

* Each of below files are in same location * Error : SLF4J: Failed

  • 0

* Each of below files are in same location *

Error :


    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
org.hibernate.InvalidMappingException: Could not parse mapping document from resource ./employee.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.yahoo.hibernatelearning.FirstExample.main(FirstExample.java:19)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:555)
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:613)
    ... 7 more
Caused by: org.dom4j.DocumentException: http://hibernate.sourceforge.net/%0Ahibernate-mapping-3.0.dtd Nested exception: http://hibernate.sourceforge.net/%0Ahibernate-mapping-3.0.dtd
    at org.dom4j.io.SAXReader.read(SAXReader.java:484)
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:546)
    ... 8 more
Exception in thread "main" java.lang.NullPointerException
    at com.yahoo.hibernatelearning.FirstExample.main(FirstExample.java:33)

Hibernate Config: hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.h2.Driver</property>
<property name="hibernate.connection.url">jdbc:h2:./db/repository</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.default_schema">PUBLIC</property>
<property name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!--  Mapping files  -->
<mapping resource="./employee.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Mapping Config: employee.hbm.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>
<class name="com.yahoo.hibernatelearning.Employee" table="employee">
<id name="empId" type="int" column="emp_id" >
<generator class="native"/>
</id>
<property name="empName">
<column name="emp_name" />
</property>
<property name="empSal">
<column name="emp_sal" />
</property>
</class>
</hibernate-mapping>

Mapping Class : Employee.java


    package com.yahoo.hibernatelearning;

    public class Employee {

        private int empId;
        private String empName;
        private int empSal;

        public int getEmpId() {
            return empId;
        }   

        public void setEmpId(int empId) {
            this.empId = empId;
        }

        public String getEmpName() {
            return empName;
        }

        public void setEmpName(String empName) {
        this.empName = empName;
        }

        public int getEmpSal() {
            return empSal;
        }

        public void setEmpSal(int empSal) {
            this.empSal = empSal;
        }

    }

Code: FirstExample.java


    package com.yahoo.hibernatelearning;

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

    public class FirstExample {

    /**
    * @param args
    */
    public static void main(String[] args) {
    // TODO Auto-generated method stub

    Session sess = null;
    Transaction tran = null;
    try{
    SessionFactory sessFact = new Configuration().configure().buildSessionFactory();
    sess = sessFact.openSession();
    System.out.println("Session: "+ sess);
    tran = sess.beginTransaction();
    Employee emp = new Employee();
    emp.setEmpName("Birendra Kumar");
    emp.setEmpSal(12000);
    sess.save(emp);
    tran.commit();
    }
    catch(Exception ex){
    ex.printStackTrace();
    }
    finally{
    sess.close();
    }

    }

    }

  • 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-06-14T20:13:26+00:00Added an answer on June 14, 2026 at 8:13 pm

    %0A tells that problem is line feed between http://hibernate.sourceforge.net/ and hibernate-mapping-3.0.dtd.

    Problems is solved by removing line feed:

    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using below code to transfer files, it is showing on each movement
So im stuck on a few things in each part below, they are pretty
Whenever I create a Unordered List, A gap remains below each of the list
I need some web.config examples for each expression types below : $number The last
My code below is supposed to display each question ($_POST[questionText]). For each question, it
The method below called UserCanAccessThisPage is based on the following logic: each user and
In the below code I'm trying to loop through each child node and append
The code below shows me (I think) that the for each loop is about
The code below works nicely. Each title in the MySQL table submission is printed
I have the correlated subquery below. Each id (147,148,149) in table1 has many records

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.