-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: hibernate 2.1.7c breaks backwards compatibility ?
PostPosted: Mon Feb 07, 2005 10:14 am 
Beginner
Beginner

Joined: Mon Jan 03, 2005 12:49 pm
Posts: 21
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 07, 2005 10:33 am 
Beginner
Beginner

Joined: Mon Jan 03, 2005 12:49 pm
Posts: 21
I saw in the changes log that setNamingStrategy changed his return value from void to Configuration... given that is not a valid overloading of the method, the linking must be failing...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.