Bonjour,
Je tente de migrer mon hibernate 2 en hibernate 3.1. J'ai suivi le guide de migration, changer mes session.find, mes dtd 2 et mes net.sf.hibernate. Tout compile, mais dès le lancement de la 1ère page de mon appli web, j'ai une belle erreur.
En ayant creusé et grâce au logs, Je me rends compte que tout l'erreur intervient dans un setSessionFactory.
Code déclenchant l'erreur
Citation :
public static void initialize (String configFileName) throws HibernateException {
logger.info("Entrée dans initialize" );
if (null == configFileName && sessionFactoryMap.size() > 0){
logger.info("null == configFileName && sessionFactoryMap.size() > 0" );
return;
}
else if (null != sessionFactoryMap.get(configFileName)) {
logger.info("null != sessionFactoryMap.get(configFileName)" );
return;
}
else {
logger.info("Avant Configuration" );
Configuration cfg = new Configuration();
logger.info("Après Configuration" );
if (null == configFileName) {
logger.info("null == configFileName" );
cfg.configure();
}else {
logger.info("null != configFileName" );
cfg.configure(configFileName);
}
logger.info("setSessionFactory(configFileName, cfg.buildSessionFactory())" );
setSessionFactory(configFileName, cfg.buildSessionFactory());
logger.info("setSessionFactory effectué" );
}
|
Le fichier de log avec les erreurs
Le code qui catch l'exception
Citation :
public String donneValParam(String nom)
{
String val = null;
TeParametreDAO dao;
try {
List list = null;
logger.info("com.bull.crnpc.hibernate.dao._RootDAO.initialize()" );
[COLOR="DarkOrange"]com.bull.crnpc.hibernate.dao._RootDAO.initialize();[/COLOR]
logger.info("TeParametreDAO.getInstance()" );
dao = TeParametreDAO.getInstance();
logger.info("Requete" );
list = dao.find("from TeParametre p where p.NomParametre='"+nom+"'" );
if (list!=null){
logger.info("list!=null" );
TeParametre u;
for (Iterator it=list.iterator();it.hasNext() {
u = (TeParametre)it.next();
val = u.getGValeurParam();
}
}
}
catch (HibernateException e){
logger.error("HibernateException - donneValParam "+e.getMessage());
}
return val;
}
|
J'ai mis en vert les logs correspondants au code générant l'erreur, en rouge les logs d'erreur et en orange la méthode lance l'exception
Quelqu'un aurait un soupçon d'idée ? Parce que là, je nage complètement.
J'espère avoir été clair.
Merci d'avance.