Bonjour,
j'ai un problème sur lequel je me casse les dents depuis plusieurs jours, j'ai pourtant cherché à le régler tout seul mais n'y arrivant vraiment pas je vous appelle à l'aide.
J'ai une page sur laquelle je veux afficher un tableau contenant ce qu'il y a dans ma bdd.
mon faces-config placé dans le web-inf :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 <h:dataTable value="#{books.books}" var="b" border="1"> <!-- name --> <h:column> <f:facet name="header"> Name </f:facet> #{b.name} </h:column> </h:dataTable> </ui:define>
mon managed bean :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <managed-bean> <managed-bean-name>books</managed-bean-name> <managed-bean-class>com.groupe5.managelib.web.managedbeans.BookManagedBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean>
J'utilise jboss et eclipse.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 public class BookManagedBean extends AbstractManagedBean { public int getBooksNbr(){ return getBooks().size(); } public List<Book> getBooks(){ return getCustomerSession().getBooks(); } }
L'erreur en question au lancement de la page :
Si vous pouviez m'indiquer la route à suivre... Merci !
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 javax.faces.el.EvaluationException: /book.xhtml @17,59 value="#{books.books}": Exception getting value of property books of base of type : com.groupe5.managelib.web.managedbeans.BookManagedBean at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60) at javax.faces.component.UIData.getValue(UIData.java:1019) at javax.faces.component.UIData.createDataModel(UIData.java:785) at javax.faces.component.UIData.getDataModel(UIData.java:765) at javax.faces.component.UIData.getRowCount(UIData.java:191) at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:210) at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:123) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524) at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:234) at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) Caused by: javax.faces.el.EvaluationException: Bean: com.groupe5.managelib.web.managedbeans.BookManagedBean, property: books at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:442) at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82) at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141) at com.sun.el.parser.AstValue.getValue(AstValue.java:117) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192) at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56) ... 30 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:438) ... 36 more Caused by: java.lang.NoClassDefFoundError at org.jboss.aspects.security.SecurityActions.peekRunAsIdentity(SecurityActions.java:341) at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:86) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181) at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79) at $Proxy133.getBooks(Unknown Source) at com.groupe5.managelib.web.managedbeans.BookManagedBean.getBooks(BookManagedBean.java:13) ... 41 more
Partager