Bonjour,
J'ai utilisé PrimeFaces pour un agenda qui affiche les tâches des utilisateurs d'une façon dynamique.
Voilà le message d'erreur:
class controller:type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Impossible d?instancier la classe «com.src.jsf.ScheduleController».
root cause
com.sun.faces.mgbean.ManagedBeanCreationException: Impossible d?instancier la classe «com.src.jsf.ScheduleController».
root cause
java.lang.NullPointerException
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.1 logs.
Page Web
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 public class ScheduleController implements Serializable { @EJB private AgendatacheFacade agendatacheFacade; private ScheduleModel eventModel; private ScheduleEvent event = new DefaultScheduleEvent(); List<Agendatache> listtache; public ScheduleController() { listtache = agendatacheFacade.getTache(); eventModel = new DefaultScheduleModel(); Agendatache tache=new Agendatache(); String desc=""; Date datedebut=new Date(); Date datefin = new Date(); for(int i=0; i<listtache.size(); i++){ tache=listtache.get(i); desc=tache.getDescripTache(); datedebut=tache.getDateDebut(); datefin=tache.getDateFin(); eventModel.addEvent(new DefaultScheduleEvent(desc,datedebut, datefin)); } }
Quelqu'un saurait-il m'indiquer d'où peut venir le problème ?
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 <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.prime.com.tr/ui"> <h:head> <title>Facelet Title</title> </h:head> <h:body> Hello from Facelets <h:form id="form"> <p:growl id="messages" showDetail="true" /> <p:schedule id="schedule" value="#{scheduleController.eventModel}" widgetVar="myschedule"> <p:ajax event="dateSelect" listener="#{scheduleController.onDateSelect}" update="eventDetails" oncomplete="PF('eventDialog').show()" /> <p:ajax event="eventSelect" listener="#{scheduleController.onEventSelect}" update="eventDetails" oncomplete="PF('eventDialog').show()" /> <p:ajax event="eventMove" listener="#{scheduleController.onEventMove}" update="messages" /> <p:ajax event="eventResize" listener="#{scheduleController.onEventResize}" update="messages" /> </p:schedule> <p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip"> <h:panelGrid id="eventDetails" columns="2"> <h:outputLabel for="title" value="Title:" /> <p:inputText id="title" value="#{scheduleController.event.title}" required="true"/> <h:outputLabel for="from" value="From:" /> <p:inputMask id="from" value="#{scheduleController.event.startDate}" mask="99/99/9999"> <f:convertDateTime pattern="dd/MM/yyyy" /> </p:inputMask> <h:outputLabel for="to" value="To:" /> <p:inputMask id="to" value="#{scheduleController.event.endDate}" mask="99/99/9999"> <f:convertDateTime pattern="dd/MM/yyyy" /> </p:inputMask> <h:outputLabel for="allDay" value="All Day:" /> <h:selectBooleanCheckbox id="allDay" value="#{scheduleController.event.allDay}" /> <p:commandButton type="reset" value="Reset" /> <p:commandButton id="addButton" value="Save" actionListener="#{scheduleController.addEvent}" oncomplete="PF('myschedule').update();PF('eventDialog').hide();"/> </h:panelGrid> </p:dialog> </h:form> </h:body> </html>
Merci d'avance pour votre aide.
Partager