Bonjour,
j'ai un problème qui persiste depuis plusieurs jours. J'ai cherché un peu partout sur le web, consulté des professionnels en informatique mais rien à faire, impossible de résoudre mon problème. J'explique :
J'essaye de charger une applet via une page Jsp. Celle ci doit interagir avec une servlet en lui envoyer les informations d'un candidature.
Avant tout fonctionnait bien mais sans rien changer de particulier dans le code, je n'arrive jamais à charger l'applet.
je ne sais pas si ca peut aider maisvoici le code des différentes composantes de l'application
la servlet :
La méthode d'envoi des données de l'applet :Code:
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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375 package Servlet; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ import Controleur.Controleur; import Metier.Candidat; import Metier.Candidature; import Metier.Informations; import java.beans.Statement; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Stagiaire.informatiq */ @WebServlet(name = "InterfaceClient", urlPatterns = {"/InterfaceClient"}) public class InterfaceClient extends HttpServlet { /** * Processes requests for both HTTP * <code>GET</code> and * <code>POST</code> methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("methode get"); } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP * <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP * <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // processRequest(request, response); // Récupération des données du formulaire d'index.jsp response.setContentType("application/x-java-serialized-object"); System.out.println("set content type "); ObjectInputStream ois= new ObjectInputStream(request.getInputStream()); String protocole=null; try { protocole = (String)ois.readObject(); } catch (ClassNotFoundException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } char p=protocole.charAt(0); System.out.println("protocole reçu "+p); switch (p){ case 'e': System.out.println("envoi de la liste des emplois"); sendListeEmplois(request,response); break; case 's': System.out.println("envoi de la liste des sites"); sendListeSites(request,response); break; case 'c': System.out.println("reception des infos"); getInfos(request,response); break; } System.out.println("Opération terminée"); } // Si le formulaire est incomplet, renvoi vers le formulaire avec un message d'erreur public void sendListeEmplois(HttpServletRequest request, HttpServletResponse response){ ObjectOutputStream o = null; Controleur c= new Controleur(); response.setContentType("application/x-java-serialized-object"); Vector<String []> v= c.getEmplois(); try{ o = new ObjectOutputStream(response.getOutputStream()); o.writeObject(v); o.flush(); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } finally { try { o.close(); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } } } public void sendListeSites(HttpServletRequest request, HttpServletResponse response){ ObjectOutputStream o = null; Controleur c= new Controleur(); response.setContentType("application/x-java-serialized-object"); Vector<String > v= c.getSites(); try{ o = new ObjectOutputStream(response.getOutputStream()); o.writeObject(v); o.flush(); System.out.println("liste des sites VIVALIA envoyé"); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } finally { try { o.close(); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } } } public Vector<String []> getListeFormations(HttpServletRequest request, HttpServletResponse response){ Vector<String []> paquetRecu=null; try { paquetRecu=new Vector<String []>(); ObjectInputStream o = null; System.out.println("réception de la candidature !!!"); response.setContentType("application/x-java-serialized-object"); System.out.println("set content type "); o = new ObjectInputStream(request.getInputStream()); paquetRecu = (Vector<String []>)o.readObject(); } catch (ClassNotFoundException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } return paquetRecu; } public Vector<String []> getListeExperiences(HttpServletRequest request, HttpServletResponse response){ Vector<String []> paquetRecu=null; try { paquetRecu=new Vector<String []>(); ObjectInputStream o = null; System.out.println("réception de la candidature !!!"); response.setContentType("application/x-java-serialized-object"); System.out.println("set content type "); o = new ObjectInputStream(request.getInputStream()); paquetRecu = (Vector<String []>)o.readObject(); } catch (ClassNotFoundException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } return paquetRecu; } public Vector<String []> getListeLangues(HttpServletRequest request, HttpServletResponse response){ Vector<String []> paquetRecu=null; try { paquetRecu=new Vector<String []>(); ObjectInputStream o = null; System.out.println("réception de la candidature !!!"); response.setContentType("application/x-java-serialized-object"); System.out.println("set content type "); o = new ObjectInputStream(request.getInputStream()); paquetRecu = (Vector<String []>)o.readObject(); } catch (ClassNotFoundException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } return paquetRecu; } public Vector<String> getListeInformatique(HttpServletRequest request, HttpServletResponse response){ Vector<String> paquetRecu=null; try { paquetRecu=new Vector<String>(); ObjectInputStream o = null; System.out.println("réception de la candidature !!!"); response.setContentType("application/x-java-serialized-object"); System.out.println("set content type "); o = new ObjectInputStream(request.getInputStream()); paquetRecu = (Vector<String>)o.readObject(); } catch (ClassNotFoundException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } return paquetRecu; } public Vector<String []> getListeEmploiSolicite(HttpServletRequest request, HttpServletResponse response){ Vector<String []> paquetRecu=null; try { paquetRecu=new Vector<String []>(); ObjectInputStream o = null; System.out.println("réception de la candidature !!!"); response.setContentType("application/x-java-serialized-object"); System.out.println("set content type "); o = new ObjectInputStream(request.getInputStream()); paquetRecu = (Vector<String []>)o.readObject(); } catch (ClassNotFoundException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } return paquetRecu; } public Vector<String> getListeSites(HttpServletRequest request, HttpServletResponse response){ Vector<String> paquetRecu=null; try { paquetRecu=new Vector<String>(); ObjectInputStream o = null; System.out.println("réception de la candidature !!!"); response.setContentType("application/x-java-serialized-object"); System.out.println("set content type "); o = new ObjectInputStream(request.getInputStream()); paquetRecu = (Vector<String>)o.readObject(); } catch (ClassNotFoundException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } return paquetRecu; } public synchronized void getInfos(HttpServletRequest request, HttpServletResponse response){ Vector<String> paquetRecu=new Vector<String>(); try { InputStream i= request.getInputStream(); ObjectInputStream o = new ObjectInputStream(i); ObjectOutputStream rep= new ObjectOutputStream(response.getOutputStream());; rep.writeObject("ok"); rep.flush(); System.out.println("réception de la candidature !!!"); response.setContentType("application/x-java-serialized-object"); System.out.println("set content type "); paquetRecu = (Vector<String>)o.readObject(); rep = new ObjectOutputStream(response.getOutputStream()); rep.writeObject("ok"); rep.flush(); String n=(String)paquetRecu.elementAt(0); //1 String p=(String) paquetRecu.elementAt(1); //2 String s=(String) paquetRecu.elementAt(2); //3 String ldn=(String)paquetRecu.elementAt(3); //4 String ddn=(String)paquetRecu.elementAt(4); //5 String nat=(String)paquetRecu.elementAt(5); //6 String pdt=(String)paquetRecu.elementAt(6); //7 String ec=(String)paquetRecu.elementAt(7); //8 String nc=(String)paquetRecu.elementAt(8); //9 String pc=(String)paquetRecu.elementAt(9); //10 String nrn=(String)paquetRecu.elementAt(10); //11 boolean forem=Boolean.parseBoolean((String)paquetRecu.elementAt(11)); //12 boolean chomeur=Boolean.parseBoolean((String)paquetRecu.elementAt(12)); //13 String dc=(String)paquetRecu.elementAt(13); //14 boolean permis=Boolean.parseBoolean((String)paquetRecu.elementAt(14)); //15 String tp=(String)paquetRecu.elementAt(15); //16 String r=(String)paquetRecu.elementAt(16); //17 String no=(String)paquetRecu.elementAt(17); //18 int cp=Integer.parseInt(""+paquetRecu.elementAt(18)); //19 String loc=(String)paquetRecu.elementAt(19); //20 String com=(String)paquetRecu.elementAt(20); //21 String priv=(String)paquetRecu.elementAt(21); //22 String gsm=(String)paquetRecu.elementAt(22); //23 String mail=(String)paquetRecu.elementAt(23); //24 String type=(String)paquetRecu.elementAt(24); //25 String ta=(String)paquetRecu.elementAt(25); //26 String comp=(String)paquetRecu.elementAt(26); //27 String cd=(String)paquetRecu.elementAt(27); //28 int tpsMin=Integer.parseInt((String)paquetRecu.elementAt(28)); //29 int tpsMax=Integer.parseInt((String)paquetRecu.elementAt(29)); //30 boolean pause=Boolean.parseBoolean((String)paquetRecu.elementAt(30)); //31 boolean weekend=Boolean.parseBoolean((String)paquetRecu.elementAt(31)); //32 boolean hDecale=Boolean.parseBoolean((String)paquetRecu.elementAt(32)); //33 Vector<String []> listeF=this.getListeFormations(request, response); //34 Vector<String []> listeL=this.getListeLangues(request, response); //35 Vector<String> listeI=this.getListeInformatique(request, response); //36 Vector<String []> listeE=this.getListeExperiences(request, response); //37 Vector<String []> listeES=this.getListeEmploiSolicite(request, response); //38 Vector<String> listeS=this.getListeSites(request, response); //39 String format = "dd/MM/yy H:mm:ss"; java.text.SimpleDateFormat formater = new java.text.SimpleDateFormat( format ); java.util.Date date = new java.util.Date(); Controleur cont= new Controleur(); Candidat c=cont.createCandidat(n,p,s,ldn,ddn,nat,pdt,ec,nc,pc,nrn,forem,chomeur,dc,permis,tp,r,no,cp,loc,com,priv,gsm,mail); Informations inf=cont.createInformations(cd, tpsMin, tpsMax, pause, weekend, hDecale, listeF, listeL, listeI, listeE, listeES, listeS); cont.createCandidature(nrn, type, c, inf); /* Candidature c = new Candidature(nomClient,prenomsClient,s,lieuDeNaissance,dateDeNaissance,nationalité,permisDeTravail, nomConjoint,prenomConjoint,etatCivil,numeroRegistreNational,frm,chom,dateChomeur,prms, t,rue,numero,code,localite,commune,prive,gsm,email);*/ System.out.println(n+p+s+ldn+ddn+nat+pdt+ ec+nc+pc+nrn+forem+chomeur+dc+permis+tp+r+ no+cp+loc+com+priv+gsm+mail+type+ta+comp+ tpsMin+tpsMax+pause+weekend+hDecale); } catch (ClassNotFoundException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(InterfaceClient.class.getName()).log(Level.SEVERE, null, ex); } } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
Voici ce que m'affiche la console java lors du chargement de l'applet :Code:
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 private void envoiDonnees() { try { String adresseServlet = "http://localhost:8080/Servlet/InterfaceClient"; URL urlServlet = new URL(adresseServlet); URLConnection connexion= urlServlet.openConnection(); System.out.println("Connexion ouverte"); connexion.setUseCaches(false); connexion.setDefaultUseCaches(false); connexion.setRequestProperty("Content-Type", "application/x-java-serialized-object"); connexion.setDoOutput(true); connexion.setDoInput(true); System.out.println("Ouverture permise"); ObjectOutputStream oos= new ObjectOutputStream(connexion.getOutputStream()); oos.writeObject("c"); oos.flush(); ObjectInputStream ois= new ObjectInputStream(connexion.getInputStream()); String reponse= (String)ois.readObject(); Vector<String> paquet= new Vector<String>(); String n = this.nom_tf.getText(); String p = this.prenom_tf.getText(); String s = this.sexe_cb.getSelectedItem().toString(); String ldn = this.lieuDeNaissance_tf.getText(); String ddn = this.getDateNaissance(false); String nat = this.Nationalité_cb.getSelectedItem().toString(); String pdt = this.permisDeTravail_tf.getText(); String ec = this.etatCivil_cb.getSelectedItem().toString(); String nc = this.nomConjoint_tf.getText(); String pc = this.prenomConjoint_tf.getText(); String nrn = this.numeroRegistreNational_tf.getText(); boolean forem = this.inscritForem_radio.isSelected(); boolean chomeur = this.chomeur_radio.isSelected(); String dc = this.dateChomage_dp.toString(); boolean permis = this.permis_radio.isSelected(); int taille = this.selectionPermisCandidat_table.getModel().getRowCount(); String tp = ""; for (int i = 0; i < taille; i++) { tp += this.selectionPermisCandidat_table.getModel().getValueAt(i, 0)+"/"; } String r = this.rue_tf.getText(); String no = this.numeroRue_tf.getText(); String cp = this.codePostal_tf.getText(); String loc = this.localite_tf.getText(); String com = this.commune_tf.getText(); String priv = this.prive_tf.getText(); String gsm = this.gsm_tf.getText(); String mail = this.adresseMail_tf.getText(); String type = "Appel"; if (this.typeSpontane_radio.isSelected()) { type = "Spontanée"; } String ta=null; String comp=null; if(this.typeAppel_radio.isSelected()){ ta = this.typeAppel_cb.getSelectedItem().toString(); comp = this.complement_tf.getText();} // envoi du tableau etudes-formations int nbFormation = this.etudesFormations_table.getRowCount(); Vector<String[]> listeF = new Vector<String[]>(); for (int i = 0; i < nbFormation; i++) { listeF.add(new String[]{ this.etudesFormations_table.getModel().getValueAt(i, 0).toString(), this.etudesFormations_table.getModel().getValueAt(i, 1).toString(), this.etudesFormations_table.getModel().getValueAt(i, 2).toString() }); } int nbLangues = this.connaissancesLinguistiques_table.getRowCount(); Vector<String[]> listeL = new Vector<String[]>(); for (int i = 0; i < nbLangues; i++) { listeL.add(new String[]{ this.connaissancesLinguistiques_table.getModel().getValueAt(i, 0).toString(), this.connaissancesLinguistiques_table.getModel().getValueAt(i, 1).toString(), this.connaissancesLinguistiques_table.getModel().getValueAt(i, 2).toString(), this.connaissancesLinguistiques_table.getModel().getValueAt(i, 3).toString() }); } Vector<String> ListeI = new Vector<String>(); int tailleI = this.connaissancesInfo.length; for (int i = 0; i < tailleI; i++) { if (this.connaissancesInfo[i].isSelected()) { ListeI.add(this.connaissancesInfo[i].getText()); } } String cd = this.autresConnaissances_ta.getText(); int nbExperience = this.experienceProfessionnelle_table.getRowCount(); Vector<String[]> listeE = new Vector<String[]>(); for (int i = 0; i < nbExperience; i++) { listeE.add(new String[]{ this.experienceProfessionnelle_table.getModel().getValueAt(i, 0).toString(), // début contrat this.experienceProfessionnelle_table.getModel().getValueAt(i, 1).toString(), // fin contrat this.experienceProfessionnelle_table.getModel().getValueAt(i, 2).toString(), // temps de travail this.experienceProfessionnelle_table.getModel().getValueAt(i, 3).toString(), // nom de l'employeur this.experienceProfessionnelle_table.getModel().getValueAt(i, 4).toString(), // adresse de l'employeur this.experienceProfessionnelle_table.getModel().getValueAt(i, 5).toString(), // fonction exercée this.experienceProfessionnelle_table.getModel().getValueAt(i, 6).toString() // motif de départ }); } int nbEmploi = this.emploisSolicites_table.getRowCount(); Vector<String[]> listeES = new Vector<String[]>(); for (int i = 0; i < nbEmploi; i++) { listeES.add(new String[]{ this.emploisSolicites_table.getModel().getValueAt(i, 0).toString(), this.emploisSolicites_table.getModel().getValueAt(i, 1).toString(), }); } int nbSites = this.sitesChoisis_table.getRowCount(); Vector<String> listeS = new Vector<String>(); for (int i = 0; i < nbSites; i++) { listeS.add(new String( this.sitesChoisis_table.getModel().getValueAt(i, 0).toString() )); } int tpsMin=(Integer)this.tempsTravailMinimum_sp.getValue(); int tpsMax=(Integer)this.tempsTravailMaximum_sp.getValue(); boolean pause= this.travailPause_check.isSelected(); boolean weekend= this.travailWeekend_check.isSelected(); boolean hDecale= this.horaireDecale_check.isSelected(); paquet.add(n); //1 paquet.add(p); //2 paquet.add(s); //3 paquet.add(ldn); //4 paquet.add(ddn); //5 paquet.add(nat); //6 paquet.add(pdt); //7 paquet.add(ec); //8 paquet.add(nc); //9 paquet.add(pc); //10 paquet.add(nrn); //11 paquet.add(""+forem); //12 // boolean paquet.add(""+chomeur); //13 // boolean paquet.add(dc); //14 paquet.add(""+permis); //15 // boolean paquet.add(tp); //16 paquet.add(r); //17 paquet.add(no); //18 paquet.add(cp); //19 paquet.add(loc); //20 paquet.add(com); //21 paquet.add(priv); //22 paquet.add(gsm); //23 paquet.add(mail); //24 paquet.add(type); //25 paquet.add(ta); //26 paquet.add(comp); //27 paquet.add(cd); //31 paquet.add(""+tpsMin); //35 paquet.add(""+tpsMax); //36 paquet.add(""+pause); //37 // boolean paquet.add(""+weekend); //38 // boolean paquet.add(""+hDecale); //39 // boolean // JOptionPane.showMessageDialog( // this, // "paquet = "+paquet.toString(), // "Information", // JOptionPane.INFORMATION_MESSAGE); Vector<String []> paquet2= new Vector<String []>(); Vector<String []> paquet3= new Vector<String []>(); Vector<String> paquet4= new Vector<String>(); Vector<String []> paquet5= new Vector<String []>(); Vector<String []> paquet6= new Vector<String []>(); Vector<String> paquet7= new Vector<String>(); paquet2=listeF; //28 paquet3=listeL; //29 paquet4=ListeI; //30 paquet5=listeE; //32 paquet6=listeES; //33 paquet7=listeS; //34 ObjectOutputStream oos2= new ObjectOutputStream(connexion.getOutputStream()); oos2.writeObject(paquet); oos2.flush(); // oos2.close(); ObjectOutputStream oos3= new ObjectOutputStream(connexion.getOutputStream()); oos3.writeObject(paquet2); oos3.flush(); // oos3.close(); ObjectOutputStream oos4= new ObjectOutputStream(connexion.getOutputStream()); oos4.writeObject(paquet3); oos4.flush(); // oos4.close(); ObjectOutputStream oos5= new ObjectOutputStream(connexion.getOutputStream()); oos5.writeObject(paquet4); oos5.flush(); // oos5.close(); ObjectOutputStream oos6= new ObjectOutputStream(connexion.getOutputStream()); oos6.writeObject(paquet5); oos6.flush(); // oos6.close(); ObjectOutputStream oos7= new ObjectOutputStream(connexion.getOutputStream()); oos7.writeObject(paquet6); oos7.flush(); // oos7.close(); ObjectOutputStream oos8= new ObjectOutputStream(connexion.getOutputStream()); oos8.writeObject(paquet7); oos8.flush(); // oos8.close(); ois= new ObjectInputStream(connexion.getInputStream()); reponse= (String)ois.readObject(); } catch (ClassNotFoundException ex) { Logger.getLogger(AppletFormV3.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(AppletFormV3.class.getName()).log(Level.SEVERE, null, ex); } }
A noter que du temps où j'arrivais a charger l'applet, l'échange des données entre la servlet et l'applet fonctionnait nickel.Code:
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 cache: Initialize resource manager: com.sun.deploy.cache.ResourceProviderImpl@1c5a33b security: property package.access value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal. security: property package.access new value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp security: property package.definition value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal. security: property package.definition new value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp security: property package.access value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp security: property package.access new value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss security: property package.definition value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp security: property package.definition new value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss security: property package.access value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss security: property package.access new value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss,com.sun.browser,com.sun.glass,com.sun.javafx,com.sun.media.jfxmedia,com.sun.media.jfxmediaimpl,com.sun.openpisces,com.sun.prism,com.sun.scenario,com.sun.t2k,com.sun.webpane,com.sun.pisces,com.sun.webkit security: property package.definition value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss security: property package.definition new value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imageio.,com.sun.istack.internal.,com.sun.jmx.,com.sun.proxy.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss,com.sun.browser,com.sun.glass,com.sun.javafx,com.sun.media.jfxmedia,com.sun.media.jfxmediaimpl,com.sun.openpisces,com.sun.prism,com.sun.scenario,com.sun.t2k,com.sun.webpane,com.sun.pisces,com.sun.webkit basic: Processus d'écoute de progression ajouté : sun.plugin.util.ProgressMonitorAdapter@a35880 basic: Plugin2ClassLoader.addURL parent called for <a href="http://localhost:8080/gestion_candidatures/AppletCandidature.jar" target="_blank">http://localhost:8080/gestion_candid...andidature.jar</a> basic: Plugin2ClassLoader.addURL parent called for <a href="http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar" target="_blank">http://localhost:8080/gestion_candid...ingx-0.9.5.jar</a> security: La vérification de révocation de la liste noire est activée security: La vérification de liste de bibliothèques sécurisées est activée network: Entrée de cache trouvée [URL*: http://localhost:8080/gestion_candidatures/AppletCandidature.jar, version*: null] prevalidated=false/0 cache: Adding MemoryCache entry: http://localhost:8080/gestion_candidatures/AppletCandidature.jar cache: Resource http://localhost:8080/gestion_candidatures/AppletCandidature.jar has expired. network: Connexion de http://localhost:8080/gestion_candidatures/AppletCandidature.jar avec proxy=DIRECT network: Connexion de http://localhost:8080/ avec proxy=DIRECT network: Code de réponse pour http://localhost:8080/gestion_candidatures/AppletCandidature.jar : 200 network: Encodage pour http://localhost:8080/gestion_candidatures/AppletCandidature.jar : null network: Suspendre la connexion à http://localhost:8080/gestion_candidatures/AppletCandidature.jar CacheEntry[http://localhost:8080/gestion_candidatures/AppletCandidature.jar]: updateAvailable=true,lastModified=Thu Mar 07 15:00:33 CET 2013,length=181020 network: Connexion de http://localhost:8080/gestion_candidatures/AppletCandidature.jar avec proxy=DIRECT network: Connexion de http://localhost:8080/ avec proxy=DIRECT network: CleanupThread used 101191 us network: CleanupThread used 0 us network: Téléchargement de la ressource*: http://localhost:8080/gestion_candidatures/AppletCandidature.jar Content-Length*: 181.020 Content-Encoding : null network: URL http://localhost:8080/gestion_candidatures/AppletCandidature.jar enregistrée dans le fichier C:\Users\stagiaire.informatiq\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\2\3bb6f502-24ad9824-temp security: Le fichier .jar nest pas signé. La vérification de la liste noire sera donc ignorée security: Fichier de liste de bibliothèques sécurisées non trouvé cache: Create from verifier: JarSigningData{hasOnlySignedEntries=false, hasSingleCodeSource=false, hasMissingSignedEntries=false} network: CleanupThread used 1 us cache: Replacing MemoryCache entry (cnt=0) for http://localhost:8080/gestion_candidatures/AppletCandidature.jarwas=com.sun.deploy.cache.CacheEntry (17950701) now=com.sun.deploy.cache.CacheEntry (9543977) network: Created version ID: 1.7.0.17 network: Created version ID: 1.7.0.17 network: Entrée de cache introuvable [URL*: http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar, version*: null] network: Connexion de http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar avec proxy=DIRECT java.io.FileNotFoundException: http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source) at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source) at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source) at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source) at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$1.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) network: Entrée de cache introuvable [URL*: http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar, version*: null] network: Connexion de http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar avec proxy=DIRECT network: Entrée de cache trouvée [URL*: http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar, version*: null] prevalidated=false/0 cache: Adding MemoryCache entry: http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar cache: Resource http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar has expired. network: Connexion de http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar avec proxy=DIRECT network: Code de réponse pour http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar : 304 network: Encodage pour http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar : null network: Suspendre la connexion à http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar cache: Reading Signers from 5 http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar | C:\Users\stagiaire.informatiq\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\2\371b0442-64c55a8f.idx network: Aucune information de certificat sur le fichier JAR non signé : http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar cache: Done readSigners(http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar) cache: Read manifest for http://localhost:8080/gestion_candidatures/swingx-0.9.5.jar: read=199 full=837 network: Entrée de cache introuvable [URL*: http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar, version*: null] network: Connexion de http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar avec proxy=DIRECT java.io.FileNotFoundException: http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source) at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source) at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source) at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source) at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$1.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) network: Entrée de cache introuvable [URL*: http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar, version*: null] network: Connexion de http://localhost:8080/gestion_candidatures/lib/swingx-0.9.5.jar avec proxy=DIRECT basic: Applet chargée. basic: Applet resized and added to parent container basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 213148 us, pluginInit dt 290749 us, TotalTime: 503897 us APPLET : inti() APPLET : inti() aft basic: Applet initialized basic: Starting applet basic: completed perf rollup basic: Applet made visible basic: Applet started basic: Told clients applet is started
C'est pour ca que je pense que le problème vient uniquement de tomcat.
Si quelqu'un peut y jeter un coup d'oeil ca m'aiderais énormément
Merci d'avance