Erro mapeamento hibernate. Nested exception

1 resposta
R

Tenho o mapeamento abaixo. Recebo o erro (abaixo do mapeamento) quando tento iniciar o hibernate.

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
      SYSTEM "hibernate-mapping-3.0.dtd" >

<class name="src.model.Tesoura" table="TESOURA">

	<id name="id" column="TESOURA_ID">
		<generator class="sequence">
			<param name="sequence">TESOURA_GEN</param>
		</generator>
	</id>

	<version name="versao" column="VERSAO" />

	<property name="descricao" unique="true" not-null="true" />

	<idbag name="materiais" lazy="true" cascade="all-delete-orphan"
		table="MATERIAL_DA_TESOURA">
		<collection-id type="integer" column="MATERIAL_DA_TESOURA_ID">
			<generator class="sequence">
				<param name="sequence">MATERIAL_DA_TESOURA_GEN</param>
			</generator>
		</collection-id>
		<key column="TESOURA_ID" not-null="true" />
		<composite-element class="src.model.MaterialDaTesoura">
			<property name="quantidade" />
			<many-to-one name="DescricaoMaterial" />
		</composite-element>
	</idbag>

</class>

08:34:55,34308:34:55,37408:34:55,384org.dom4j.DocumentException: Error on line 33 of document : The markup in the document following the root element must be well-formed. Nested exception: The markup in the document following the root element must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:446)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1162)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1148)
at src.model.HibernateUtil.(HibernateUtil.java:16)
at src.model.GerenciadorTesoura.getTodasTesouras(GerenciadorTesoura.java:10)
at src.swing.TelaPesquisaTesoura.(TelaPesquisaTesoura.java:14)
at src.controller.ControladorTelaPesquisaTesoura.CriarVisao(ControladorTelaPesquisaTesoura.java:20)
at src.controller.ControladorTelaPesquisaModelo.(ControladorTelaPesquisaModelo.java:20)
at src.controller.ControladorTelaPesquisaTesoura.(ControladorTelaPesquisaTesoura.java:14)
at src.swing.MenuPrincipal.actionPerformed(MenuPrincipal.java:94)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Nested exception:
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:446)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1162)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1148)
at src.model.HibernateUtil.(HibernateUtil.java:16)
at src.model.GerenciadorTesoura.getTodasTesouras(GerenciadorTesoura.java:10)
at src.swing.TelaPesquisaTesoura.(TelaPesquisaTesoura.java:14)
at src.controller.ControladorTelaPesquisaTesoura.CriarVisao(ControladorTelaPesquisaTesoura.java:20)
at src.controller.ControladorTelaPesquisaModelo.(ControladorTelaPesquisaModelo.java:20)
at src.controller.ControladorTelaPesquisaTesoura.(ControladorTelaPesquisaTesoura.java:14)
at src.swing.MenuPrincipal.actionPerformed(MenuPrincipal.java:94)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
org.hibernate.MappingException: Error reading resource: src/model/hibernate/Tesoura.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1162)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1148)
at src.model.HibernateUtil.(HibernateUtil.java:16)
at src.model.GerenciadorTesoura.getTodasTesouras(GerenciadorTesoura.java:10)
at src.swing.TelaPesquisaTesoura.(TelaPesquisaTesoura.java:14)
at src.controller.ControladorTelaPesquisaTesoura.CriarVisao(ControladorTelaPesquisaTesoura.java:20)
at src.controller.ControladorTelaPesquisaModelo.(ControladorTelaPesquisaModelo.java:20)
at src.controller.ControladorTelaPesquisaTesoura.(ControladorTelaPesquisaTesoura.java:14)
at src.swing.MenuPrincipal.actionPerformed(MenuPrincipal.java:94)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: org.hibernate.MappingException: org.dom4j.DocumentException: Error on line 33 of document : The markup in the document following the root element must be well-formed. Nested exception: The markup in the document following the root element must be well-formed.
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:405)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:446)
... 39 more
Caused by: org.dom4j.DocumentException: Error on line 33 of document : The markup in the document following the root element must be well-formed. Nested exception: The markup in the document following the root element must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
... 40 more
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at src.model.HibernateUtil.(HibernateUtil.java:19)
at src.model.GerenciadorTesoura.getTodasTesouras(GerenciadorTesoura.java:10)
at src.swing.TelaPesquisaTesoura.(TelaPesquisaTesoura.java:14)
at src.controller.ControladorTelaPesquisaTesoura.CriarVisao(ControladorTelaPesquisaTesoura.java:20)
at src.controller.ControladorTelaPesquisaModelo.(ControladorTelaPesquisaModelo.java:20)
at src.controller.ControladorTelaPesquisaTesoura.(ControladorTelaPesquisaTesoura.java:14)
at src.swing.MenuPrincipal.actionPerformed(MenuPrincipal.java:94)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: org.hibernate.MappingException: Error reading resource: src/model/hibernate/Tesoura.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1313)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1285)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1267)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1234)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1162)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1148)
at src.model.HibernateUtil.(HibernateUtil.java:16)
... 32 more
Caused by: org.hibernate.MappingException: org.dom4j.DocumentException: Error on line 33 of document : The markup in the document following the root element must be well-formed. Nested exception: The markup in the document following the root element must be well-formed.
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:405)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:446)
... 39 more
Caused by: org.dom4j.DocumentException: Error on line 33 of document : The markup in the document following the root element must be well-formed. Nested exception: The markup in the document following the root element must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
... 40 more

1 Resposta

R

Já descobri. xml não tinha a tag .
Só tinha

Criado 5 de maio de 2005
Ultima resposta 5 de mai. de 2005
Respostas 1
Participantes 1