I am running an application that uses Hibernate on both a Tomcat server, and in a Jave GUI. The following code works fine on Tomcat, but fails with a MappingException on the GUI. I am wondering what I am doing wrong.
Transaction t = session.beginTransaction();
try {
session.save(job);
t.commit();
}
catch (HibernateException e) {
t.rollback();
throw e;
}
finally {
session.close();
}
Here is the stack trace.
ERROR [] - No persister for: com.onerealm.solx.wfg.run.WfgJob
net.sf.hibernate.MappingException: No persister for: com.onerealm.solx.wfg.run.WfgJob
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2690)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2697)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:763)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
However, the startup log shows that Hibernate successfully read the mapping files.
INFO [main] - Mapping resource: com/onerealm/solx/wfg/run/WfgJob.hbm.xml
INFO [main] - Mapping class: com.onerealm.solx.wfg.run.WfgJob -> wfg_job
INFO [main] - Mapping resource: com/onerealm/solx/wfg/run/WfgJobStep.hbm.xml
INFO [main] - Mapping class: com.onerealm.solx.wfg.run.WfgJobStep -> wfg_job_step
INFO [main] - processing one-to-many association mappings
INFO [main] - Mapping collection: com.onerealm.solx.wfg.run.WfgJob.steps -> wfg_job_step
INFO [main] - processing one-to-one association property references
INFO [main] - processing foreign key constraints
INFO [main] - Using dialect: net.sf.hibernate.dialect.MySQLDialect
Any suggestions will be gratefully received.
Thanks, Alec
|