I've updated from a version of hibernate that didn't have the version number in the MANIFEST to the version 2.1.7c.
When running the system, a class trows a NoSuchMethod Exception. The funny thing is... the method is still there !!! I don't know what've changed... binary stamps or something ?
If I recompile the class with the new library (without toching anything) it works.
The class is:
public class SystemManager {
private static SessionFactory factory;
private static Configuration config;
private static Vector hbms;
static {
try {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
hbms = new Vector();
config = new Configuration();
config.setNamingStrategy(CustomNamingStrategy.INSTANCE);
config = config.configure(loader.getResource("file.cfg.xml"));
config = config.configure(loader.getResource("file2.cfg.xml"));
factory = config.buildSessionFactory();
} catch (HibernateException e) {
Log.general.fatal("Fatal error initializing framework", e);
throw new RuntimeException("Fatal error initializing framework", e);
}
}
public static Session openSession() throws HibernateException {
return factory.openSession();
}
public static SessionFactory getSessionFactory() {
return factory;
}
public static void addConfigure(URL url) throws HibernateException {
config = config.configure(url);
factory = config.buildSessionFactory();
}
public static void addHbmXml(String hbmXml) throws HibernateException {
if (hbms.contains(hbmXml)) {
return;
}
hbms.add(hbmXml);
config = config.addFile(hbmXml);
factory = config.buildSessionFactory();
}
}
Hibernate version:
2.1.7c
Mapping documents:
N/A
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
java.lang.NoSuchMethodError: net.sf.hibernate.cfg.Configuration.setNamingStrategy(Lnet/sf/hibernate/cfg/NamingStrategy;)V
ar.com.tsoluciones.system.SystemManager.<clinit>(SystemManager.java:34)
com.intranet.hibernate.HibernateService.<clinit>(HibernateService.java:13)
org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Name and version of the database you are using:
N/A
The generated SQL (show_sql=true):
N/A
Debug level Hibernate log excerpt:
N/A
|