I searched the archives and couldn't find anything relevant about this, so I am asking it here. Actually, I have never seen this kind of behaviour in Java ever, so I am pretty baffled.
I have some code I stole from a tutorial to add the classes to the config. Here is part of it:
Code:
private static void loadClasses() throws DAOException {
Class[] classes = new Class[] {db.Category.class, db.Description.class,
db.PerformanceTip.class,
db.Tip.class};
for (int i = 0; i<classes.length; i++) {
try {
System.out.println ("adding class " + classes[i].toString());
cfg.addClass(classes[i]);
System.out.println ("added class " + classes[i].toString());
}
catch (Exception me) {
System.out.println ("load classes exception! " + me.getMessage());
throw new DAOException(me);
}
}
}
When it executes, it hits the "adding class" statement, then magically returns to the calling method. It never hits the "added class" line or throws an exception. The tomcat console has a "-Mapping resource: db/Category.hbm.xml" line, then "-Could not complete request" and that's it.
Beyond not knowing what is causing Hibernate to not add the class, I don't even understand how the code could process in that manner. Nutty. Any ideas? Thanks.