This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes org.hibernate.MappingException: Unknown entity: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "org.hibernate.MappingException: Unknown entity:" Watch "org.hibernate.MappingException: Unknown entity:" New topic
Author

org.hibernate.MappingException: Unknown entity:

Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 144
Hi All,

I am stuck on this problem for last several hours.I have tried looking everywhere but this problem would not go away.
Here is my entity class :-



Here is applicationContext.xml :-



Java code that is giving problem is here :-

error comes on filterDao.persist(filter) ;

persist method has this code snippet :-

Here is the exception stack trace :-



Can someone please help?Thanks!
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 144
It seems spring reads projectname-servlet.xml.It does not read applicationContext.xml even if it is mentioned in web.xml .
How does it work?I am totally confused.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

Can you post the relevant part(s) of the web.xml? Where's your applicationContext.xml is located in the deployed application? Is this happens to any other annotated beans or only for this?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 144
It happens with all annotated beans.applicationContext.xml is under WEB-INF/classes. Here is web.xml :-
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.hibernate.MappingException: Unknown entity:
 
Similar Threads
Hibernate : Empty Table recreated when spring starts
data not persisted using hibernate spring integration
Error with Transaction Interceptor
HibernateException: No Hibernate Session bound to thread
Spring and Hibernate problem