Bonjour tout le monde, aidez moi svp, je suis bloqué depuis 2 jours sur cette exception :
j'ai cherché sur internet mais j'ai pas trouvé une reponse valide, il parle toujours d'un probleme de recursivité , mais je comprend pas ou est la recursivité.
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 javax.servlet.ServletException: L'exécution de la servlet a lancé une exception org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341) org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) cause mère java.lang.StackOverflowError java.lang.Exception.<init>(Exception.java:77) java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:54) sun.reflect.GeneratedMethodAccessor223.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1185) org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:772) org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) org.ajax4jsf.javascript.ScriptUtils.writeScriptToStream(ScriptUtils.java:168) org.ajax4jsf.javascript.ScriptUtils.writeScriptToStream(ScriptUtils.java:174)
je developpe avec jsf v 1.2 et netbeans 6.8.
voila mon code :
- Agence.hbm.xml
-AbstractAgence.java
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 <?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"> <!-- Mapping file autogenerated by MyEclipse Persistence Tools --> <hibernate-mapping> <class name="dao.Agence" table="agence" catalog="location"> <id name="id" type="java.lang.Integer"> <column name="id" /> <generator class="identity" /> </id> <many-to-one name="pays" class="dao.Pays" fetch="select"> <column name="id_pays" length="4" not-null="true" /> </many-to-one> <many-to-one name="ville" class="dao.Ville" fetch="select"> <column name="id_ville" not-null="true" /> </many-to-one> <property name="adresse" type="java.lang.String"> <column name="adresse" length="65535" not-null="true" /> </property> <property name="codePostal" type="java.lang.String"> <column name="code_postal" length="10" not-null="true" /> </property> <property name="email" type="java.lang.String"> <column name="email" length="50" /> </property> <property name="tel" type="java.lang.String"> <column name="tel" length="20" /> </property> <property name="fax" type="java.lang.String"> <column name="fax" length="20" /> </property> <property name="lat" type="java.lang.String"> <column name="lat" length="50" /> </property> <property name="lng" type="java.lang.String"> <column name="lng" length="50" /> </property> <property name="zoom" type="java.lang.Integer"> <column name="zoom" /> </property> <set name="reservationsForAgenceDepart" inverse="true"> <key> <column name="agence_depart" not-null="true" /> </key> <one-to-many class="dao.Reservation" /> </set> <set name="reservationsForAgenceRetour" inverse="true"> <key> <column name="agence_retour" not-null="true" /> </key> <one-to-many class="dao.Reservation" /> </set> <set name="categVoitures" inverse="true"> <key> <column name="id_agence" /> </key> <one-to-many class="dao.CategVoiture" /> </set> </class> </hibernate-mapping>
-BeanPlace.java
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 package dao; import java.util.HashSet; import java.util.Set; /** * AbstractAgence entity provides the base persistence definition of the Agence * entity. @author MyEclipse Persistence Tools */ public abstract class AbstractAgence implements java.io.Serializable { // Fields private Integer id; private Pays pays; private Ville ville; private String adresse; private String codePostal; private String email; private String tel; private String fax; private String lat; private String lng; private Integer zoom; private Set reservationsForAgenceDepart = new HashSet(0); private Set reservationsForAgenceRetour = new HashSet(0); private Set categVoitures = new HashSet(0); // Constructors /** default constructor */ public AbstractAgence() { } /** minimal constructor */ public AbstractAgence(Pays pays, Ville ville, String adresse, String codePostal) { this.pays = pays; this.ville = ville; this.adresse = adresse; this.codePostal = codePostal; } /** full constructor */ public AbstractAgence(Pays pays, Ville ville, String adresse, String codePostal, String email, String tel, String fax, String lat, String lng, Integer zoom, Set reservationsForAgenceDepart, Set reservationsForAgenceRetour, Set categVoitures) { this.pays = pays; this.ville = ville; this.adresse = adresse; this.codePostal = codePostal; this.email = email; this.tel = tel; this.fax = fax; this.lat = lat; this.lng = lng; this.zoom = zoom; this.reservationsForAgenceDepart = reservationsForAgenceDepart; this.reservationsForAgenceRetour = reservationsForAgenceRetour; this.categVoitures = categVoitures; } // Property accessors public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } public Pays getPays() { return this.pays; } public void setPays(Pays pays) { this.pays = pays; } public Ville getVille() { return this.ville; } public void setVille(Ville ville) { this.ville = ville; } public String getAdresse() { return this.adresse; } public void setAdresse(String adresse) { this.adresse = adresse; } public String getCodePostal() { return this.codePostal; } public void setCodePostal(String codePostal) { this.codePostal = codePostal; } public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } public String getTel() { return this.tel; } public void setTel(String tel) { this.tel = tel; } public String getFax() { return this.fax; } public void setFax(String fax) { this.fax = fax; } public String getLat() { return this.lat; } public void setLat(String lat) { this.lat = lat; } public String getLng() { return this.lng; } public void setLng(String lng) { this.lng = lng; } public Integer getZoom() { return this.zoom; } public void setZoom(Integer zoom) { this.zoom = zoom; } public Set getReservationsForAgenceDepart() { return this.reservationsForAgenceDepart; } public void setReservationsForAgenceDepart(Set reservationsForAgenceDepart) { this.reservationsForAgenceDepart = reservationsForAgenceDepart; } public Set getReservationsForAgenceRetour() { return this.reservationsForAgenceRetour; } public void setReservationsForAgenceRetour(Set reservationsForAgenceRetour) { this.reservationsForAgenceRetour = reservationsForAgenceRetour; } public Set getCategVoitures() { return this.categVoitures; } public void setCategVoitures(Set categVoitures) { this.categVoitures = categVoitures; } //////////////////////////////////////////////////////////////////////// constructeur place public AbstractAgence(Integer id, String adresse, String codePostal, String email, String tel, String lat, String lng, Integer zoom) { this.id = id; this.adresse = adresse; this.codePostal = codePostal; this.email = email; this.tel = tel; this.lat = lat; this.lng = lng; this.zoom = zoom; } public AbstractAgence(Integer id, String adresse, String codePostal, String email, String tel, String lat, String lng, Integer zoom, Pays pays) { this.id = id; this.adresse = adresse; this.codePostal = codePostal; this.email = email; this.tel = tel; this.lat = lat; this.lng = lng; this.zoom = zoom; this.pays = pays; } }
- gmap.jsp
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 public class BeanPlace { private ArrayList point; private Integer currentId; private int zoom; private String gmapkey; public Integer getCurrentId() { return currentId; } public void setCurrentId(Integer currentId) { this.currentId = currentId; } public ArrayList getPoint() { if (point == null) { initData(); } return point; } public void setPoint(ArrayList point) { this.point = point; } public Agence getCurrentPlace() { Iterator it = point.iterator(); while (it.hasNext()) { Agence p = (Agence) it.next(); if (currentId.equals(p.getId())) { zoom = p.getZoom(); return p; } } return (Agence) point.get(0); } private List liste; public List getListe() { return liste; } public void setListe(List liste) { this.liste = liste; } private void initData() { AgenceDAO dao = new AgenceDAO(); dao.getSession().beginTransaction(); point = (ArrayList) dao.findAll(); dao.getSession().beginTransaction().commit();System.out.println("point = "+point); } public int getZoom() { return zoom; } public void setZoom(int zoom) { this.zoom = zoom; } public String getGmapkey() { if (gmapkey == null) { gmapkey = createKey(); } return gmapkey; } private String createKey() { HashMap hosts = new HashMap(); hosts.put("localhost", "ABQIAAAAxU6W9QEhFLMNdc3ATIu-VxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRkrpOGzxH8_ud3inE9pG1845-FCA"); hosts.put("localhost:8080", "ABQIAAAAxU6W9QEhFLMNdc3ATIu-VxTwM0brOpm-All5BF6PoaKBxRWWERTHxF5cK19oAMu3MP89kWdchuCH6w"); hosts.put("livedemo.exadel.com", "ABQIAAAAxU6W9QEhFLMNdc3ATIu-VxRl-RYVoXwacweAQq3rWvtlmS78MhRst9EH2cahrIp0_HHi_U1Zn7o1Fg"); ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext(); String host = (String) ec.getRequestHeaderMap().get("host"); String key = (String) hosts.get(host); if (key != null) { return key; } else { return "get the key for your domain at http://www.google.com/apis/maps/signup.html"; } } public void setGmapkey(String gmapkey) { this.gmapkey = gmapkey; } //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Filtre par pays et ville private String pays; private Integer ville; private List listePays; public String getPays() { return pays; } public void setPays(String pays) { this.pays = pays; } public Integer getVille() { return ville; } public void setVille(Integer ville) { this.ville = ville; } public List getListePays() { select des pays qui ont des agences List<SelectItem> SI=new ArrayList<SelectItem>(); List<Pays> l=new ArrayList<Pays>(); PaysDAO fdo=new PaysDAO(); l=fdo.findPaysByAgence(); for(int i=0;i<l.size();i++) { SI.add(new SelectItem(l.get(i).getCode(),l.get(i).getNom())); } return SI; } public void setListePays(List listePays) { this.listePays = listePays; } public Pays getFindPays() { PaysDAO dao = new PaysDAO(); dao.getSession().beginTransaction(); Pays p = dao.findById(pays); dao.getSession().beginTransaction().commit(); return p; } List<SelectItem> listeVillesByPays; public List<SelectItem> getListeVillesByPays() { if (pays == null) { pays = "A"; return (new ArrayList<SelectItem>()); } VilleDAO dao = new VilleDAO(); dao.getSession().beginTransaction(); List<Ville> tmpVille = dao.findByPropertyByAgence("pays", getFindPays()); dao.getSession().beginTransaction().commit(); SelectItem s = new SelectItem(); listeVillesByPays = new ArrayList<SelectItem>(); s = new SelectItem(0, "----------"); boolean test = false; for (Ville v : tmpVille) { if (v.getId().equals(ville)){ test = true; } s = new SelectItem(v.getId(), v.getNom()); listeVillesByPays.add(s); } if (! test){ ville = tmpVille.get(0).getId(); } return listeVillesByPays; } public void setListeVillesByPays(List<SelectItem> listeVillesByPays) { this.listeVillesByPays = listeVillesByPays; } public boolean doFilterByVille(Object value) { if (ville == null) { return (true); } Agence a = (Agence) value; if (a.getVille().getId().equals(ville)) { return (true); } return (false); } public boolean doFilterByPays(Object value) { if (pays == null) { return (true); } Agence a = (Agence) value; if (a.getPays().getCode().equals(pays)) { return (true); } return (false); } }
merci d'avance;
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 <h:panelGroup> <h:form> <a4j:jsFunction name="showPlace" data="#{place.currentPlace}" reRender=":zoom" oncomplete="map.setCenter(new GLatLng(data.lat, data.lng),data.zoom); map.addOverlay(new GMarker(new GLatLng(data.lat, data.lng))); map.openInfoWindow(map.getCenter(),document.createTextNode('#{msg.agency} :'+data.adresse)); map.addControl(new GMapTypeControl()); map.addControl(new GLargeMapControl()); map.addControl(new GOverviewMapControl());"> <a4j:actionparam name="id" assignTo="#{place.currentId}"></a4j:actionparam> </a4j:jsFunction> <table> <tr> <td> <rich:dataTable value="#{place.point}" var="item" rows="2" reRender="ds" style="height:400px;width:250px" rowKeyVar="row" id="dataTable"> <%--<rich:column filterBy="#{item.adresse}" filterEvent="onkeyup" sortBy="#{item.adresse}">--%> <rich:column filterMethod="#{place.doFilterByVille}"> <f:facet name="header"> <h:outputText value="#{msg.agency}" /> </f:facet> <h:panelGrid columns="3"> <h:outputText value="#{msg.zip} :" /> <h:outputText value="#{item.codePostal}" /> <h:outputText value="" /> <h:outputText value="#{msg.adresse} :" /> <h:outputText value="#{item.adresse}" /> <h:outputText value="" /> <h:outputText value="#{msg.tel} :" /> <h:outputText value="#{item.tel}" /> <h:outputText value="" /> <h:outputText value="#{msg.mail} :" /> <h:outputText value="#{item.email}" /> <h:outputText value="" /> <h:outputText value="" /> <h:outputText value="" /> <h:graphicImage onclick="showPlace('#{item.id}')" style="cursor:pointer" value="images/marker.jpg" /> </h:panelGrid> </rich:column> <f:facet name="footer"> <rich:datascroller id="ds"></rich:datascroller> </f:facet> </rich:dataTable> </td> <td style="height:250px;width:250px"> <rich:gmap gmapVar="map" zoom="#{place.zoom}" style="width:400px;height:400px" gmapKey="#{place.gmapkey}" id="gmap" /> </td> </tr> </table> </h:form> </h:panelGroup>
Partager