mysql - HTTP Status 500 - An exception occurred processing JSP page /ratinglist.jsp at line 50 -


ok have tried working on hour , sure it's easy think blind own code. page should retrieve data sent arraylist retrieved query mysql. here tomcat log:

    06-mar-2016 20:42:26.465 severe [http-nio-8084-exec-12] org.apache.catalina.core.standardwrappervalve.invoke servlet.service() servlet [ratingservlet] in context path [] threw exception [an exception occurred processing jsp page /ratinglist.jsp @ line 50  47:                 <tr> 48:                     <td>${newrating.scale}</td> 49:                     <td>${newrating.userid}</td> 50:                     <td>${newrating.text_rating}</td> 51:                     <td></td> 52:                     <%--  <td>${newrating.text_rating}</td> --%> 53:                     <td></td>   stacktrace:] root cause  javax.el.propertynotfoundexception: property 'text_rating' not found on type edu.csueb.cs6665.bean.ratings     @ javax.el.beanelresolver$beanproperties.get(beanelresolver.java:245)     @ javax.el.beanelresolver$beanproperties.access$300(beanelresolver.java:222)     @ javax.el.beanelresolver.property(beanelresolver.java:332)     @ javax.el.beanelresolver.getvalue(beanelresolver.java:95)     @ org.apache.jasper.el.jasperelresolver.getvalue(jasperelresolver.java:110)     @ org.apache.el.parser.astvalue.getvalue(astvalue.java:167)     @ org.apache.el.valueexpressionimpl.getvalue(valueexpressionimpl.java:187)     @ org.apache.jasper.runtime.pagecontextimpl.proprietaryevaluate(pagecontextimpl.java:956)     @ org.apache.jsp.ratinglist_jsp._jspx_meth_c_005fforeach_005f0(ratinglist_jsp.java:173)     @ org.apache.jsp.ratinglist_jsp._jspservice(ratinglist_jsp.java:116)     @ org.apache.jasper.runtime.httpjspbase.service(httpjspbase.java:70)     @ javax.servlet.http.httpservlet.service(httpservlet.java:725)     @ org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:432)     @ org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:405)     @ org.apache.jasper.servlet.jspservlet.service(jspservlet.java:349)     @ javax.servlet.http.httpservlet.service(httpservlet.java:725)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:291)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)     @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)     @ org.netbeans.modules.web.monitor.server.monitorfilter.dofilter(monitorfilter.java:393)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)     @ org.apache.catalina.core.applicationdispatcher.invoke(applicationdispatcher.java:721)     @ org.apache.catalina.core.applicationdispatcher.processrequest(applicationdispatcher.java:466)     @ org.apache.catalina.core.applicationdispatcher.doforward(applicationdispatcher.java:391)     @ org.apache.catalina.core.applicationdispatcher.forward(applicationdispatcher.java:318)     @ edu.csueb.cs6665.servlet.ratingservlet.processrequest(ratingservlet.java:127)     @ edu.csueb.cs6665.servlet.ratingservlet.doget(ratingservlet.java:144)     @ javax.servlet.http.httpservlet.service(httpservlet.java:618)     @ javax.servlet.http.httpservlet.service(httpservlet.java:725)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:291)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)     @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)     @ org.netbeans.modules.web.monitor.server.monitorfilter.dofilter(monitorfilter.java:393)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206)     @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:219)     @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:106)     @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:503)     @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:136)     @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:79)     @ org.apache.catalina.valves.abstractaccesslogvalve.invoke(abstractaccesslogvalve.java:610)     @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:88)     @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:526)     @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1078)     @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:655)     @ org.apache.coyote.http11.http11nioprotocol$http11connectionhandler.process(http11nioprotocol.java:222)     @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1566)     @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.run(nioendpoint.java:1523)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617)     @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61)     @ java.lang.thread.run(thread.java:745) 

here have:

ratinglist.jsp

 <body>     <jsp:include page="/include/header.jsp"/>     <div class="container">     <h1>videos list</h1>     <table class="table table-striped tablesorter">         <thead>         <tr>             <th>scale</th>             <th>user</th>             <th>date</th>             <th>comment</th>             <th>video</th>         </tr>         </thead>         <tbody>         <c:foreach var="newrating" items="${newrating}">             <tr>                 <td>${newrating.scale}</td>                 <td>${newrating.userid}</td>                 <td>${newrating.text_rating}</td>                 <td></td>                 <%--  <td>${newrating.text_rating}</td> --%>                 <td></td>                 <%-- <td>${newrating.video_id}</td> --%>                 <td></td>             </tr>           </c:foreach>         </tbody>      </table>      </div>  </body> 

ratingservlet.java

