Bonjour, voila une erreur qui me cause bien des soucis :
Code:
cause mère
org.hibernate.InvalidMappingException: Could not parse mapping document from resource test/Target.hbm.xml
org.hibernate.cfg.Configuration.addResource(Configuration.java:575)
org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1593)
org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1561)
org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)
org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
org.apache.jsp.index_jsp._jspService(index_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
cause mère
org.hibernate.DuplicateMappingException: Duplicate class/entity mapping test.Target
org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:145)
org.hibernate.cfg.Configuration.add(Configuration.java:675)
org.hibernate.cfg.Configuration.addInputStream(Configuration.java:510)
org.hibernate.cfg.Configuration.addResource(Configuration.java:572)
org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1593)
org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1561)
org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)
org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
org.apache.jsp.index_jsp._jspService(index_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
je ne comprend pas car j'ai vérifier le nom de mon fichier, son emplacement mais rien à faire, je vais vous montrer le reste de mon code...
hibernate.cfg.xmlCode:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///nod</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping resource="test/Target.hbm.xml" />
<mapping resource="test/Node.hbm.xml" />
</session-factory>
</hibernate-configuration>
Target.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 24 juin 2008 11:01:44 by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
<class name="test.Target" table="target" catalog="nod">
<id name="idObject" type="string">
<column name="id_object" length="10" />
<generator class="assigned" />
</id>
<property name="idNode" type="string">
<column name="id_node" length="10" not-null="true" />
</property>
<property name="name" type="string">
<column name="name" length="30" not-null="true" />
</property>
</class>
</hibernate-mapping>
puis mon fichier de test
index.jspCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 24 juin 2008 11:01:44 by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
<class name="test.Target" table="target" catalog="nod">
<id name="idObject" type="string">
<column name="id_object" length="10" />
<generator class="assigned" />
</id>
<property name="idNode" type="string">
<column name="id_node" length="10" not-null="true" />
</property>
<property name="name" type="string">
<column name="name" length="30" not-null="true" />
</property>
</class>
</hibernate-mapping>
Voila voila, merci d'avance[/b]