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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:51:05+00:00 2026-05-18T01:51:05+00:00

i am using hibernate as ORM tool, and while loading the data from table

  • 0

i am using hibernate as ORM tool, and while loading the data from table i am getting following error.

org.hibernate.HibernateException: CGLIB Enhancement failed: com.hotel.entity.HotelUser
    at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:96)
    at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.getProxy(CGLIBProxyFactory.java:49)
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:379)
    at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3455)
    at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:257)
    at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:191)
    at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
    at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
    at org.hibernate.impl.SessionImpl.load(SessionImpl.java:795)
    at org.hibernate.impl.SessionImpl.load(SessionImpl.java:788)
    at com.hotel.domain.UserLoginService.checkUserCredentials(UserLoginService.java:17)
    at com.hotel.app.UserLoginManager.checkUserCredentials(UserLoginManager.java:12)
    at com.hotel.app.UserLoginManager.main(UserLoginManager.java:23)
Caused by: java.lang.InstantiationException: com.hotel.entity.HotelUser$$EnhancerByCGLIB$$fa712a57
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyInstance(CGLIBLazyInitializer.java:107)
    at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:93)
    ... 12 more

please let me know, what i am missing…

below is my class

public class HotelUser implements Serializable {

    private static final long serialVersionUID = 1L;
    private String userId;
    private String password;
    private String userName;

    private HotelUser() {

    }
    /**
     * @param userId
     * @param password
     * @param userName
     * @param lastLoginDate
     */
    public HotelUser(String userId, String password, String userName) {
        super();
        this.userId = userId;
        this.password = password;
        this.userName = userName;
    }
    /**
     * @return the userId
     */
    public String getUserId() {
        return userId;
    }
    /**
     * @param userId the userId to set
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }
    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }
    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }
    /**
     * @return the userName
     */
    public String getUserName() {
        return userName;
    }
    /**
     * @param userName the userName to set
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }
}

and the hbm file is below :

<?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.hotel.entity.HotelUser" table="hotel_user">
        <id name="userId" type="string" column="USER_ID">
        </id>
        <property name="password" type="string" column="PASSWORD" />
        <property name="userName" type="string" column="USER_NAME" />
    </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-18T01:51:05+00:00Added an answer on May 18, 2026 at 1:51 am

    My guess is that you don’t have a non-private, default (no-arg) constructor on your HotelUser class.

    See this question for more details.

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

Sidebar

Related Questions

When using hibernate to retrieve data from Oracle 11g DB using either org.hibernate.dialect.Oracle10gDialect or
Today I was trying to create a application using Hibernate as ORM. So while
I'm using Coldfusion ORM (Hibernate), and have a cfc mapped to a database table.
I am using hibernate as ORM tool, i want to perform some common stuff
I am using hibernate as ORM tool. It's working properly, but the problem is
I am using Hibernate's lazy loading, and am getting sessionFactory missing exception, even after
i am using hibernate as ORM tool, i am facing one problem, i need
I am using Java and Hibernate as ORM tool. Is there any way i
I'm using Hibernate as ORM and I have my DAOs annotated with @Repository .
We are developing a web application using Spring framework and Hibernate ORM. As far

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.