package edu.csueb.cs6665.servlet;  import edu.csueb.cs6665.bean.ratings; import edu.csueb.cs6665.bean.user; import edu.csueb.cs6665.util.ratingutil; import edu.csueb.cs6665.util.userutils; import java.io.ioexception; import java.io.printwriter; import java.text.parseexception; import java.text.simpledateformat; import java.util.arraylist; import java.util.date; import java.util.list; import java.util.logging.level; import java.util.logging.logger; import javax.servlet.servletexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse;  /**  *  * @author shawn  */ public class ratingservlet extends httpservlet {      /**      * processes requests both http <code>get</code> , <code>post</code>      * methods.      *      * @param request servlet request      * @param response servlet response      * @throws servletexception if servlet-specific error occurs      * @throws ioexception if i/o error occurs      */     protected void processrequest(httpservletrequest request, httpservletresponse response)             throws servletexception, ioexception {         response.setcontenttype("text/html;charset=utf-8");         string dispatcher="/rating.jsp";         string role = request.getparameter("role");         string action = request.getparameter("action");         if(null != action && action.equals("delete")){             int id = integer.parseint(request.getparameter("id"));             if(id>=0){                 boolean status = ratingutil.removeratingbyid(id);             }         }         if(null != action && action.equals("update2")){             system.out.println("inside rating update2");             integer id = integer.parseint(request.getparameter("id"));             integer scale = integer.parseint(request.getparameter("scale"));             integer user_id = integer.parseint(request.getparameter("user_id"));             string timedate_rating = request.getparameter("timedate_rating");             string text_rating = request.getparameter("text_rating");             integer video_id = integer.parseint(request.getparameter("video_id"));              if(id>=0){                 boolean status = ratingutil.updateratingbyid(scale, user_id, timedate_rating, text_rating, video_id, id);             }         }         if(null != action && action.equals("update")){             integer id = integer.parseint(request.getparameter("id"));             integer scale = integer.parseint(request.getparameter("scale"));             integer userid = integer.parseint(request.getparameter("user_id"));             string ratingdate = request.getparameter("timedate_rating");             string text = request.getparameter("text_rating");             integer videoid = integer.parseint(request.getparameter("video_id"));               if(null != id){                 ratings rating = new ratings();                 rating.setid(id);                 rating.setscale(scale);                 rating.setuserid(userid);                 rating.settimedate(ratingdate);                 rating.setrating(text);                 rating.setvideo(videoid);                   request.setattribute("newrating", rating);                 dispatcher="/ratingupdate.jsp";              }         }         if(null != action && action.equals("insert")){             integer scale = integer.parseint(request.getparameter("scale"));             integer userid = integer.parseint(request.getparameter("user_id"));             string ratingdate = request.getparameter("timedate_rating");             string text = request.getparameter("text_rating");             integer videoid = integer.parseint(request.getparameter("video_id"));               ratings rating = new ratings(scale, userid, ratingdate, text, videoid);              //product.setreleasedate(releasedate);              if(null != scale){                 boolean status = ratingutil.insertrating(rating);             }         }         if(action.equals("load")){         system.out.println("inside ratingservlet, loading");         list<ratings> rating = ratingutil.getratings();         request.setattribute("newratings", rating);             if(role=="user"){                 dispatcher="/ratinglist.jsp";             }         }          if(action.equals("list")){         system.out.println("inside ratingservlet, listing");         list<ratings> rating = ratingutil.getratings();         request.setattribute("newrating", rating);         dispatcher="/ratinglist.jsp";          }         list<ratings> rating = ratingutil.getratings();         request.setattribute("newrating", rating);            this.getservletcontext().getrequestdispatcher(dispatcher).forward(request, response);     } 

rating.java

package edu.csueb.cs6665.bean;  import java.util.date; import java.io.serializable;  /**  *  */ public class ratings implements serializable{     private int id;     private int scale;     private int user_id;     private int video_id;     private string timedate_rating;     private string text_rating;         public ratings(){      }           public ratings(int scale, int user_id, string timedate_rating, string text_rating, int video_id) {         this.setscale(scale);         this.setuserid(user_id);         this.settimedate(timedate_rating);         this.setrating(text_rating);         this.setvideo(video_id);     }          public ratings(int scale, int user_id, string timedate_rating, string text_rating, int video_id, int id) {         this.setscale(scale);         this.setuserid(user_id);         this.settimedate(timedate_rating);         this.setrating(text_rating);         this.setvideo(video_id);         this.setid(id);     }      public int getscale() {         return scale;     }      public void setscale(int scale) {         this.scale = scale;     }       public int getid() {         return id;     }      public void setid(int id) {         this.user_id = id;     }      public int getuserid() {         return user_id;     }      public void setuserid(int user_id) {         this.user_id = user_id;     }      public string gettimedate() {         return timedate_rating;     }      public void settimedate(string timedate) {         this.timedate_rating = timedate;     }      public string getrating() {         return text_rating;     }      public void setrating(string text_rating) {         this.text_rating = text_rating;     }       public int getvideo() {         return video_id;     }      public void setvideo(int video_int) {         this.video_id = video_int;     }  } 

if had guess it's because of way in variables , getters/setters named in ratings text_rating. try rename getter , setter gettextrating , settextrating , see if trick. may not able text_rating in .jsp because there's no getter matches name (only getrating).


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -