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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:29:21+00:00 2026-05-30T09:29:21+00:00

I am using the latest jars for hibernate. (i.e. hibernate-release-4.0.1.Final ) In the previous

  • 0

I am using the latest jars for hibernate. (i.e. hibernate-release-4.0.1.Final )
In the previous versions i was getting proper output.
I replaced the hibernate jars and there was a exception.

org.hibernate.InvalidMappingException: Unable to read XML

I read some blogs and changed the doctype to

<?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">

Still the error persists.

i am attaching my cfg.xml and one of my hbm.xml (as all 10 cant be attached)

Plez let me what is the problem and what should be the solution.
Thank you

Error:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.cluster.action.Action.main(Action.java:19)
Caused by: org.hibernate.InvalidMappingException: Unable to read XML
    at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:106)
    at org.hibernate.cfg.Configuration.add(Configuration.java:474)
    at org.hibernate.cfg.Configuration.add(Configuration.java:470)
    at org.hibernate.cfg.Configuration.add(Configuration.java:643)
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:726)
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2102)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2074)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2054)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2007)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1922)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1901)
    at com.cluster.util.HibernateUtil.<clinit>(HibernateUtil.java:14)
    ... 1 more
Caused by: org.dom4j.DocumentException: Error on line 28 of document  : Attribute name "cas" associated with an element type "key" must be followed by the ' = ' character. Nested exception: Attribute name "cas" associated with an element type "key" must be followed by the ' = ' character.
    at org.dom4j.io.SAXReader.read(SAXReader.java:482)
    at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:76)
    ... 12 more

hibernate.cfg.xml :

 <?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">

    <hibernate-configuration>

        <session-factory>
            <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">julyaugust</property>
            <property name="connection.password">julyaugust</property>
            <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
            <property name="show_sql">true</property>

            <mapping resource="com/cluster/entity/employee.hbm.xml"/>
            <mapping resource="com/cluster/entity/department.hbm.xml"/>
            <mapping resource="com/cluster/entity/addressDetails.hbm.xml"/>
            <mapping resource="com/cluster/entity/addressType.hbm.xml"/>
            <mapping resource="com/cluster/entity/city.hbm.xml"/>
            <mapping resource="com/cluster/entity/state.hbm.xml"/>
            <mapping resource="com/cluster/entity/email.hbm.xml"/>
            <mapping resource="com/cluster/entity/emailType.hbm.xml"/>
            <mapping resource="com/cluster/entity/phone.hbm.xml"/>
            <mapping resource="com/cluster/entity/phoneType.hbm.xml"/>
        </session-factory>

    </hibernate-configuration>

employee.hbm.xml

 <?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'>


             <hibernate-mapping package="com.cluster.entity" >
            <class name="Employee" table="EMPLOYEE">
            <id name="intEmployeeID" column="EMPLOYEE_ID"> 
                <generator class="sequence">
                    <param name="sequence">EMPLOYEE_ID_SEQ</param>
                </generator>
            </id>

            <property name="strFirstName" column = "FIRSTNAME"/>
            <property name="strLastName" column="LASTNAME"/>
            <property name="strDateOfBirth" column="DATE_OF_BIRTH"/>
            <property name="strSalary" column="SALARY"/>

            <many-to-one name="department" column="DEPARTMENT_ID" not-null = "true"          class = "Department"/>

            <set name="setAddressDetails" cascade="all" lazy="true">
                <key column="EMPLOYEE_ID" not-null="true"></key>
                <one-to-many class="AddressDetails"/>
            </set>

            <set name="setPhones" cascade="all" lazy="true">
                <key column="EMPLOYEE_ID" not-null="true" cas></key>
                <one-to-many class="Phone"/>
            </set>

            <set name="seEmails" cascade="all" lazy="true" >
                <key column="EMPLOYEE_ID" not-null="true"></key>
                <one-to-many class="Email"/>
            </set>

        </class>

           </hibernate-mapping>
  • 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-30T09:29:23+00:00Added an answer on May 30, 2026 at 9:29 am

    Check this out

            <set name="setPhones" cascade="all" lazy="true">
                <key column="EMPLOYEE_ID" not-null="true" **cas**></key>
                <one-to-many class="Phone"/>
            </set>
    

    From the log you attached ” from log Attribute name “cas” associated with an element type “key” must be followed by the ‘ = ‘ character. Nested exception: Attribute name “cas” associated with an element type “key” must be followed by the ‘ = ‘ character.”
    is the cause of the problem.

    “there is no attribute called “cas”.

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

Sidebar

Related Questions

I'm using latest MVC4-RC (.net 4.0) with Microsoft ASP.NET Web Optimization Framework http://nuget.org/packages/Microsoft.AspNet.Web.Optimization/1.0.0-beta3 and
I am using jQuery(Latest release) and have a function called calculate() which gets called
Hello I am using latest facebook php sdk for my app. I am getting
I am using latest versions of NodeJS and ExpressJS (for MVC). I usually configure
I am using latest Pyramid to build a web app. Somehow we have started
I am using latest Google IMA SDK for video ads, in that the flash
Does anybody using latest enterprise library 4.1 in mono? I used mono migration analyzer
Currently I'm building an application using latest Prism for Silverlight 4. I've a module
Using the latest version of Resharper (4.5.x) with VS2008. Every now and then (pretty
I'm using the latest version of the jquery plugin DataTables and I tried to

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.