Help - InvalidMappingException: Hibernate - Urgente

6 respostas
THIAGOANALISTA

estou desenvolvendo uma classe de login com hibernate, compilei agora e deu o seguinte erro:

Acho que o erro está no mapeamento, não sei fazer direito, pois é meu primeiro software com hibernate, me ajudem por favor.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 07/08/2010 00:23:24 org.hibernate.cfg.annotations.Version <clinit> INFO: Hibernate Annotations 3.3.1.GA Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Could not parse mapping document from resource hibernate.hbm.xml Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError at br.com.supercred.util.HibernateUtil.<clinit>(HibernateUtil.java:17) at daos.UsuarioDAO.findUser(UsuarioDAO.java:17) at controller.UsuarioBO.buscar(UsuarioBO.java:59) at controller.UsuarioBO.logar(UsuarioBO.java:64) at br.com.supercred.view.FormLogin.logar(FormLogin.java:256) at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:227) at br.com.supercred.view.FormLogin.access$100(FormLogin.java:27) at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:105) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource hibernate.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:616) at org.hibernate.cfg.AnnotationConfiguration.addResource(AnnotationConfiguration.java:912) at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:617) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582) at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1002) at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:69) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556) at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:990) at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:69) at org.hibernate.cfg.Configuration.configure(Configuration.java:1476) at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:972) at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:69) at org.hibernate.cfg.Configuration.configure(Configuration.java:1462) at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:966) at br.com.supercred.util.HibernateUtil.<clinit>(HibernateUtil.java:14) ... 33 more Caused by: org.hibernate.MappingException: Could not parse mapping document in input stream at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:771) at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:69) at org.hibernate.cfg.Configuration.addResource(Configuration.java:613) ... 48 more Caused by: org.dom4j.DocumentException: Error on line 10 of document : The element type "hibernate-mapping" must be terminated by the matching end-tag "</hibernate-mapping>". Nested exception: The element type "hibernate-mapping" must be terminated by the matching end-tag "</hibernate-mapping>". at org.dom4j.io.SAXReader.read(SAXReader.java:482) at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:761) ... 50 more Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class br.com.supercred.util.HibernateUtil at daos.UsuarioDAO.findUser(UsuarioDAO.java:17) at controller.UsuarioBO.buscar(UsuarioBO.java:59) at controller.UsuarioBO.logar(UsuarioBO.java:64) at br.com.supercred.view.FormLogin.logar(FormLogin.java:256) at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:227) at br.com.supercred.view.FormLogin.access$100(FormLogin.java:27) at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:105) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Warning: class ch.randelshofer.quaqua.osx.OSXApplication couldn't load library "quaqua". java.lang.UnsatisfiedLinkError: no quaqua in java.library.path Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class br.com.supercred.util.HibernateUtil at daos.UsuarioDAO.findUser(UsuarioDAO.java:17) at controller.UsuarioBO.buscar(UsuarioBO.java:59) at controller.UsuarioBO.logar(UsuarioBO.java:64) at br.com.supercred.view.FormLogin.logar(FormLogin.java:256) at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:227) at br.com.supercred.view.FormLogin.access$100(FormLogin.java:27) at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:105) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class br.com.supercred.util.HibernateUtil at daos.UsuarioDAO.findUser(UsuarioDAO.java:17) at controller.UsuarioBO.buscar(UsuarioBO.java:59) at controller.UsuarioBO.logar(UsuarioBO.java:64) at br.com.supercred.view.FormLogin.logar(FormLogin.java:256) at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:227) at br.com.supercred.view.FormLogin.access$100(FormLogin.java:27) at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:105) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

6 Respostas

lelodois

THIAGOANALISTA:
estou desenvolvendo uma classe de login com hibernate, compilei agora e deu o seguinte erro:

