揭帖
问题解决
原来构造函数中的
try 

session = HibernateSessionFactory.getSession(); 
tx = session.beginTransaction(); 

catch(HibernateException ea) 

System.out.println(ea.toString()); 
}
应写在外面
static
{
try 

session = HibernateSessionFactory.getSession(); 
tx = session.beginTransaction(); 

catch(HibernateException ea) 

System.out.println(ea.toString()); 
}
}