This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

org.hibernate.MappingException: Unknown entity

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using spring 3, Hibernate 3.6 and I have the following Exception which occurs when addEntity(...) is exuted






Spring Context XML :



The DAO




The Entity class

 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you try with JPA-QL instead of sql?

Or when you call addEntity. Try putting the full package/classname as the String. "org.stockdomain.domain.Stock"


I never use SQL with addEntity, I would always use JPA-QL myself, but that doesn't mean that what you did was wrong.

so JPA-QL would be

String ql = "Select * from Stock"
return sessionFactory.getCurrentSession().createQuery(ql).list();

I suggest trying with JPA-QL to see what the real problem could be. Is it the String "Stock" or something more than just that.

Mark
 
Frank VanOor
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi mark,

After trying so many options/solutions, finally the reason was found : A jar was missing -->javassist.jar
I noticed that it's defined as a dependency in the pom of hibernate, but eclipse/maven (m2) didn't download !!!

thanks a lot,

Frank
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Frank VanOor wrote:Hi mark,

After trying so many options/solutions, finally the reason was found : A jar was missing -->javassist.jar
I noticed that it's defined as a dependency in the pom of hibernate, but eclipse/maven (m2) didn't download !!!

thanks a lot,

Frank



Sweet. Lots of fun when the actual problem is not what shows.

Mark
 
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic