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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:04:29+00:00 2026-06-16T00:04:29+00:00

I’m learning hibernate in myeclipse. I tried to reverse engineer a mysql table and

  • 0

I’m learning hibernate in myeclipse. I tried to reverse engineer a mysql table and follow the official myeclipse tutorial. All the xml files are generated but writing a simple test programme it gives me the following error:

.

     17-dic-2012 19.18.57 org.hibernate.annotations.common.Version <clinit>
     INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
     17-dic-2012 19.18.57 org.hibernate.Version logVersion
     INFO: HHH000412: Hibernate Core {4.1.4.Final}
     17-dic-2012 19.18.57 org.hibernate.cfg.Environment <clinit>
     INFO: HHH000206: hibernate.properties not found
     17-dic-2012 19.18.57 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
17-dic-2012 19.18.57 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
17-dic-2012 19.18.57 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
17-dic-2012 19.18.57 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: sor/hibernate/Hitest.hbm.xml
%%%% Error Creating SessionFactory %%%%
org.hibernate.InvalidMappingException: Unable to read XML
    at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:109)
    at org.hibernate.cfg.Configuration.add(Configuration.java:478)
    at org.hibernate.cfg.Configuration.add(Configuration.java:474)
    at org.hibernate.cfg.Configuration.add(Configuration.java:647)
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:730)
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2109)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2081)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2061)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2014)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1929)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1908)
    at sor.hibernate.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:32)
    at sor.hibernate.BaseHibernateDAO.getSession(BaseHibernateDAO.java:13)
    at sor.hibernate.HitestTest.main(HitestTest.java:15)
Caused by: org.dom4j.DocumentException: http://www.jboss.org/dtd/hibernate/hibernate-mapping-4.0.dtd%20 Nested exception: http://www.jboss.org/dtd/hibernate/hibernate-mapping-4.0.dtd%20
    at org.dom4j.io.SAXReader.read(SAXReader.java:484)
    at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:78)
    ... 13 more
17-dic-2012 19.18.59 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
17-dic-2012 19.18.59 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
17-dic-2012 19.18.59 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: sor/hibernate/Hitest.hbm.xml
%%%% Error Creating SessionFactory %%%%
org.hibernate.InvalidMappingException: Unable to read XML
    at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:109)
    at org.hibernate.cfg.Configuration.add(Configuration.java:478)
    at org.hibernate.cfg.Configuration.add(Configuration.java:474)
    at org.hibernate.cfg.Configuration.add(Configuration.java:647)
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:730)
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2109)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2081)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2061)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2014)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1929)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1908)
    at sor.hibernate.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:71)
    at sor.hibernate.HibernateSessionFactory.getSession(HibernateSessionFactory.java:55)
    at sor.hibernate.BaseHibernateDAO.getSession(BaseHibernateDAO.java:13)
    at sor.hibernate.HitestTest.main(HitestTest.java:15)
Caused by: org.dom4j.DocumentException: http://www.jboss.org/dtd/hibernate/hibernate-mapping-4.0.dtd%20 Nested exception: http://www.jboss.org/dtd/hibernate/hibernate-mapping-4.0.dtd%20
    at org.dom4j.io.SAXReader.read(SAXReader.java:484)
    at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:78)
    ... 14 more
Exception in thread "main" java.lang.NullPointerException
    at sor.hibernate.HitestTest.main(HitestTest.java:15)

The test programme is

package sor.hibernate;


import java.util.Date;

import org.hibernate.Session;
import org.hibernate.Transaction;


public class HitestTest {

    public static void main(String[] args) {

        HitestDAO dao = new HitestDAO();
        Transaction tx = dao.getSession().beginTransaction();

        Hitest hitest[] = new Hitest[10];
        for (int i = 0; i < hitest.length; i++) {
            hitest[i]  = new Hitest();
            hitest[i].setGreeting("saluto numero " + i*23);
            hitest[i].setRef(i+10);
            hitest[i].setDate(new Date(System.currentTimeMillis()));
            dao.save(hitest[i]);
        }
        tx.commit();
        dao.getSession().close();
    }
}

and the hibernate.cfg.xml is

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

    <session-factory>
        <property name="hbm2ddl.auto">update</property>
        <property name="dialect">
            org.hibernate.dialect.MySQLDialect
        </property>
        <property name="connection.url">
            jdbc:mysql://localhost:3306/efeulib
        </property>
        <property name="connection.username">root</property>
        <property name="connection.password">qwerty</property>
        <property name="connection.driver_class">
            com.mysql.jdbc.Driver
        </property>
        <property name="myeclipse.connection.profile">
            mysqlJDriver
        </property>
        <mapping resource="sor/hibernate/Hitest.hbm.xml" />

    </session-factory>

</hibernate-configuration>

while Hitest.hbm.xml is

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd ">
<!-- 
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping package="sor.hibernate">
    <class name="sor.hibernate.Hitest" table="hitest" catalog="test">
        <id name="id" type="java.lang.Integer">
            <column name="id" />
            <generator class="assigned" />
        </id>
        <property name="greeting" type="java.lang.String">
            <column name="greeting" length="200" />
        </property>
        <property name="date" type="java.util.Date">
            <column name="date" length="10" />
        </property>
        <property name="ref" type="java.lang.Integer">
            <column name="ref" />
        </property>
    </class>
</hibernate-mapping>

I have read the relevant questions and I have deleted the all trailing lines and spaces. But none of them has worked. The only thing I’ve add to these files reading the questions is package=”sor.hibernate” attribute in the Hitest.hbm.xml
The paths and… are all correct and they are all autogenerated.

More information. When I type from hitest in the HQL, it tells me
org.hibernate.hql.ast.QuerySyntaxException: hitest is not mapped [from hitest]
while from sor.hibernate.Hitest works well

  • 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-16T00:04:29+00:00Added an answer on June 16, 2026 at 12:04 am

    Try removing the white space in

    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd "
                                                           ^-- here
    

    And in every other place where you might have done the same mistake.

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

Sidebar

Related Questions

Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a text area in my form which accepts all possible characters from
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.