1 Reply Latest reply on Dec 19, 2007 11:29 AM by Mark Jones

    Strang bug - not evaluating expression

    Mark Jones Newbie

      I have a problem where I keep getting the following stack.

      19-Dec-2007 16:23:13 org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NumberFormatException: For input string: "getEvidenceid"
       at java.lang.NumberFormatException.forInputString(Unknown Source)
       at java.lang.Integer.parseInt(Unknown Source)
       at java.lang.Integer.parseInt(Unknown Source)
       at javax.el.ListELResolver.coerce(ListELResolver.java:166)
       at javax.el.ListELResolver.getValue(ListELResolver.java:51)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
       at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:58)
       at org.apache.el.parser.AstValue.getValue(AstValue.java:97)
       at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
       at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
       at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
       at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:100)
       at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:282)
       at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:208)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:847)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
       at org.richfaces.renderkit.AbstractTableRenderer.encodeOneRow(AbstractTableRenderer.java:246)
       at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:87)
       at org.ajax4jsf.model.SequenceDataModel.walk(SequenceDataModel.java:101)
       at org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:994)
       at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:107)
       at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:92)
       at org.richfaces.renderkit.AbstractRowsRenderer.encodeChildren(AbstractRowsRenderer.java:139)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:827)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:883)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:827)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:883)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:889)
       at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:258)
       at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Unknown Source)


      My jsp inside tomcat is >



      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <html>
      <head>
      <title>evidence</title>
      </head>
      <body>
      
       <f:view>
      
       <h:form>
      
       <rich:datascroller align="left" for="evidenceList" maxPages="20" />
      
       <rich:spacer height="30" />
      
       <rich:dataTable rows="10" id="evidenceList" value="#{bean.allEvidence}" var="evid">
      
       <h:column>
       <f:facet name="header">
       <h:outputText value="EvidenceId" />
       </f:facet>
      
       <h:outputText value="#{evid.evidenceid}" />
      
       </h:column>
      
       </rich:dataTable>
      
       </h:form>
      
      </f:view>
      </body>
      </html>


      My entity is
      package uk.ac.ukoln.impact.entity;
      
      
      import java.io.Serializable;
      import java.util.Set;
      import javax.persistence.Entity;
      import javax.persistence.Id;
      import javax.persistence.JoinColumn;
      import javax.persistence.JoinTable;
      import javax.persistence.ManyToMany;
      import javax.persistence.OneToOne;
      
      @Entity
      public class Evidence implements Serializable {
       @Id
       private int evidenceid;
      
       private int msginid;
      
       @OneToOne
       @JoinTable(name="report_evidence",
       joinColumns=@JoinColumn(name="evidenceId"),
       inverseJoinColumns=@JoinColumn(name="reportId"))
       private Set<Report> reportCollection;
      
       private static final long serialVersionUID = 1L;
      
       public Evidence() {
       super();
       }
      
       public int getEvidenceid() {
       return this.evidenceid;
       }
      
       public void setEvidenceid(int evidenceid) {
       this.evidenceid = evidenceid;
       }
      
       public String getEid() {
       return "jggf";
       }
      
       public void setEid(String Eid) {
      
       }
      
       public int getMsginid() {
       return this.msginid;
       }
      
       public void setMsginid(int msginid) {
       this.msginid = msginid;
       }
      
       public Set<Report> getReportCollection() {
       return this.reportCollection;
       }
      
       public void setReportCollection(Set<Report> reportCollection) {
       this.reportCollection = reportCollection;
       }
      
      }
      


      If i change line 26 of my jsp to

      <h:outputText value="#{evid.getEvidenceid}" />


      I get square bracketed output. To me it seems that the expression is not being evaluated. Any help is greatly appreciated