-->
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.  [ 1 post ] 
Author Message
 Post subject: Method save with hibernate
PostPosted: Tue May 24, 2011 11:35 am 
Newbie

Joined: Fri May 06, 2011 5:55 pm
Posts: 3
I'm doing a simple application that save a record in a database. The errors are these:

Initial SessionFactory creation failed.java.lang.ExceptionInInitializerError
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at csoft.HibernateUtil.<clinit>(HibernateUtil.java:27)
at csoft.AltaUsuariosBetaFrame.jButton1MouseClicked(AltaUsuariosBetaFrame.java:142)
at csoft.AltaUsuariosBetaFrame.access$000(AltaUsuariosBetaFrame.java:20)
at csoft.AltaUsuariosBetaFrame$1.mouseClicked(AltaUsuariosBetaFrame.java:53)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:120)
at csoft.HibernateUtil.<clinit>(HibernateUtil.java:23)
... 35 more
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission org.apache.commons.logging.LogFactory.HashtableImpl read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at org.apache.commons.logging.LogFactory.createFactoryStore(LogFactory.java:320)
at org.apache.commons.logging.LogFactory.<clinit>(LogFactory.java:1725)
... 37 more

And the code is:

Session session=HibernateUtil.getSessionFactory().openSession();
Transaction tx=session.beginTransaction();
tx.begin();

Asesor obj=new Asesor();
obj.setPrimerNombre(jTextField2.getText());
obj.setSegundoNombre(jTextField3.getText());
obj.setPrimerApellido(jTextField4.getText());
obj.setSegundoApellido(jTextField5.getText());
obj.setIdAsesor(Integer.valueOf(jTextField1.getText()));

session.save(obj);
tx.commit();
session.close();

¿Any ideas?

Thank you.


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

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.