This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate / Spring problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate / Spring problem" Watch "Hibernate / Spring problem" New topic

Hibernate / Spring problem

Joel McNary

Joined: Aug 20, 2001
Posts: 1824

I'm working on a Hibernate / Spring / Tomcat application (my first foray into this particular combination ), and after working through several configuration issues that prevented the application from deploying, it now deploys. But when I'm using the application, I'm now facing an Unknown entity exception:

which seems to indicate that it cannot locate the Job.hbm.xml file, but elsewhere in the log I see things like:

which, to me, indicates that the Job.hbm.xml file can be located

The relevent section of my applicationContext-hibernate.xml file looks like:

And the .hbm.xml files are located:

What am I missing here?
[ April 14, 2008: Message edited by: Joel McNary ]

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302
    6 Sorry if this seems quite obvious but you didn't show that (Job.class) is in the classpath.

GenRocket - Experts at Building Test Data
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

No, it's there. I just listed out the hibernate files, but the appropriate class files are there, too.
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

More information:

It seems that this may be more a Spring issue than a Hibernate issue, since the application can, in fact, access Jobs during the application initialization phase. It's just afterward, when I go to check the status of a job, that I'm getting this error.

Still not working, though.
Pedro Erencia
Ranch Hand

Joined: Apr 03, 2008
Posts: 70
Is this Job

<2008-04-14 20:49:49,718> [DEBUG] - select job0_.JOB_ID as JOB1_, job0_.JOB_STATUS as JOB2_0_, job0_.JOB_START_TIME as JOB3_0_,
from JOB job0_ where job0_.JOB_STATUS='QUEUED' (

the same Job as


Are you using Quartz ? It has a Job class, if i remember well..
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

Yes, those Job classes are the same.
I agree. Here's the link:
subject: Hibernate / Spring problem
It's not a secret anymore!