Salut à tous,
je suis un peu débutant, j'utilise Hibernate/JPA afin de réaliser une application web destinée à un client léger, quand je passe au déploiement du mon projet ejb, le serveur d'application Glassfish affiche ce message:
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
 
deployed with moduleid = monPackage2-ejb
Processing PersistenceUnitInfo [
        name: monPackage2-ejbPU
        ...]
found EJB3 Entity bean: monPackage.entites.Diagnostic
found EJB3 Entity bean: monPackage.entites.Examens
found EJB3 Entity bean: monPackage.entites.Images
found EJB3 Entity bean: monPackage.entites.Medecins
found EJB3 Entity bean: monPackage.entites.Patients
found EJB3 Entity bean: monPackage.entites.Techniciens
Reading mappings from resource: META-INF/orm.xml
[PersistenceUnit: monPackage2-ejbPU] no META-INF/orm.xml found
Binding entity from annotated class: monPackage.entites.Diagnostic
Binding Named query: Diagnostic.findAll => SELECT d FROM Diagnostic d
Binding Named query: Diagnostic.findById => SELECT d FROM Diagnostic d WHERE d.id = :id
Binding Named query: Diagnostic.findByDateDiag => SELECT d FROM Diagnostic d WHERE d.dateDiag = :dateDiag
Bind entity monPackage.entites.Diagnostic on table diagnostic
Binding entity from annotated class: monPackage.entites.Examens
Binding Named query: Examens.findAll => SELECT e FROM Examens e
Binding Named query: Examens.findById => SELECT e FROM Examens e WHERE e.id = :id
Binding Named query: Examens.findByTypeExam => SELECT e FROM Examens e WHERE e.typeExam = :typeExam
Binding Named query: Examens.findByDateEx => SELECT e FROM Examens e WHERE e.dateEx = :dateEx
Binding Named query: Examens.findByModalite => SELECT e FROM Examens e WHERE e.modalite = :modalite
Bind entity monPackage.entites.Examens on table examens
Binding entity from annotated class: monPackage.entites.Images
Binding Named query: Images.findAll => SELECT i FROM Images i
Binding Named query: Images.findById => SELECT i FROM Images i WHERE i.id = :id
Binding Named query: Images.findByTypeImag => SELECT i FROM Images i WHERE i.typeImag = :typeImag
Binding Named query: Images.findByNomFichier => SELECT i FROM Images i WHERE i.nomFichier = :nomFichier
Binding Named query: Images.findByChemin => SELECT i FROM Images i WHERE i.chemin = :chemin
Bind entity monPackage.entites.Images on table images
Binding entity from annotated class: monPackage.entites.Medecins
Binding Named query: Medecins.findAll => SELECT m FROM Medecins m
Binding Named query: Medecins.findById => SELECT m FROM Medecins m WHERE m.id = :id
Binding Named query: Medecins.findByNom => SELECT m FROM Medecins m WHERE m.nom = :nom
Binding Named query: Medecins.findByPrenom => SELECT m FROM Medecins m WHERE m.prenom = :prenom
Binding Named query: Medecins.findByLogin => SELECT m FROM Medecins m WHERE m.login = :login
Binding Named query: Medecins.findByMotPasse => SELECT m FROM Medecins m WHERE m.motPasse = :motPasse
Binding Named query: Medecins.findByHopital => SELECT m FROM Medecins m WHERE m.hopital = :hopital
Binding Named query: Medecins.findByService => SELECT m FROM Medecins m WHERE m.service = :service
Bind entity monPackage.entites.Medecins on table medecins
Binding entity from annotated class: monPackage.entites.Patients
Binding Named query: Patients.findAll => SELECT p FROM Patients p
Binding Named query: Patients.findById => SELECT p FROM Patients p WHERE p.id = :id
Binding Named query: Patients.findByNom => SELECT p FROM Patients p WHERE p.nom = :nom
Binding Named query: Patients.findByPrenom => SELECT p FROM Patients p WHERE p.prenom = :prenom
Binding Named query: Patients.findByDateNaiss => SELECT p FROM Patients p WHERE p.dateNaiss = :dateNaiss
Binding Named query: Patients.findBySexe => SELECT p FROM Patients p WHERE p.sexe = :sexe
Bind entity monPackage.entites.Patients on table patients
Binding entity from annotated class: monPackage.entites.Techniciens
Binding Named query: Techniciens.findAll => SELECT t FROM Techniciens t
Binding Named query: Techniciens.findById => SELECT t FROM Techniciens t WHERE t.id = :id
Binding Named query: Techniciens.findByNom => SELECT t FROM Techniciens t WHERE t.nom = :nom
Binding Named query: Techniciens.findByPrenom => SELECT t FROM Techniciens t WHERE t.prenom = :prenom
Binding Named query: Techniciens.findByLogin => SELECT t FROM Techniciens t WHERE t.login = :login
Binding Named query: Techniciens.findByMotPasse => SELECT t FROM Techniciens t WHERE t.motPasse = :motPasse
Binding Named query: Techniciens.findByHopital => SELECT t FROM Techniciens t WHERE t.hopital = :hopital
Bind entity monPackage.entites.Techniciens on table techniciens
Mapping collection: monPackage.entites.Examens.diagnosticCollection -> diagnostic
Mapping collection: monPackage.entites.Images.examensCollection -> examens
Mapping collection: monPackage.entites.Medecins.diagnosticCollection -> diagnostic
Mapping collection: monPackage.entites.Patients.examensCollection -> examens
Mapping collection: monPackage.entites.Techniciens.examensCollection -> examens
Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
Using provided datasource
RDBMS: MySQL, version: 5.0.67-community-nt
JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.5 ( $Date: 2007-03-01 00:01:06 +0100 (Thu, 01 Mar 2007) $, $Revision: 6329 $ )
Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
instantiating TransactionManagerLookup: org.hibernate.transaction.SunONETransactionManagerLookup
instantiated TransactionManagerLookup
Automatic flush during beforeCompletion(): disabled
Automatic session close at end of transaction: disabled
JDBC batch size: 15
JDBC batch updates for versioned data: disabled
Scrollable result sets: enabled
JDBC3 getGeneratedKeys(): enabled
Connection release mode: auto
Maximum outer join fetch depth: 2
Default batch fetch size: 1
Generate SQL with comments: disabled
Order SQL updates by primary key: disabled
Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
Using ASTQueryTranslatorFactory
Query language substitutions: {}
JPA-QL strict compliance: enabled
Second-level cache: enabled
Query cache: disabled
Cache provider: org.hibernate.cache.NoCacheProvider
Optimize cache for minimal puts: disabled
Structured second-level cache entries: disabled
Statistics: disabled
Deleted entity synthetic identifier rollback: disabled
Default entity-mode: pojo
building session factory
Not binding factory to JNDI, no JNDI name configured
Running hbm2ddl schema export
exporting generated schema to database
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'images'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'medecins'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'patients'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'techniciens'
schema export complete
JNDI InitialContext properties:{}
naming.bind
**RemoteBusinessJndiName: monPackage.façades.DiagnosticFacade; remoteBusIntf: monPackage.façades.DiagnosticFacadeRemote
naming.bind
**RemoteBusinessJndiName: monPackage.façades.ImagesFacade; remoteBusIntf: monPackage.façades.ImagesFacadeRemote
naming.bind
**RemoteBusinessJndiName: monPackage.façades.Techniciens; remoteBusIntf: monPackage.façades.TechniciensFacadeRemote
naming.bind
**RemoteBusinessJndiName: monPackage.façades.PatientsFacade; remoteBusIntf: monPackage.façades.PatientsFacadeRemote
naming.bind
**RemoteBusinessJndiName: monPackage.façades.ExamensFacade; remoteBusIntf: monPackage.façades.ExamensFacadeRemote
naming.bind
**RemoteBusinessJndiName: monPackage.façades.MedecinsFacade; remoteBusIntf: monPackage.façades.MedecinsFacadeRemote
LDR5010: All ejb(s) of [monPackage2-ejb] loaded successfully!
donc, j'ai un problème d'accès à ma base de données MySQL:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
SQL Warning: 1051, SQLState: 42S02
Unknown table 'diagnostic'
SQL Warning: 1051, SQLState: 42S02
Unknown table 'examens'
et aussi le message:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
Not binding factory to JNDI, no JNDI name configured
sachant que le fichier de configuration persistence.xml:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="monPackage2-ejbPU" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>jdbc/monPackage2</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
      <property name="hibernate.hbm2ddl.auto" value="create-drop"/>      
    </properties>
  </persistence-unit>
</persistence>
et ci-dessous, une des mes classes:
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
 
@Entity
@Table(name = "patients")
@NamedQueries({@NamedQuery(name = "Patients.findAll", query = "SELECT p FROM Patients p"), @NamedQuery(name = "Patients.findById", query = "SELECT p FROM Patients p WHERE p.id = :id"), @NamedQuery(name = "Patients.findByNom", query = "SELECT p FROM Patients p WHERE p.nom = :nom"), @NamedQuery(name = "Patients.findByPrenom", query = "SELECT p FROM Patients p WHERE p.prenom = :prenom"), @NamedQuery(name = "Patients.findByDateNaiss", query = "SELECT p FROM Patients p WHERE p.dateNaiss = :dateNaiss"), @NamedQuery(name = "Patients.findBySexe", query = "SELECT p FROM Patients p WHERE p.sexe = :sexe")})
public class Patients implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Basic(optional = false)
    @Column(name = "NOM")
    private String nom;
    @Basic(optional = false)
    @Column(name = "PRENOM")
    private String prenom;
    @Basic(optional = false)
    @Column(name = "DATE_NAISS")
    @Temporal(TemporalType.DATE)
    private Date dateNaiss;
    @Column(name = "SEXE")
    private String sexe;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idPatient")
    private List<Examens> examensCollection;
 
    public Patients() {
    }
 
    public Patients(Long id) {
        this.id = id;
    }
 
    public Patients(Long id, String nom, String prenom, Date dateNaiss) {
        this.id = id;
        this.nom = nom;
        this.prenom = prenom;
        this.dateNaiss = dateNaiss;
    }
 
    //getters+setters
 
    public List<Examens> getExamensCollection() {
        return examensCollection;
    }
 
    public void setExamensCollection(List<Examens> examensCollection) {
        this.examensCollection = examensCollection;
    }
 
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.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 Patients)) {
            return false;
        }
        Patients other = (Patients) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }
 
    @Override
    public String toString() {
        return "monPackage.entites.Patients[id=" + id + "]";
    }
 
}
Je vous remercie infiniment de m'aider.