memory leak error when using an iterator
- by Adnane Jaafari
please i'm having this error if any one can explain it :
while using an iterator in my methode
public void createDemandeP() {
if (demandep.getDateDebut().after(demandep.getDateFin())) {
FacesContext
.getCurrentInstance()
.addMessage(
null,
new FacesMessage(FacesMessage.SEVERITY_WARN,
"Attention aux dates",
"la date de debut doit être avant la date de fin!"));
} else if (demandep.getDateDebut().before(demandep.getDateFin())) {
List<DemandeP> list = new ArrayList<DemandeP>();
list.addAll(chaletService.getChaletBylibelle(chaletChoisi).get(0)
.getListDemandesP());
Iterator<DemandeP> it = list.iterator();
DemandeP d = it.next();
while (it.hasNext()) {
if ((d.getDateDebut().compareTo(demandep.getDateDebut()) == 0)
|| (d.getDateFin().compareTo(demandep.getDateDebut()) == 0)
|| (d.getDateFin().compareTo(demandep.getDateFin()) == 0)
|| (d.getDateDebut().compareTo(demandep.getDateDebut()) == 0)
|| (d.getDateDebut().before(demandep.getDateDebut()) && d
.getDateFin().after(demandep.getDateFin()))
|| (d.getDateDebut().before(demandep.getDateFin()) && d
.getDateDebut().after(demandep.getDateDebut()))
|| (d.getDateFin().after(demandep.getDateDebut()) && d
.getDateFin().before(demandep.getDateFin()))) {
FacesContext.getCurrentInstance().getMessageList().clear();
FacesContext
.getCurrentInstance()
.addMessage(
null,
new FacesMessage(
FacesMessage.SEVERITY_FATAL,
"Periode Ou chalet indisponicle ",
"Veillez choisir une autre marge de date !"));
}
}
} else {
demandep.setEtat("En traitement");
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date date = new Date();
try {
demandep.setDateDemande(dateFormat.parse(dateFormat
.format(date)));
} catch (ParseException e) {
System.out.println("errooor date");
e.printStackTrace();
}
nameUser = auth.getName();
// System.out.println(nameUser);
adherent = utilisateurService.findAdherentByNom(nameUser).get(0);
demandep.setUtilisateur(adherent);
// System.out.println(chaletService.getChaletBylibelle(chaletChoisi).get(0).getLibelle());
demandep.setChalet(chaletService.getChaletBylibelle(chaletChoisi)
.get(0));
demandep.setNouvelleDemande(true);
demandePService.ajouterDemandeP(demandep);
}
}
oct. 23, 2013 7:19:30 PM org.apache.catalina.core.StandardContext reload
INFO: Le rechargement du contexte [/ONICLFINAL] a démarré
oct. 23, 2013 7:19:30 PM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
oct. 23, 2013 7:19:31 PM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
oct. 23, 2013 7:19:32 PM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
oct. 23, 2013 7:19:32 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/ONICLFINAL] registered the JDBC driver [com.mysql.jdbc.Driver] b but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/ONICLFINAL] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SE VERE: The web application [/ONICLFINAL] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ONICLFINAL] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Hibernate Sessions registered for deferred close]) and a value of type [java.util.HashMap] (value [{org.hibernate.impl.SessionFactoryImpl@f6e256=[SessionImpl(PersistenceContext[entityKeys=[EntityKey[bo.DemandeP#1], EntityKey[bo.Utilisateur#3], EntityKey[bo.Chalet#1], EntityKey[bo.Role#2], EntityKey[bo.DemandeP#2]],collectionKeys=[CollectionKey[bo.Role.ListeUsers#2], CollectionKey[bo.Chalet.listPeriodes#1], CollectionKey[bo.Utilisateur.demandes#3], CollectionKey[bo.Utilisateur.demandesP#3], CollectionKey[bo.Chalet.listDemandesP#1]]];ActionQueue[insertions=[] updates=[] deletions=[] collectionCreations=[] collectionRemovals=[] collectionUpdates=[]])]}]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ONICLFINAL] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Request attributes]) and a value of type [org.springframework.web.context.request.ServletRequestAttributes] (value [org.apache.catalina.connector.RequestFacade@17f3488]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ONICLFINAL] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@51f78b]) and a value of type [org.springframework.security.core.context.SecurityContextImpl] (value [org.springframework.security.core.context.SecurityContextImpl@8e463c8b: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@8e463c8b: Principal: org.springframework.security.core.userdetails.User@311aa119: Username: maatouf; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADHER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff4c9c: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: 14CD5D4E8E0E3AEB0367AB7115038FED; Granted Authorities: ROLE_ADHER]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ONICLFINAL] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@152e9b7]) and a value of type [net.sf.cglib.proxy.Callback[]] (value [[Lnet.sf.cglib.proxy.Callback;@6e1f4c]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ONICLFINAL] created a ThreadLocal with key of type [javax.faces.context.FacesContext$1] (value [javax.faces.context.FacesContext$1@9ecc6d]) and a value of type [com.sun.faces.context.FacesContextImpl] (value [com.sun.faces.context.FacesContextImpl@1c8bbed]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ONICLFINAL] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1a9e75f]) and a value of type [com.sun.faces.context.FacesContextImpl] (value [com.sun.faces.context.FacesContextImpl@1c8bbed]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ONICLFINAL] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Locale context]) and a value of type [org.springframework.context.i18n.SimpleLocaleContext] (value [fr_FR]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
oct. 23, 2013 7:19:32 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [/ONICLFINAL] created a ThreadLocal with key of type [com.sun.faces.application.ApplicationAssociate$1] (value [com.sun.faces.application.ApplicationAssociate$1@195266b]) and a value of type [com.sun.faces.application.ApplicationAssociate] (value [com.sun.faces.application.ApplicationAssociate@10d595c]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
oct. 23, 2013 7:19:33 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\newWorkSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ONICLF INAL\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
oct. 23, 2013 7:19:33 PM org.apache.catalina.core.ApplicationContext log