IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Hibernate Java Discussion :

[Débutant]Association biderectionnelle un à plusieurs


Sujet :

Hibernate Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre Expert
    Avatar de Alexandre T
    Homme Profil pro
    Chef de projets AMO
    Inscrit en
    Mai 2002
    Messages
    1 213
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projets AMO
    Secteur : Transports

    Informations forums :
    Inscription : Mai 2002
    Messages : 1 213
    Par défaut [Débutant]Association biderectionnelle un à plusieurs
    Bonjour, voici deux fichiers de mes fichiers de mapping qui fonctionne pour une realtion unidirectionnelle un à plusieurs.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    <?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 default-lazy="true">
        <!--  Couche Hibernate des derniers etats en faisant appel à la vue -->
        <class
            name="i2.application.vh.valueobject.Etr"
            table="tj_etattempsreel_etr">
            <cache usage="read-write"/>
            <id name="id" column="etr_id">
                <generator class="native"/>
            </id> 
            <property name="sens" column="etr_sens"/>
            <property name="inscription" column="etr_ins"/>        
            <property name="chaussee" column="etr_chaussee"/>        
            <many-to-one name="tro" column="tro_id" not-null="true"/>
            <many-to-one name="cnd" column="cnd_id" not-null="true"/>
         </class>
    </hibernate-mapping>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
     
    <?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 default-lazy="true">
        <class
            name="i2.application.vh.valueobject.Tro"
            table="te_troncon_tro">
            <cache usage="read-write"/>
            <id name="id" column="tro_id">
                <generator class="native"/>
            </id>        
            <property name="libelle" column="tro_lib"/>
            <property name="ordre" column="tro_ord"/>
            <property name="zoneSensible" column="tro_zone_sensible"/>
            <property name="moins" column="tro_moins" not-null="false"/>
            <property name="plus" column="tro_plus"  not-null="false"/>
            <many-to-one name="axe" column="axe_id" />
            <many-to-one name="dis" column="dis_id" />
            <many-to-one name="cei" column="cei_id" />
        </class>
    </hibernate-mapping>
    Ces deux fichiers sont associées aux classes suivantes :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
     
    /***********************************************************************
     * Module:  Dis.java
     * Author:  tranchant
     * Purpose: Defines the Class Dis
     ***********************************************************************/
     
    /*import java.util.*;*/
     
    package i2.application.vh.valueobject;
     
    import java.io.Serializable;
     
    /** Classe des tronçons
     * 
     * @pdOid 60ba5325-a309-4d1a-b382-417df1f8ffc1 */
    public class Tro extends AbstractDataLibelle implements Serializable {
       /** @pdOid 01c8cabd-75fc-4d3f-868c-70b529c402cf */
       private static final long serialVersionUID = 223L;
       /** @pdOid 37e66547-5bb5-4370-a9c2-950f8664ae6a */
       private Integer ordre;
       /** @pdOid 8ce6367e-7e3d-496a-89c8-74c1308da75d */
       private boolean zoneSensible = false;
       /** @pdOid 1bf566fa-95ea-4c9f-b4ad-646351655dc8 */
       private String moins;
       /** @pdOid d5b2d412-274c-40cd-9bba-a1056dbb652d */
       private String plus;
     
       /** @pdRoleInfo migr=no name=Etr assc=association9 coll=java.util.Set impl=java.util.HashSet mult=1..* */
       private java.util.Set<Etr> etr;
     
     
       /** @pdGenerated default getter */
       public java.util.Set<Etr> getEtr() {
          if (etr == null)
             etr = new java.util.HashSet<Etr>();
          return etr;
       }
     
       /** @pdGenerated default iterator getter */
       public java.util.Iterator getIteratorEtr() {
          if (etr == null)
             etr = new java.util.HashSet<Etr>();
          return etr.iterator();
       }
     
       /** @pdGenerated default setter
         * @param newEtr */
       public void setEtr(java.util.Set<Etr> newEtr) {
          removeAllEtr();
          for (java.util.Iterator iter = newEtr.iterator(); iter.hasNext();)
             addEtr((Etr)iter.next());
       }
     
       /** @pdGenerated default add
         * @param newEtr */
       public void addEtr(Etr newEtr) {
          if (newEtr == null)
             return;
          if (this.etr == null)
             this.etr = new java.util.HashSet<Etr>();
          if (!this.etr.contains(newEtr))
          {
             this.etr.add(newEtr);
             newEtr.setTro(this);      
          }
       }
     
       /** @pdGenerated default remove
         * @param oldEtr */
       public void removeEtr(Etr oldEtr) {
          if (oldEtr == null)
             return;
          if (this.etr != null)
             if (this.etr.contains(oldEtr))
             {
                this.etr.remove(oldEtr);
                oldEtr.setTro((Tro)null);
             }
       }
     
       /** @pdGenerated default removeAll */
       public void removeAllEtr() {
          if (etr != null)
          {
             Etr oldEtr;
             for (java.util.Iterator iter = getIteratorEtr(); iter.hasNext();)
             {
                oldEtr = (Etr)iter.next();
                iter.remove();
                oldEtr.setTro((Tro)null);
             }
          }
       }
     
       /** @pdRoleInfo migr=no name=Dis assc=association6 mult=1..1 */
       public Dis dis;
       /** @pdRoleInfo migr=no name=Cei assc=association7 mult=0..1 */
       public Cei cei;
       /** @pdRoleInfo migr=no name=Axe assc=association8 mult=1..1 */
       public Axe axe;
       /** @pdRoleInfo migr=no name=Itr assc=association10 coll=java.util.Set impl=java.util.HashSet mult=1..* */
       public java.util.Set<Itr> itr;
       /** @pdRoleInfo migr=no name=Int assc=association13 mult=0..* */
       public Int[] intervention;
       /** @pdRoleInfo migr=no name=Eta assc=association15 coll=java.util.Set impl=java.util.HashSet mult=0..* */
       public java.util.Set<Eta> eta;
     
       /** @pdOid 3f197e8e-a4fc-4857-8390-ee891eab5831 */
       public Integer getOrdre() {
          return ordre;
       }
     
       /** @param newOrdre
        * @pdOid 91010204-0036-4136-a144-62982d9aac72 */
       public void setOrdre(Integer newOrdre) {
          ordre = newOrdre;
       }
     
       /** @pdOid ae4b999e-25b5-4a83-b6b1-ea3e5e21ebad */
       public boolean getZoneSensible() {
          return zoneSensible;
       }
     
       /** @param newZoneSensible
        * @pdOid 9fa72333-c0d0-4830-b948-bdc8397e9bc0 */
       public void setZoneSensible(boolean newZoneSensible) {
          zoneSensible = newZoneSensible;
       }
     
       /** @pdOid 977368ab-93f3-4567-82c4-13756ea4c7a3 */
       public String getMoins() {
          return moins;
       }
     
       /** @param newMoins
        * @pdOid f7635c60-fcc6-4994-b1bd-e2b4cef5aa53 */
       public void setMoins(String newMoins) {
          moins = newMoins;
       }
     
       /** @pdOid a4fd81ed-df12-4bd0-945a-6a0989dd1867 */
       public String getPlus() {
          return plus;
       }
     
       /** @param newPlus
        * @pdOid f62dad1c-cff8-4452-b094-20dac71288fe */
       public void setPlus(String newPlus) {
          plus = newPlus;
       }
     
     
       /** @pdGenerated default parent getter */
       public Dis getDis() {
          return dis;
       }
     
       /** @pdGenerated default parent setter
         * @param newDis */
       public void setDis(Dis newDis) {
          if (this.dis == null || !this.dis.equals(newDis))
          {
             if (this.dis != null)
             {
                Dis oldDis = this.dis;
                this.dis = null;
                oldDis.removeTro(this);
             }
             if (newDis != null)
             {
                this.dis = newDis;
                this.dis.addTro(this);
             }
          }
       }
       /** @pdGenerated default parent getter */
       public Cei getCei() {
          return cei;
       }
     
       /** @pdGenerated default parent setter
         * @param newCei */
       public void setCei(Cei newCei) {
          if (this.cei == null || !this.cei.equals(newCei))
          {
             if (this.cei != null)
             {
                Cei oldCei = this.cei;
                this.cei = null;
                oldCei.removeTro(this);
             }
             if (newCei != null)
             {
                this.cei = newCei;
                this.cei.addTro(this);
             }
          }
       }
       /** @pdGenerated default parent getter */
       public Axe getAxe() {
          return axe;
       }
     
       /** @pdGenerated default parent setter
         * @param newAxe */
       public void setAxe(Axe newAxe) {
          if (this.axe == null || !this.axe.equals(newAxe))
          {
             if (this.axe != null)
             {
                Axe oldAxe = this.axe;
                this.axe = null;
                oldAxe.removeTro(this);
             }
             if (newAxe != null)
             {
                this.axe = newAxe;
                this.axe.addTro(this);
             }
          }
       }
       /** @pdGenerated default getter */
       public java.util.Set<Itr> getItr() {
          if (itr == null)
             itr = new java.util.HashSet<Itr>();
          return itr;
       }
     
       /** @pdGenerated default iterator getter */
       public java.util.Iterator getIteratorItr() {
          if (itr == null)
             itr = new java.util.HashSet<Itr>();
          return itr.iterator();
       }
     
       /** @pdGenerated default setter
         * @param newItr */
       public void setItr(java.util.Set<Itr> newItr) {
          removeAllItr();
          for (java.util.Iterator iter = newItr.iterator(); iter.hasNext();)
             addItr((Itr)iter.next());
       }
     
       /** @pdGenerated default add
         * @param newItr */
       public void addItr(Itr newItr) {
          if (newItr == null)
             return;
          if (this.itr == null)
             this.itr = new java.util.HashSet<Itr>();
          if (!this.itr.contains(newItr))
          {
             this.itr.add(newItr);
             newItr.setTro(this);      
          }
       }
     
       /** @pdGenerated default remove
         * @param oldItr */
       public void removeItr(Itr oldItr) {
          if (oldItr == null)
             return;
          if (this.itr != null)
             if (this.itr.contains(oldItr))
             {
                this.itr.remove(oldItr);
                oldItr.setTro((Tro)null);
             }
       }
     
       /** @pdGenerated default removeAll */
       public void removeAllItr() {
          if (itr != null)
          {
             Itr oldItr;
             for (java.util.Iterator iter = getIteratorItr(); iter.hasNext();)
             {
                oldItr = (Itr)iter.next();
                iter.remove();
                oldItr.setTro((Tro)null);
             }
          }
       }
       /** @pdGenerated default getter */
       public java.util.Set<Eta> getEta() {
          if (eta == null)
             eta = new java.util.HashSet<Eta>();
          return eta;
       }
     
       /** @pdGenerated default iterator getter */
       public java.util.Iterator getIteratorEta() {
          if (eta == null)
             eta = new java.util.HashSet<Eta>();
          return eta.iterator();
       }
     
       /** @pdGenerated default setter
         * @param newEta */
       public void setEta(java.util.Set<Eta> newEta) {
          removeAllEta();
          for (java.util.Iterator iter = newEta.iterator(); iter.hasNext();)
             addEta((Eta)iter.next());
       }
     
       /** @pdGenerated default add
         * @param newEta */
       public void addEta(Eta newEta) {
          if (newEta == null)
             return;
          if (this.eta == null)
             this.eta = new java.util.HashSet<Eta>();
          if (!this.eta.contains(newEta))
          {
             this.eta.add(newEta);
             newEta.setTro(this);      
          }
       }
     
       /** @pdGenerated default remove
         * @param oldEta */
       public void removeEta(Eta oldEta) {
          if (oldEta == null)
             return;
          if (this.eta != null)
             if (this.eta.contains(oldEta))
             {
                this.eta.remove(oldEta);
                oldEta.setTro((Tro)null);
             }
       }
     
       /** @pdGenerated default removeAll */
       public void removeAllEta() {
          if (eta != null)
          {
             Eta oldEta;
             for (java.util.Iterator iter = getIteratorEta(); iter.hasNext();)
             {
                oldEta = (Eta)iter.next();
                iter.remove();
                oldEta.setTro((Tro)null);
             }
          }
       }
     
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
     
    /***********************************************************************
     * Module:  Dis.java
     * Author:  tranchant
     * Purpose: Defines the Class Dis
     ***********************************************************************/
    /*import java.util.*;*/
     
    package i2.application.vh.valueobject;
     
    import java.io.Serializable;
     
    /** Classe objets des derniers états pour obtenir le listing temps réel
     * 
     * @pdOid 55d60f74-a3da-44d6-b272-0fe92bf31093 */
    public class Etr extends AbstractDataLibelle implements Serializable {
       /** @pdOid 8dd46de5-9f64-478a-b3b6-a25e3bbd08b7 */
       private static final long serialVersionUID = 226L;
       /** @pdOid 4d2636ed-a5bf-499b-8409-a3e53a382476 */
       private boolean sens;
       /** Date d'enregistrement de l'information. On considère que c'est la date du relevé
        * 
        * @pdOid 8a6f4b5a-c1af-49a7-a8c9-1b9f4ab68bce */
       private java.util.Date inscription;
       /** @pdOid 539aa331-8562-4c6b-bd7e-a97ec7ae7ae2 */
       private Integer chaussee = new Integer(1);
     
       /** @pdRoleInfo migr=no name=Cnd assc=association12 mult=1..1 */
       public Cnd cnd;
       /** @pdRoleInfo migr=no name=Tro assc=association9 mult=1..1 side=A */
       public Tro tro;
     
       /** @pdOid bae5fad2-2e02-44e2-b3fb-afb432eb4736 */
       public boolean getSens() {
          return sens;
       }
     
       /** @param newSens
        * @pdOid 7db601f0-4238-401d-acc5-87c2d5d3fc8b */
       public void setSens(boolean newSens) {
          sens = newSens;
       }
     
       /** @param newInscription
        * @pdOid 211dc2e2-cf17-4bad-a41e-58ab943aab97 */
       public void setInscription(java.util.Date newInscription) {
          inscription = newInscription;
       }
     
       /** @pdOid d9a02150-0947-46a1-b1d1-3d1b4a41be0e */
       public java.util.Date getInscription() {
          return inscription;
       }
     
       /** @pdOid a9b9dc78-3684-48dd-add9-d1926a1a46c4 */
       public Integer getChaussee() {
          return chaussee;
       }
     
       /** @param newChaussee
        * @pdOid 1e4d0b22-6ea1-4046-a9e6-15aa4598268d */
       public void setChaussee(Integer newChaussee) {
          chaussee = newChaussee;
       }
     
     
       /** @pdGenerated default parent getter */
       public Cnd getCnd() {
          return cnd;
       }
     
       /** @pdGenerated default parent setter
         * @param newCnd */
       public void setCnd(Cnd newCnd) {
          if (this.cnd == null || !this.cnd.equals(newCnd))
          {
             if (this.cnd != null)
             {
                Cnd oldCnd = this.cnd;
                this.cnd = null;
                oldCnd.removeEtr(this);
             }
             if (newCnd != null)
             {
                this.cnd = newCnd;
                this.cnd.addEtr(this);
             }
          }
       }
       /** @pdGenerated default parent getter */
       public Tro getTro() {
          return tro;
       }
     
       /** @pdGenerated default parent setter
         * @param newTro */
       public void setTro(Tro newTro) {
          if (this.tro == null || !this.tro.equals(newTro))
          {
             if (this.tro != null)
             {
                Tro oldTro = this.tro;
                this.tro = null;
                oldTro.removeEtr(this);
             }
             if (newTro != null)
             {
                this.tro = newTro;
                this.tro.addEtr(this);
             }
          }
       }
     
    }
    Désormais, j'ai besoin de préciser dans mon mapping que mon association devient BIdirectionnelle.
    Dès que je rajoute ce code à Tro.hbm.xml, la servlet plante complètement.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
            <set name="etr">
                <key column="tro_id"/>
                <one-to-many class="Etr"/>
            </set>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
     
    <?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 default-lazy="true">
        <class
            name="i2.application.vh.valueobject.Tro"
            table="te_troncon_tro">
            <cache usage="read-write"/>
            <id name="id" column="tro_id">
                <generator class="native"/>
            </id>        
            <property name="libelle" column="tro_lib"/>
            <property name="ordre" column="tro_ord"/>
            <property name="zoneSensible" column="tro_zone_sensible"/>
            <property name="moins" column="tro_moins" not-null="false"/>
            <property name="plus" column="tro_plus"  not-null="false"/>
            <many-to-one name="axe" column="axe_id" />
            <many-to-one name="dis" column="dis_id" />
            <many-to-one name="cei" column="cei_id" />
            <set name="etr">
                <key column="tro_id"/>
                <one-to-many class="Etr"/>
            </set>
        </class>
    </hibernate-mapping>
    Je cherche depuis un moment mais je ne trouve pas la cause de ce plantage.

    Ci-dessous j'ai extrait le debuggage d'hibernate :
    [2007-07-10 16:57:13,363] INFO (org.hibernate.cfg.HbmBinder) - Mapping class: i2.application.vh.valueobject.Tro -> te_troncon_tro ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: id -> tro_id ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: libelle -> tro_lib ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: ordre -> tro_ord ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: zoneSensible -> tro_zone_sensible ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: moins -> tro_moins ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: plus -> tro_plus ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: axe -> axe_id ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: dis -> dis_id ()
    [2007-07-10 16:57:13,363] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: cei -> cei_id ()
    [2007-07-10 16:57:13,378] DEBUG (org.hibernate.cfg.HbmBinder) - Mapped property: etr ()
    [2007-07-10 16:57:13,378] INFO (org.hibernate.cfg.Configuration) - Configured SessionFactory: vhSessionFactory ()
    [2007-07-10 16:57:13,378] DEBUG (org.hibernate.cfg.Configuration) - properties: {java.vendor=Sun Microsystems Inc., catalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5, hibernate.connection.url=jdbc:postgresql://localhost:5432/bd_vh, sun.management.compiler=HotSpot Client Compiler, catalina.useNaming=true, os.name=Windows XP, sun.boot.class.path=C:\Program Files\Java\jre1.5.0_08\lib\rt.jar;C:\Program Files\Java\jre1.5.0_08\lib\i18n.jar;C:\Program Files\Java\jre1.5.0_08\lib\sunrsasign.jar;C:\Program Files\Java\jre1.5.0_08\lib\jsse.jar;C:\Program Files\Java\jre1.5.0_08\lib\jce.jar;C:\Program Files\Java\jre1.5.0_08\lib\charsets.jar;C:\Program Files\Java\jre1.5.0_08\classes, java.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.5.0_08-b03, hibernate.cache.provider_class=i2.application.commun.util.cache.OSCacheProvider, user.name=SYSTEM, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, tomcat.util.buf.StringCache.byte.enabled=true, hibernate.session_factory_name=vhSessionFactory, user.language=fr, java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, sun.boot.library.path=C:\Program Files\Java\jre1.5.0_08\bin, java.version=1.5.0_08, java.util.logging.manager=org.apache.juli.ClassLoaderLogManager, user.timezone=Europe/Paris, sun.arch.data.model=32, java.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed, sun.cpu.isalist=, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., file.separator=\, java.specification.name=Java Platform API Specification, hibernate.cglib.use_reflection_optimizer=false, java.class.version=49.0, user.country=FR, java.home=C:\Program Files\Java\jre1.5.0_08, java.vm.info=mixed mode, sharing, os.version=5.1, path.separator=;, java.vm.version=1.5.0_08-b03, hibernate.connection.password=pdmdpdm, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=usr_vh_proprietaire, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., java.naming.factory.url.pkgs=org.apache.naming, user.home=C:\Documents and Settings\LocalService, java.specification.vendor=Sun Microsystems Inc., java.library.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Fichiers communs\Roxio Shared\DLLShared;C:\Program Files\Autodesk\DWG TrueView\;C:\Program Files\svn-win32-1.4.3\bin\, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=org.postgresql.Driver, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect, common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, catalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5, hibernate.cache.use_query_cache=false, sun.cpu.endian=little, sun.os.patch.level=Service Pack 2, java.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files\Java\jre1.5.0_08\lib\ext, user.dir=C:\Program Files\Apache Software Foundation\Tomcat 5.5, line.separator=
    , java.vm.name=Java HotSpot(TM) Client VM, file.encoding=Cp1252, java.specification.version=1.5} ()
    [2007-07-10 16:57:13,378] DEBUG (org.hibernate.cfg.Configuration) - Preparing to build session factory with filters : {} ()
    [2007-07-10 16:57:13,378] INFO (org.hibernate.cfg.Configuration) - processing extends queue ()
    [2007-07-10 16:57:13,378] INFO (org.hibernate.cfg.Configuration) - processing collection mappings ()
    [2007-07-10 16:57:13,378] DEBUG (org.hibernate.cfg.HbmBinder) - Second pass for collection: i2.application.vh.valueobject.Tro.etr ()
    [2007-07-10 16:57:13,378] ERROR (org.apache.struts.action.ActionServlet) - Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. ()
    Une idée ?
    Alexandre Tranchant
    Chef de projet AMO pour le Cerema.
    Retrouvez mes articles sur PHP et Symfony

  2. #2
    Membre Expert Avatar de willoi
    Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2006
    Messages
    1 355
    Détails du profil
    Informations personnelles :
    Âge : 52
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 1 355
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    [2007-07-10 16:57:13,378] ERROR (org.apache.struts.action.ActionServlet) - Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. ()
    Apparament il te dit qu'il te manque une librairie, tu as bien mis ta librairie Hibernate(ou autres) dans ton classpath?

    C'est peut etre meme celle de Struts en fait ...

  3. #3
    Membre Expert
    Avatar de Alexandre T
    Homme Profil pro
    Chef de projets AMO
    Inscrit en
    Mai 2002
    Messages
    1 213
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projets AMO
    Secteur : Transports

    Informations forums :
    Inscription : Mai 2002
    Messages : 1 213
    Par défaut
    Citation Envoyé par willoi
    Apparament il te dit qu'il te manque une librairie, tu as bien mis ta librairie Hibernate(ou autres) dans ton classpath?

    C'est peut etre meme celle de Struts en fait ...
    Je pense puisque tout fonctionne dès lors que je ne mets pas le <set>....</set> dans mon mapping !

    A défaut, j'ai vérifier les jar : hibernate 3.0.5 et struts 1.2.7 sont bien présents dans mon répertoire %APP_ROOT%/WEB-INF/lib
    Alexandre Tranchant
    Chef de projet AMO pour le Cerema.
    Retrouvez mes articles sur PHP et Symfony

  4. #4
    Membre Expert Avatar de willoi
    Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2006
    Messages
    1 355
    Détails du profil
    Informations personnelles :
    Âge : 52
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 1 355
    Par défaut
    Voyons voir ton web.xml ...

  5. #5
    Membre Expert
    Avatar de Alexandre T
    Homme Profil pro
    Chef de projets AMO
    Inscrit en
    Mai 2002
    Messages
    1 213
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projets AMO
    Secteur : Transports

    Informations forums :
    Inscription : Mai 2002
    Messages : 1 213
    Par défaut
    Le voici.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
     
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
     
        <description> Veille hivernale
        </description>
        <display-name>vh</display-name>
        <context-param>
            <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
            <param-value>vh</param-value>
        </context-param>
     
        <!-- Example filter to set character encoding on each request -->
        <!--
        <filter>
        <filter-name>Set Character Encoding</filter-name>
        <filter-class>
        i2.application.commun.util.filtres.SetCharacterEncodingFilter</filter-class>
        <init-param>
        <param-name>encoding</param-name>
        <param-value>ISO-8859-1</param-value>
        </init-param>
        </filter>
        -->
        <!--
        <filter>
            <filter-name>CacheFilter</filter-name>
            <filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
        </filter>
        -->
        <filter>
            <filter-name>CerbereFilter</filter-name>
            <filter-class>i2.application.cerbere.filter.CerbereFilter</filter-class>
            <init-param>
                <param-name>cerbere/gate/url</param-name>
                <param-value>Authentification</param-value>
            </init-param>
            <init-param>
                <param-name>cerbere/application/id</param-name>
                <param-value>vh</param-value>
            </init-param>
        </filter>
        <!-- Filtre de calcul du temps de service -->
        <filter>
            <filter-name>Timer Filter</filter-name>
            <filter-class>
                i2.application.commun.util.contexte.TimerFilter</filter-class>
        </filter>
     
        <!-- Filtre de gestion des autorisations -->
        <filter>
            <description>Fichier de configuration de la securite</description>
            <filter-name>Security Filter</filter-name>
            <filter-class>
                i2.application.commun.presentation.securite.MySecurityFilter</filter-class>
            <init-param>
                <description>nom du fichier de configuration</description>
                <param-name>config</param-name>
                <param-value>/WEB-INF/classes/security-filter.xml</param-value>
            </init-param>
            <init-param>
                <description>Validation via la DTD du fichier de
                    configuration</description>
                <param-name>validate</param-name>
                <param-value>true</param-value>
            </init-param>
            <init-param>
                <description>Url de l'authentification Cerbere</description>
                <param-name>urlCerbere</param-name>
                <param-value>cerbere.authentification.jsp</param-value>
            </init-param>
            <init-param>
                <description>image Cerbere</description>
                <param-name>imageCerbere</param-name>
                <param-value>cerbere.GetImage.jsp</param-value>
            </init-param>
        </filter>
     
        <!--
        <filter>
        <filter-name>compressionFilter</filter-name>
        <filter-class>
        i2.application.commun.util.compression.CompressionFilter</filter-class>
        <init-param>
        <param-name>compressionThreshold</param-name>
        <param-value>10</param-value>
        </init-param>
        <init-param>
        <param-name>debug</param-name>
        <param-value>1</param-value>
        </init-param>
        </filter>
        <filter-mapping>
        <filter-name>compressionFilter</filter-name>
        <url-pattern>*.do</url-pattern>
        </filter-mapping>
        -->
     
        <!--
        <filter-mapping>
        <filter-name>Set Character Encoding</filter-name>
        <url-pattern>/*</url-pattern>
        </filter-mapping>
        -->
        <!--
        <filter-mapping>
            <filter-name>CacheFilter</filter-name>
            <url-pattern>*.jsp</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>CacheFilter</filter-name>
            <url-pattern>*.do</url-pattern>
        </filter-mapping>
        -->
        <filter-mapping>
            <filter-name>Timer Filter</filter-name>
            <url-pattern>*.do</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>CerbereFilter</filter-name>
            <url-pattern>/connexion.do</url-pattern>
        </filter-mapping>
     
        <filter-mapping>
            <filter-name>Security Filter</filter-name>
            <url-pattern>*.do</url-pattern>
        </filter-mapping>
     
        <listener>
            <listener-class>
                i2.application.commun.util.contexte.UserCounterListener</listener-class>
        </listener>
        <listener>
            <listener-class>
                i2.application.commun.util.contexte.SessionListener</listener-class>
        </listener>
     
        <servlet>
            <servlet-name>Authentification</servlet-name>
            <servlet-class>
                i2.application.cerbere.servlet.AuthentificationServlet</servlet-class>
        </servlet>
     
        <servlet>
            <servlet-name>GetImage</servlet-name>
            <servlet-class>i2.application.cerbere.servlet.GetImage</servlet-class>
        </servlet>
     
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>
                i2.application.commun.presentation.action.GenericActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/classes/struts-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
            </init-param>
            <init-param>
                <param-name>detail</param-name>
                <param-value>0</param-value>
            </init-param>
            <init-param>
                <param-name>validate</param-name>
                <param-value>true</param-value>
            </init-param>
            <load-on-startup>3</load-on-startup>
        </servlet>
     
        <!-- Cactus Servlet Redirector configuration -->
        <servlet>
            <servlet-name>ServletRedirector</servlet-name>
            <servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
        </servlet>
     
     
        <!-- Cactus Servlet Redirector URL mapping -->
        <servlet-mapping>
            <servlet-name>ServletRedirector</servlet-name>
            <url-pattern>/ServletRedirector</url-pattern>
        </servlet-mapping>
     
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>Authentification</servlet-name>
            <url-pattern>/Authentification</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>GetImage</servlet-name>
            <url-pattern>/cerbere.GetImage.jsp</url-pattern>
        </servlet-mapping>
     
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
     
        <!-- redirection des pages d'erreur 403/404/500 -->
        <error-page>
            <error-code>403</error-code>
            <location>/erreur403.do</location>
        </error-page>
     
        <error-page>
            <error-code>404</error-code>
            <location>/erreur404.do</location>
        </error-page>
     
        <error-page>
            <error-code>500</error-code>
            <location>/erreur500.do</location>
        </error-page>
     
        <error-page>
            <exception-type>java.lang.Exception</exception-type>
            <location>/erreur500.do</location>
        </error-page>
     
        <jsp-config>
        </jsp-config>
     
        <resource-ref>
            <description>Oracle Datasource Règles</description>
            <res-ref-name>jdbc/vh</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
        </resource-ref>
        <env-entry>
            <env-entry-name>cerbere/application/id</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>vh</env-entry-value>
        </env-entry>
        <env-entry>
            <env-entry-name>cerbere/cookie/time</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>120</env-entry-value>
        </env-entry>
        <env-entry>
            <env-entry-name>cerbere/gate/url</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>Authentification</env-entry-value>
        </env-entry>
    </web-app>
    Alexandre Tranchant
    Chef de projet AMO pour le Cerema.
    Retrouvez mes articles sur PHP et Symfony

  6. #6
    Membre Expert
    Avatar de Alexandre T
    Homme Profil pro
    Chef de projets AMO
    Inscrit en
    Mai 2002
    Messages
    1 213
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projets AMO
    Secteur : Transports

    Informations forums :
    Inscription : Mai 2002
    Messages : 1 213
    Par défaut
    J'ai trouvé grâce à ton insistance willoi.

    Tu insistais sur le message d'erreur qui présente l'erreur de dépendances... Pourtant j'étais persuader que cela ne pouvait pas venir de là puisque cela marchait avant mon ajout...

    en fait il ne faut pas que je rajoute :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
            <set name="etr"  inverse="true">
                <key column="tro_id"/>
                <one-to-many class="Etr"/>
            </set>

    mais que je rajoute :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
            <set name="etr"  inverse="true">
                <key column="tro_id"/>
                <one-to-many class="i2.application.vh.valueobject.Etr"/>
            </set>
    Un grand merci !
    Alexandre Tranchant
    Chef de projet AMO pour le Cerema.
    Retrouvez mes articles sur PHP et Symfony

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Débutant] relation table 1 à plusieurs
    Par emmablue dans le forum Access
    Réponses: 2
    Dernier message: 12/07/2007, 10h43
  2. Réponses: 6
    Dernier message: 15/03/2007, 10h29
  3. [Débutante] Associer un lien à un Boutton
    Par mouna201 dans le forum Flash
    Réponses: 12
    Dernier message: 31/01/2007, 10h57
  4. Réponses: 6
    Dernier message: 23/11/2006, 16h19
  5. Réponses: 31
    Dernier message: 25/10/2005, 18h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo