I'm having the same error, anyone got?
I'm using jboss AS 7
| private static final SessionFactory sessionFactory = buildSessionFactory(); |
|
|
|
|
|
|
| private static SessionFactory buildSessionFactory(){ |
|
|
|
|
| try{ |
|
|
|
|
|
|
| //Configuration cfg = new Configuration(); |
|
|
| AnnotationConfiguration | cfg | = | new AnnotationConfiguration(); |
|
|
| cfg.configure("hibernate.cfg.xml"); |
|
|
| //cfg.addAnnotatedClass(UsuarioWebBean.class); |
|
|
|
|
|
|
|
|
|
|
| return cfg.buildSessionFactory(); |
|
|
|
|
|
| }catch(Throwable e) { |
|
|
| System.out.println("impossivel criar o objeto sessionFactory"); |
|
|
|
|
|
|
| throw new ExceptionInInitializerError(e); |
|
|
|
|
|
| } |
|
|
|
| } |
| public static SessionFactory getSessionFactory(){ |
|
|
|
|
| return sessionFactory; |
|
|
|
| } |