Acho que o erro está no mapeamento, não sei fazer direito, pois é meu primeiro software com hibernate, me ajudem por favor.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 07/08/2010 00:23:24 org.hibernate.cfg.annotations.Version <clinit> INFO: Hibernate Annotations 3.3.1.GA Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Could not parse mapping document from resource hibernate.hbm.xml Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError at br.com.supercred.util.HibernateUtil.<clinit>(HibernateUtil.java:17) at daos.UsuarioDAO.findUser(UsuarioDAO.java:17) at controller.UsuarioBO.buscar(UsuarioBO.java:59) at controller.UsuarioBO.logar(UsuarioBO.java:64) at br.com.supercred.view.FormLogin.logar(FormLogin.java:256) at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:227) at br.com.supercred.view.FormLogin.access$100(FormLogin.java:27) at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:105) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource hibernate.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:616) at org.hibernate.cfg.AnnotationConfiguration.addResource(AnnotationConfiguration.java:912) at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:617) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582) at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1002) at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:69) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556) at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:990) at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:69) at org.hibernate.cfg.Configuration.configure(Configuration.java:1476) at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:972) at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:69) at org.hibernate.cfg.Configuration.configure(Configuration.java:1462) at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:966) at br.com.supercred.util.HibernateUtil.<clinit>(HibernateUtil.java:14) ... 33 more Caused by: org.hibernate.MappingException: Could not parse mapping document in input stream at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:771) at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:69) at org.hibernate.cfg.Configuration.addResource(Configuration.java:613) ... 48 more Caused by: org.dom4j.DocumentException: Error on line 10 of document : The element type "hibernate-mapping" must be terminated by the matching end-tag "</hibernate-mapping>". Nested exception: The element type "hibernate-mapping" must be terminated by the matching end-tag "</hibernate-mapping>". at org.dom4j.io.SAXReader.read(SAXReader.java:482) at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:761) ... 50 more Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class br.com.supercred.util.HibernateUtil at daos.UsuarioDAO.findUser(UsuarioDAO.java:17) at controller.UsuarioBO.buscar(UsuarioBO.java:59) at controller.UsuarioBO.logar(UsuarioBO.java:64) at br.com.supercred.view.FormLogin.logar(FormLogin.java:256) at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:227) at br.com.supercred.view.FormLogin.access$100(FormLogin.java:27) at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:105) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Warning: class ch.randelshofer.quaqua.osx.OSXApplication couldn't load library "quaqua". java.lang.UnsatisfiedLinkError: no quaqua in java.library.path Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class br.com.supercred.util.HibernateUtil at daos.UsuarioDAO.findUser(UsuarioDAO.java:17) at controller.UsuarioBO.buscar(UsuarioBO.java:59) at controller.UsuarioBO.logar(UsuarioBO.java:64) at br.com.supercred.view.FormLogin.logar(FormLogin.java:256) at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:227) at br.com.supercred.view.FormLogin.access$100(FormLogin.java:27) at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:105) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class br.com.supercred.util.HibernateUtil at daos.UsuarioDAO.findUser(UsuarioDAO.java:17) at controller.UsuarioBO.buscar(UsuarioBO.java:59) at controller.UsuarioBO.logar(UsuarioBO.java:64) at br.com.supercred.view.FormLogin.logar(FormLogin.java:256) at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:227) at br.com.supercred.view.FormLogin.access$100(FormLogin.java:27) at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:105) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Vamos resolver…
Deixe-me ver oq acontece…

lelodois

Coloque os fontes e mapeamentos que vc fez para vermos.

Demorando demais… vou dormir :wink:
Levar uma exception para o fds é a melhor coisa que tem!
rsrsrs

THIAGOANALISTA

Mapeamentos - com certeza estão errados

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="br.com.supercred.model.Usuario" table="usuarios"/>
   
    <property name="login"/>
    <property name="senha"/>
    <property name="id"/>



</class>



</hibernate-mapping>
B

Você está fechando o atributo class da linha 4 indevidamente, retire a / …

THIAGOANALISTA

retirei a linha deu o seginte erro agora.

run:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
07/08/2010 14:53:02 org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.3.1.GA
Initial SessionFactory creation failed.org.hibernate.MappingException: class model.Usuario not found while looking for property: login
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
        at br.com.supercred.util.HibernateUtil.<clinit>(HibernateUtil.java:17)
        at daos.UsuarioDAO.findUser(UsuarioDAO.java:17)
        at controller.UsuarioBO.buscar(UsuarioBO.java:59)
        at controller.UsuarioBO.logar(UsuarioBO.java:64)
        at br.com.supercred.view.FormLogin.logar(FormLogin.java:252)
        at br.com.supercred.view.FormLogin.btnAcessar2ActionPerformed(FormLogin.java:222)
        at br.com.supercred.view.FormLogin.access$100(FormLogin.java:22)
        at br.com.supercred.view.FormLogin$2.actionPerformed(FormLogin.java:100)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at ch.randelshofer.quaqua.QuaquaButtonListener.mouseReleased(QuaquaButtonListener.java:81)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
        at java.awt.Component.processMouseEvent(Component.java:6263)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        at java.awt.Component.processEvent(Component.java:6028)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: org.hibernate.MappingException: class model.Usuario not found while looking for property: login
        at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:232)
        at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:302)
        at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2193)
        at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2170)
        at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2060)
        at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:381)
        at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:295)
        at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)
        at org.hibernate.cfg.Configuration.add(Configuration.java:716)
        at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:519)
        at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1333)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
        at br.com.supercred.util.HibernateUtil.<clinit>(HibernateUtil.java:14)
        ... 33 more
Caused by: java.lang.ClassNotFoundException: model.Usuario
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
        at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:228)
        ... 46 more
THIAGOANALISTA

iuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu, consegui aqui cara, fazer uma tela de login usando Hibernate Annotations 3.3.1.GA e BD mysql, era a barra mesmo que estava errada, valeu pela dica.Tinha uns seis meses que estava estudando isso.

Criado 7 de agosto de 2010
Ultima resposta 7 de ago. de 2010
Respostas 6
Participantes 3