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

JPA Java Discussion :

JPA entity collection en json


Sujet :

JPA Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2009
    Messages
    226
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2009
    Messages : 226
    Par défaut JPA entity collection en json
    bonjour,

    j'aimerais pouvoir récupérer les collections d'objet de mes entity JPA bidirectionnel via un service web .
    je suis sous maven jersey et j'utilise org.glassfish.jersey.media mais une fois que j’enlève le @XmlTransient .
    j'ai une erreur Etat HTTP 500 - Internal Server Error alors j'aurais voulu savoir comment faire ?

    Merci d'avance :

    j'ai les entity 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
     
     
    @Entity
    @Table(name = "Personne")
    @XmlRootElement
     
    public class Personne implements Serializable {
     
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Column(name = "KeyPersonne")
        private Integer keyPersonne;
        @Size(max = 255)
        @Column(name = "Actif")
        private String actif;
        @Column(name = "DateCreation")
        @Temporal(TemporalType.TIMESTAMP)
        private Date dateCreation;
        @Column(name = "DateModification")
        @Temporal(TemporalType.TIMESTAMP)
        private Date dateModification;
        // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
        @Size(max = 255)
        @Column(name = "Email")
        private String email;
        // @Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="Invalid phone/fax format, should be as xxx-xxx-xxxx")//if the field contains phone or fax number consider using this annotation to enforce field validation
        @Size(max = 255)
        @Column(name = "Fax")
        private String fax;
        @ManyToOne(cascade = CascadeType.ALL)
        @JoinColumn(name = "keyCivilite")
        private Civilite civilite;
        @ManyToOne(cascade = CascadeType.ALL)
        @JoinColumn(name = "keySociete")
        private Societe societe;
        @Size(max = 255)
        @Column(name = "Nom")
        private String nom;
        @Size(max = 255)
        @Column(name = "Portable")
        private String portable;
        @Size(max = 255)
        @Column(name = "Prenom")
        private String prenom;
        @Size(max = 255)
        @Column(name = "Telephone")
        private String telephone;
        @ManyToOne(cascade = CascadeType.ALL)
        @JoinColumn(name = "KeyTypeUser")
        private TypeUser typeUser;
        //@XmlInverseReference(mappedBy = "Login")
        //@XmlElementWrapper(name="Login")
        @OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
        private Collection<Login> loginCollection;
        @OneToMany(mappedBy = "personne",cascade = CascadeType.ALL)
        private Collection<Droit> droitCollection;
        @OneToMany(mappedBy = "personne",cascade = CascadeType.ALL  )
        private Collection<Projet> projetCollection;
        @OneToMany(mappedBy = "personne",cascade = CascadeType.ALL)
        private Collection<Prospection> prospectionCollection;
        @OneToMany(mappedBy = "commercial",cascade = CascadeType.ALL)
        private Collection<Prospection> ClientCollection;
     
        public Integer getKeyPersonne() {
            return keyPersonne;
        }
     
        public void setKeyPersonne(Integer keyPersonne) {
            this.keyPersonne = keyPersonne;
        }
     
        public String getActif() {
            return actif;
        }
     
        public void setActif(String actif) {
            this.actif = actif;
        }
     
        public Date getDateCreation() {
            return dateCreation;
        }
     
        public void setDateCreation(Date dateCreation) {
            this.dateCreation = dateCreation;
        }
     
        public Date getDateModification() {
            return dateModification;
        }
     
        public void setDateModification(Date dateModification) {
            this.dateModification = dateModification;
        }
     
        public String getEmail() {
            return email;
        }
     
        public void setEmail(String email) {
            this.email = email;
        }
     
        public String getFax() {
            return fax;
        }
     
        public void setFax(String fax) {
            this.fax = fax;
        }
     
        public Civilite getCivilite() {
            return civilite;
        }
     
        public void setCivilite(Civilite civilite) {
            this.civilite = civilite;
        }
     
        public Societe getSociete() {
            return societe;
        }
     
        public void setSociete(Societe societe) {
            this.societe = societe;
        }
     
        public String getNom() {
            return nom;
        }
     
        public void setNom(String nom) {
            this.nom = nom;
        }
     
        public String getPortable() {
            return portable;
        }
     
        public void setPortable(String portable) {
            this.portable = portable;
        }
     
        public String getPrenom() {
            return prenom;
        }
     
        public void setPrenom(String prenom) {
            this.prenom = prenom;
        }
     
        public String getTelephone() {
            return telephone;
        }
     
        public void setTelephone(String telephone) {
            this.telephone = telephone;
        }
     
        public TypeUser getTypeUser() {
            return typeUser;
        }
     
        public void setTypeUser(TypeUser typeUser) {
            this.typeUser = typeUser;
        }
        @XmlTransient
        public Collection<Login> getLoginCollection() {
            return loginCollection;
        }
     
        public void setLoginCollection(Collection<Login> loginCollection) {
            this.loginCollection = loginCollection;
        }
         @XmlTransient
        public Collection<Droit> getDroitCollection() {
            return droitCollection;
        }
     
        public void setDroitCollection(Collection<Droit> droitCollection) {
            this.droitCollection = droitCollection;
        }
         @XmlTransient
        public Collection<Projet> getProjetCollection() {
            return projetCollection;
        }
     
        public void setProjetCollection(Collection<Projet> projetCollection) {
            this.projetCollection = projetCollection;
        }
         @XmlTransient
        public Collection<Prospection> getProspectionCollection() {
            return prospectionCollection;
        }
     
        public void setProspectionCollection(Collection<Prospection> prospectionCollection) {
            this.prospectionCollection = prospectionCollection;
        }
         @XmlTransient
        public Collection<Prospection> getClientCollection() {
            return ClientCollection;
        }
     
        public void setClientCollection(Collection<Prospection> ClientCollection) {
            this.ClientCollection = ClientCollection;
        }
     
     
     
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (keyPersonne != null ? keyPersonne.hashCode() : 0);
            return hash;
        }
     
     
     
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof Personne)) {
                return false;
            }
            Personne other = (Personne) object;
            if ((this.keyPersonne == null && other.keyPersonne != null) || (this.keyPersonne != null && !this.keyPersonne.equals(other.keyPersonne))) {
                return false;
            }
            return true;
        }
     
        @Override
        public String toString() {
            return "fr.ietevents.serviceweb.Entity.Personne[ keyPersonne=" + keyPersonne + " ]";
        }
     
    }
    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
     
     
     
    @Entity
    @Table(name = "Login")
    @XmlRootElement
    public class Login implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Column(name = "KeyLogin")
        private Integer keyLogin;
        @Size(max = 255)
        @Column(name = "Actif")
        private String actif;
        @Column(name = "DateCreation")
        @Temporal(TemporalType.TIMESTAMP)
        private Date dateCreation;
        @Size(max = 255)
        @Column(name = "Login")
        private String login;
        @Size(max = 255)
        @Column(name = "Password")
        private String password;
        @ManyToOne(cascade = CascadeType.ALL)
        @JoinColumn(name = "KeyPersonne")
        private Personne personne;
     
        public Login() {
        }
     
        public Login(Integer keyLogin) {
            this.keyLogin = keyLogin;
        }
     
        public Integer getKeyLogin() {
            return keyLogin;
        }
     
        public void setKeyLogin(Integer keyLogin) {
            this.keyLogin = keyLogin;
        }
     
        public String getActif() {
            return actif;
        }
     
        public void setActif(String actif) {
            this.actif = actif;
        }
     
        public Date getDateCreation() {
            return dateCreation;
        }
     
        public void setDateCreation(Date dateCreation) {
            this.dateCreation = dateCreation;
        }
     
        public String getLogin() {
            return login;
        }
     
        public void setLogin(String login) {
            this.login = login;
        }
     
        public String getPassword() {
            return password;
        }
     
        public void setPassword(String password) {
            this.password = password;
        }
     
        public Personne getPersonne() {
            return personne;
        }
     
        public void setPersonne(Personne personne) {
            this.personne = personne;
        }
     
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (keyLogin != null ? keyLogin.hashCode() : 0);
            return hash;
        }
     
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof Login)) {
                return false;
            }
            Login other = (Login) object;
            if ((this.keyLogin == null && other.keyLogin != null) || (this.keyLogin != null && !this.keyLogin.equals(other.keyLogin))) {
                return false;
            }
            return true;
        }
     
        @Override
        public String toString() {
            return "fr.ietevents.serviceweb.Entity.Login[ keyLogin=" + keyLogin + " ]";
        }
     
    }

  2. #2
    Membre éclairé
    Profil pro
    Développeur Java
    Inscrit en
    Juillet 2008
    Messages
    42
    Détails du profil
    Informations personnelles :
    Localisation : France, Loire (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 42
    Par défaut
    Pourrait-on avoir le fichier server.log de ton serveur Glassfish ou, à défaut, au moins l'exception complète avec le descriptif de la pile d'appel, s'il te plait ?

  3. #3
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2009
    Messages
    226
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2009
    Messages : 226
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    28-Dec-2015 11:35:56.355 INFO [http-nio-8084-exec-213] org.apache.catalina.startup.HostConfig.deployDescriptor Déploiement du descripteur de configuration C:\Users\IETEVENTS\AppData\Roaming\NetBeans\8.1\apache-tomcat-8.0.27.0_base\conf\Catalina\localhost\ServiceWeb.xml
    28-Dec-2015 11:35:58.975 INFO [http-nio-8084-exec-213] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    28-Dec-2015 11:36:00.424 INFO [http-nio-8084-exec-213] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor C:\Users\IETEVENTS\AppData\Roaming\NetBeans\8.1\apache-tomcat-8.0.27.0_base\conf\Catalina\localhost\ServiceWeb.xml has finished in 4*069 ms
    28-Dec-2015 11:36:00.474 INFO [http-nio-8084-exec-215] org.apache.catalina.util.LifecycleBase.start The start() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ServiceWeb]] after start() had already been called. The second call will be ignored.
    [EL Info]: 2015-12-28 11:36:04.733--ServerSession(1753278475)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
    [EL Info]: connection: 2015-12-28 11:36:05.191--ServerSession(1753278475)--file:/C:/IETEvents/Project/ietevents/ietevents/ServiceWeb/target/ServiceWeb/WEB-INF/classes/_fr.ietevents_ServiceWeb_war_1.0-SNAPSHOTPU login successful
    [EL Warning]: 2015-12-28 11:36:05.564--ServerSession(1753278475)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: La colonne identité 'SEQ_NAME' doit avoir le type de données int, bigint, smallint, tinyint, decimal ou numeric avec une échelle = 0, et être contrainte à ne pas accepter les valeurs NULL.
    Error Code: 2749
    Call: CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(255) IDENTITY NOT NULL, SEQ_COUNT NUMERIC(28) NULL, PRIMARY KEY (SEQ_NAME))
    Query: DataModifyQuery(sql="CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(255) IDENTITY NOT NULL, SEQ_COUNT NUMERIC(28) NULL, PRIMARY KEY (SEQ_NAME))")
    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
     
    <!DOCTYPE html>
    <html>
        <head>
            <title>Apache Tomcat/8.0.27 - Rapport d''erreur</title>
            <style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}.line {height: 1px; background-color: #525D76; border: none;}</style>
        </head>
        <body>
            <h1>Etat HTTP 500 - Internal Server Error</h1>
            <div class="line"></div>
            <p>
                <b>type</b> Rapport d''état
            </p>
            <p>
                <b>message</b>
                <u>Internal Server Error</u>
            </p>
            <p>
                <b>description</b>
                <u>Le serveur a rencontré une erreur interne qui l''a empêché de satisfaire la requête.</u>
            </p>
            <hr class="line">
                <h3>Apache Tomcat/8.0.27</h3>
            </body>
        </html>

  4. #4
    Membre éclairé
    Profil pro
    Développeur Java
    Inscrit en
    Juillet 2008
    Messages
    42
    Détails du profil
    Informations personnelles :
    Localisation : France, Loire (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 42
    Par défaut
    Je ne connais pas EclipseLink, mais j'aurais tendance à dire que ton problème vient de l'initialisation de EclipseLink et plus particulièrement de la façon dont cette implémentation de JPA génère les clefs numériques automatiques :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    [EL Warning]: 2015-12-28 11:36:05.564--ServerSession(1753278475)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: La colonne identité 'SEQ_NAME' doit avoir le type de données int, bigint, smallint, tinyint, decimal ou numeric avec une échelle = 0, et être contrainte à ne pas accepter les valeurs NULL.
    Error Code: 2749
    Call: CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(255) IDENTITY NOT NULL, SEQ_COUNT NUMERIC(28) NULL, PRIMARY KEY (SEQ_NAME))
    Qu'en penses-tu ?
    EclipseLink attend un nombre sur la colonne 'SEQ_NAME' de la table SEQUENCE, ce qui est visiblement incorrect. Es-tu sûr du contenu de ton fichier persistence.xml ? Pourrais-tu le fournir, s'il te plait ?

    EDIT : D'après cette documentation ( http://wiki.eclipse.org/Introduction...nce_Generation ) la table SEQUENCE est générérée par défaut par EclipseLink.
    Aurais-tu d'autres entités JPA dans ton projet dont la génération de clef primaire serait pilotée par l'une des annotations suivantes ?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    @GeneratedValue(strategy=GenerationType.TABLE)
    ou

  5. #5
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2009
    Messages
    226
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2009
    Messages : 226
    Par défaut
    j'utilise partout :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
      @GeneratedValue(strategy = GenerationType.IDENTITY)

    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
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
      <persistence-unit name="fr.ietevents_ServiceWeb_war_1.0-SNAPSHOTPU">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <class>fr.ietevents.serviceweb.Entity.Droit</class>
        <class>fr.ietevents.serviceweb.Entity.TypeUser</class>
        <class>fr.ietevents.serviceweb.Entity.Personne</class>
        <class>fr.ietevents.serviceweb.Entity.Session</class>
        <class>fr.ietevents.serviceweb.Entity.Adresse</class>
        <class>fr.ietevents.serviceweb.Entity.Societe</class>
        <class>fr.ietevents.serviceweb.Entity.Localite</class>
        <class>fr.ietevents.serviceweb.Entity.Login</class>
        <class>fr.ietevents.serviceweb.Entity.TypeContact</class>
        <class>fr.ietevents.serviceweb.Entity.Serveur</class>
        <class>fr.ietevents.serviceweb.Entity.Service</class>
        <class>fr.ietevents.serviceweb.Entity.Pays</class>
        <class>fr.ietevents.serviceweb.Entity.Memo</class>
        <class>fr.ietevents.serviceweb.Entity.Civilite</class>
        <class>fr.ietevents.serviceweb.Entity.Prospection</class>
        <class>fr.ietevents.serviceweb.Entity.ContenuSite</class>
        <class>fr.ietevents.serviceweb.Entity.Projet</class>
        <class>fr.ietevents.serviceweb.Entity.Sequence</class>
        <class>fr.ietevents.serviceweb.Entity.Email</class>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
          <property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://localhost:1433;databaseName=Config"/>
          <property name="javax.persistence.jdbc.user" value="user"/>
          <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
          <property name="javax.persistence.jdbc.password" value="pass"/>
          <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
        </properties>
      </persistence-unit>
    </persistence>

  6. #6
    Membre éclairé
    Profil pro
    Développeur Java
    Inscrit en
    Juillet 2008
    Messages
    42
    Détails du profil
    Informations personnelles :
    Localisation : France, Loire (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2008
    Messages : 42
    Par défaut
    Vérifie ton entité fr.ietevents.serviceweb.Entity.Sequence ... Ne serait-ce pas elle que pointe l'erreur figurant dans ton Glassfish ?

    N'aurais-tu pas les annotations

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
    sur l'attribut qui mappe la colonne SEQ_NAME, alors qu'il serait de type String ? (D'où le message d'erreur et le plantage à l'initialisation de EclipseLink)

  7. #7
    Membre Expert
    Homme Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 963
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 963
    Par défaut
    [QUOTE=mimi6060;8484133]
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    Call: CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(255) IDENTITY NOT NULL, SEQ_COUNT NUMERIC(28) NULL, PRIMARY KEY (SEQ_NAME))
    Query: DataModifyQuery(sql="CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(255) IDENTITY NOT NULL, SEQ_COUNT NUMERIC(28) NULL, PRIMARY KEY (SEQ_NAME))")

    nommer une table (SEQUENCE) en utilisant un mot réservé de SQL ne peut qu'attirer des ennuis…

  8. #8
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2009
    Messages
    226
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2009
    Messages : 226
    Par défaut
    j'ai suprimer l'entity sequence j'ai toujours le message suivant :

    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
     java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org/eclipse/persistence/internal/localization/i18n/LoggingLocalizationResource_fr_FR.properties]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    	at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1355)
    	at org.apache.catalina.loader.WebappClassLoaderBase.getResourceAsStream(WebappClassLoaderBase.java:1088)
    	at java.util.ResourceBundle$Control$1.run(ResourceBundle.java:2677)
    	at java.util.ResourceBundle$Control$1.run(ResourceBundle.java:2662)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2661)
    	at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1501)
    	at java.util.ResourceBundle.findBundle(ResourceBundle.java:1465)
    	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1361)
    	at java.util.ResourceBundle.getBundle(ResourceBundle.java:845)
    	at org.eclipse.persistence.internal.localization.EclipseLinkLocalization.buildMessage(EclipseLinkLocalization.java:60)
    	at org.eclipse.persistence.internal.localization.EclipseLinkLocalization.buildMessage(EclipseLinkLocalization.java:34)
    	at org.eclipse.persistence.internal.localization.LoggingLocalization.buildMessage(LoggingLocalization.java:25)
    	at org.eclipse.persistence.logging.AbstractSessionLog.formatMessage(AbstractSessionLog.java:987)
    	at org.eclipse.persistence.logging.DefaultSessionLog.log(DefaultSessionLog.java:142)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.log(AbstractSession.java:3491)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.log(AbstractSession.java:4681)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.log(AbstractSession.java:4653)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.log(AbstractSession.java:4629)
    	at org.eclipse.persistence.internal.sessions.AbstractSession.log(AbstractSession.java:4551)
    	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.logout(DatabaseSessionImpl.java:937)
    	at org.eclipse.persistence.sessions.server.ServerSession.logout(ServerSession.java:776)
    	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.removeSessionFromGlobalSessionManager(EntityManagerSetupImpl.java:511)
    	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.undeploy(EntityManagerSetupImpl.java:2850)
    	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.close(EntityManagerFactoryDelegate.java:267)
    	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.finalize(EntityManagerFactoryDelegate.java:344)
    	at java.lang.System$2.invokeFinalize(System.java:1270)
    	at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
    	at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
    	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)

Discussions similaires

  1. [2.x] Formulaire dynamique, data transformer entity -> collection
    Par symfony_dev dans le forum Symfony
    Réponses: 7
    Dernier message: 14/01/2015, 14h48
  2. jpa @entity OK mais pas @EntityListeners
    Par ThomasEscolan dans le forum JPA
    Réponses: 4
    Dernier message: 02/07/2013, 11h33
  3. Problème avec JPA Entity et l'annotation Column
    Par riadhhwajdii dans le forum JPA
    Réponses: 5
    Dernier message: 07/01/2011, 11h23
  4. Question JPA Entity manager
    Par fdc.j dans le forum JPA
    Réponses: 0
    Dernier message: 24/04/2009, 22h45
  5. jpa: entity et tables
    Par MattA184575 dans le forum JPA
    Réponses: 2
    Dernier message: 08/01/2009, 13h13

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