Re: Netbeans + hibernate -> ou mettre les elements ?
mathieu kobsch <[email protected]> Wed, 21 Mar 2007 11:58:44 +0100
| Newsgroups | gmane.comp.java.netbeans.general.french |
|---|---|
| Message-ID | <[email protected]> |
j'ai trouvé !
j'ai mis ce mapping et cela semble marcher
<hibernate-mapping package="essai">
<class name="Toto" table="toto">
<id name="id" column="id">
<generator class="native"/>
</id>
<property name="nom" column="nom"/>
</class>
</hibernate-mapping>
mais il m'indique une erreur dans l'affichage du servlet ( mais pas dans
les log de tomcat )
*exception*
org.hibernate.HibernateException: No CurrentSessionContext configured!
org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:542)
essai.voir.doGet(voir.java:43)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
Il ya une autre erreur encore. je continue de chercher mais si qqu'un
sait, qu'il n'hésite pas :-)
cordialement mathieu kobsch
mathieu kobsch a écrit :
> Bonjour
>
> Merci pour les adresse mais cela fait 5 jour que je connais ton blog hihi
> j'ai réussi la premiere partie et grace à toi j'ai pu valider
> l'installation de mysql et la connexion mysql<->Java sans Hibernate
>
> par contre j'avoue que j'ai suivit a la lettre ton tuto pour les
> partie 2 et 3 mais à cause de mon probleme de path, cela ne marche
> pas. Je vais restester avec ta solution que tu m'a indiquer. Je
> lacherai pas le bout :-)
>
> Voila il lit correctement mon fichier hibernate.cfg.xml mais j'ai un
> nouveau soucis * j'ai la poisse * :
>
>
> Log de tomcat :
> Initial SessionFactory creation
> failed.org.hibernate.InvalidMappingException: Could not parse mapping
> document from resource ./essai/Toto.hbm.xml
>
> j'ai modifier le fichier en question que voici :
>
>
> <?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="Toto" table="toto">
> <id name="id" column="id" type="integer">
> <generator class="increment"/>
> </id>
> <property name="nom" column="nom"/>
> </class>
>
> </hibernate-mapping>
>
> et je rappelle la table :
>
> CREATE TABLE `toto` (
> `id` int(10) unsigned NOT NULL auto_increment,
> `nom` varchar(20) NOT NULL default 'toto',
> PRIMARY KEY (`id`)
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8
>
>
> bonne continuation
> cordialement Mathieu Kobsch
>
> ps : Si j'arrive à valider mon processus, je pense faire un tuto pour
> Netbeans 5.5 / Hibernate 3.2 / MySQL 5.0, j'ai déja ecrit une bonne
> partie via cette email, je n'ai qu'a corriger ce qui coince....
>
> ps2: sinon Stephane je crois que des gens attendent la 4eme partie sur
> struts voir les commentaire sur ton blog ;-)
>
> ps3: je vais retravailler ton tuto
> j'ai du faire une erreur a un moment donnée
>
>
>
> Stephane Bourzeix a écrit :
>> Tiens, et un peu de pub au passage :
>>
>> http://www.bourzeix.com/weblog/index/2005/05/21/121-netbeans-tomcat-struts-et-hibernate
>> <http://www.bourzeix.com/weblog/index/2005/05/21/121-netbeans-tomcat-struts-et-hibernate>
>>
>>
>> http://www.bourzeix.com/weblog/index/2005/06/09/122-netbeans-une-application-web-hibernate
>>
>>
>> http://www.bourzeix.com/weblog/index/2005/07/10/139-netbeans-une-application-web-hibernate-et-servlet-partie-iii
>>
>>
>> ;-)
>>
>> --
>> Stéphane Bourzeix
>> ------------------------------------------------
>> http://www.bourzeix.com/weblog/
>> ------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>