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

The Archive Base Latest Questions

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

I am using Spring-3.0.5 and Hibernate-3 for a project that I am working on.

  • 0

I am using Spring-3.0.5 and Hibernate-3 for a project that I am working on.
I intermittently get “org.hibernate.MappingException: Unknown entity: ” for only the “user_roles” domain table and that too only when I try to insert a record in that table. All the domain objects use the “javax.persistence.Entity” and not “org.hibernate.annotations.Entity“, which is generally the cause of this error. The “sessionFactory” bean has been provided the value of “packagesToScan“. Cleaning and building the project has not helped.
Surprisingly when deploying to Tomcat I do see the following lines on the console :

[AnnotationBinder] Binding entity from annotated class:  UserRole

[EntityBinder] Bind entity UserRole on table user_roles

just like for all other domain classes.

(This question seems to be an exact copy of another question which has not been answered yet.)

Any help is much appreciated.

Thanks.

  • 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-30T03:29:19+00:00Added an answer on May 30, 2026 at 3:29 am

    Fixed this one.
    The problem was with my code. I had saved the user object and was saving the associated user_roles separately without updating the user object i.e. i did session.save(userRoles) without doing user.setUserRoles(userRoles). I now changed the code to first setting the userRoles in user and then just saving the user object which saves the user roles as well.
    Wish the hibernate was a bit more consistent in behavior and the error message a bit friendlier 🙂

    Thanks.

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

Sidebar

Related Questions

I am working on a domain model using Hibernate for a new project. I
While working on a Spring 3 MVC project using Hibernate, we encountered an annoying
I am working on a project that uses hibernate and spring. Hibernate is encapsulated
I am using Spring with Hibernate in my project.There are many methods written in
I am developing project using Spring , Struts2 & Hibernate . Now I want
I have a project with spring and hibernate in GWT, I am using below
I'm writing a web application using Spring/Hibernate that displays a report to a user,
I'm using Spring with Hibernate as a JPA provider and are trying to get
In my project I can successfully test database code. I'm using Spring, Hibernate, HSQLDB,
I am using Spring 3 and Hibernate 4 to build my project. My question

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.